
Build MCP servers in Python with modern, stateless MCP support, built-in task orchestration, stronger authentication, and the latest MCP capabilities.
Python is one of the most widely used languages for building AI applications, agent systems, data workflows, and developer tools. With the growing adoption of the Model Context Protocol (MCP), developers need a simple way to turn their Python applications and services into reliable, production-ready MCP servers.
Today, we’re introducing Python SDK support in NitroStack 🎉
With the NitroStack Python SDK, developers can build and deploy MCP servers in Python while taking advantage of the latest MCP capabilities—including stateless HTTP, MCP 2.x, task orchestration, OAuth 2.1, multi-round-trip requests, subscriptions, tracing, and more.
The SDK also maintains backward compatibility with existing 2025-era sessionful MCP clients, making it easier to adopt the latest protocol capabilities without breaking existing integrations.
✨What’s New
1. Modern, Stateless MCP with MCP 2.x
NitroStack Python now integrates with the official mcp** 2.x package** and supports the latest MCP protocol era.
You can run MCP servers using modern stateless HTTP without relying on server-side sessions.
The Python SDK supports:
- Official
mcp2.x HTTP integration - Stateless MCP over HTTP
- Streamable HTTP transport
- Modern stdio transport
server/discoverfor server capability discovery- Per-request
_metasupport - MCP protocol version headers
- CORS support for modern MCP headers
- Health and ping endpoints
- Concurrent request isolation
NitroStack also provides runtime protocol-era resolution, with auto as the default.
This means a NitroStack server can support modern clients while continuing to work with legacy 2025-era clients where required.
2. Backward Compatibility Built In
Moving to a newer MCP specification shouldn't require developers to immediately rewrite everything.
NitroStack's Python SDK supports both modern and legacy protocol behavior through protocol-era selection.
By default, NitroStack uses auto mode. Developers can also explicitly configure:
- Modern — pure stateless MCP using the 2026-07-28 protocol
- Legacy — sessionful 2025-era MCP
- Auto — automatically supports the appropriate protocol behavior
This makes it possible to adopt modern MCP capabilities while maintaining existing integrations.
3. Task Orchestration for Long-Running Operations
Not every tool call can finish in a single request.
AI agents increasingly need to trigger operations that take time—whether that's processing data, running a workflow, or waiting for user input.
NitroStack now includes a dedicated TaskManager and TaskStore architecture for handling these workflows.
The Python SDK supports task lifecycles including:
- Task creation
- Progress tracking
input_required- Resume
- Completion
- Failure handling
- Cancellation
- Pagination
- Multi-tenant task authorization
Task storage is also pluggable, with an InMemoryTaskStore available by default and support for custom task-store implementations.
This gives developers a foundation for building MCP tools that don't have to complete synchronously.
4. Multi-Channel Task Notifications
Tasks are only useful when clients can understand what's happening.
NitroStack introduces a TaskStatusRouter that can route task status notifications across multiple transports, including:
- Modern subscription endpoints
- Legacy SSE
- stdio
This allows clients to receive updates as tasks move through their lifecycle without coupling the task implementation to a single transport.
5. Stronger OAuth 2.1 and Security
Production MCP servers need more than basic authentication.
NitroStack's Python SDK adds hardened authentication and security mechanisms around modern MCP deployments.
This includes:
- OAuth 2.1 support
- Bearer token verification
- JWT validation
- Client ID Metadata Document (CIMD) resolution
- HTTPS-only CIMD fetching
- SSRF protection
- Private and special-use IP blocking
- Issuer validation
- Multiple supported token locations
- Tool argument sanitization
NitroStack also strips protocol metadata from tool arguments before they reach application handlers, helping keep protocol-level information separate from application-level inputs.
6. Multi-Round-Trip Requests and Interactive Elicitation
Some agent workflows require more than a single request and response.
With support for Multi-Round-Trip Requests (MRTR), NitroStack can handle workflows where a tool needs additional information before it can continue.
The Python SDK introduces helpers for:
input_requiredinputRequests- Opaque
requestState
This enables more interactive MCP experiences where agents and users can participate in multi-step workflows.
7. JSON Schema 2020-12 Support
NitroStack Python now supports JSON Schema 2020-12 for MCP schema handling.
The SDK validates schemas during registration and includes bounded schema processing to keep schema resolution predictable.
This provides a stronger foundation for defining and validating tools, resources, and prompts in modern MCP applications.
8. Built-In Observability
Understanding what happens across an AI-agent workflow becomes increasingly important as MCP systems become more distributed.
NitroStack now supports W3C Trace Context, including:
traceparenttracestatebaggage
These values are available through the execution context, allowing applications to propagate tracing information through MCP operations.
This makes it easier to connect MCP activity with existing observability and distributed-tracing infrastructure.
9. Cache Hints
The SDK also adds cache hints to relevant MCP responses.
Developers can provide:
ttlMscacheScope
for list, read, and discovery responses.
This gives MCP clients additional information they can use when deciding how responses should be cached.
10. Subscriptions and Modern stdio
NitroStack Python now supports the modern MCP subscription model through:
GET/POST /subscriptions/listen
The subscription listener integrates with the official MCP 2.x subscription bus and can be protected with JWT authentication when OAuth is enabled.
Modern stdio behavior is also supported, with protocol-era routing that allows developers to use modern or legacy behavior depending on their configuration.
A Flexible Architecture for Modern MCP
The new Python support isn't just about adding another language SDK.
It's designed around the way modern MCP systems are evolving.
At the transport layer, NitroStack supports HTTP and stdio. The protocol-era selector determines whether the request should use modern stateless MCP or legacy sessionful behavior.
Modern requests then flow through NitroStack's authentication, task orchestration, schema validation, elicitation, observability, and caching layers before reaching the application's tools, resources, prompts, and widgets.
This architecture lets developers focus on their application logic while NitroStack handles much of the MCP infrastructure around it.
Configuration
Protocol behavior can be configured through environment variables.
For example, NitroStack can run in automatic protocol selection mode:
MCP_TRANSPORT_TYPE=http
PORT=3000
HOST=127.0.0.1NITRO_MCP_PROTOCOL_VERSION=auto
Developers who want to explicitly use the modern protocol can configure:
NITRO_MCP_PROTOCOL_VERSION=2026-07-28
And existing sessionful behavior can be selected when needed:
NITRO_MCP_PROTOCOL_VERSION=2025-06-18
NitroStack also supports an explicit MCP_STATELESS override, which takes precedence over the protocol-version configuration.
Built for Production MCP
Modern MCP introduces capabilities that go far beyond simply exposing a function as a tool.
Production MCP infrastructure needs to support stateless communication, long-running tasks, authentication and authorization, interactive workflows, schema validation, subscriptions, observability, caching, and backward compatibility.
The NitroStack Python SDK brings these capabilities together in one framework.
The implementation has also been validated with a dedicated MCP 2.0 acceptance test suite covering 17 test modules and 455 tests, including stateless HTTP, task orchestration, OAuth/CIMD security, subscriptions, concurrency, stdio, MRTR, caching, and observability.
Why Python + NitroStack?
With Python support, developers can now bring existing Python applications, AI workflows, and backend services into the MCP ecosystem without having to build the protocol infrastructure from scratch.
Instead of implementing transport handling, task lifecycles, authentication, subscriptions, and protocol compatibility independently, NitroStack provides those capabilities as part of the SDK.
That means you can spend more time building what your MCP server actually does—and less time maintaining the infrastructure around it.
🚀 What's Next?
MCP is evolving quickly, and the way agents interact with tools and applications is changing with it.
With Python support and modern MCP capabilities now available in NitroStack, we're continuing to build toward a simpler developer experience for creating reliable, scalable, and agent-ready applications.
If you're building an AI application, SaaS product, internal tool, or agent workflow in Python, NitroStack gives you a path to expose it through MCP while being ready for the latest protocol capabilities.
Build your MCP server in Python. Let NitroStack handle the infrastructure.
About the Author

Sharvari Raut
AuthorA blog poet ✍🏻