You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you searched for related issues? Others may have had similar requests Yes
Describe the feature
What is the feature you're requesting?
I would like to request support for using HTTP as a transport for MCP servers in the Agents SDK, in addition to the current stdio-based approach. This would allow agents to communicate with MCP servers that expose an HTTP endpoint, making it easier to integrate with remote or cloud-hosted MCP services.
How would it work?
The feature would introduce a new class (e.g., MCPServerHttp) that implements the same interface as the current stdio-based server, but sends each MCP request as an HTTP POST to a configurable endpoint. This class would handle serialization of JSON-RPC messages, manage request/response cycles, and allow for optional headers (e.g., for authentication).
Why is this useful?
Enables integration with MCP servers running remotely or in serverless/cloud environments.
Makes it easier to deploy and scale MCP servers independently of the Python process.
Allows for more flexible networking and security configurations (e.g., HTTPS, authentication headers).
Additional context:
I have already implemented this feature in my own project and would like to contribute it upstream via a pull request. The implementation uses httpx for async HTTP requests, is compatible with the existing agent/runner workflow, and handles errors gracefully. I am happy to adapt the code to fit the maintainers' preferences and add tests/documentation as needed.
Let me know if you'd like to see the implementation or have any questions!
The text was updated successfully, but these errors were encountered:
Yes, I did, but in my deployment and to many others a simple HTTP POST/response flow is all that’s needed, and requiring SSE adds extra moving parts and infrastructure that most MCP servers don’t use. This is why I wanted to add this feature.
I wanted to propose a quick workaround until streamable HTTP support is available, but I understand. If you don’t think it’s necessary, please feel free to close this issue. Thanks!
Please read this first
Describe the feature
What is the feature you're requesting?
I would like to request support for using HTTP as a transport for MCP servers in the Agents SDK, in addition to the current stdio-based approach. This would allow agents to communicate with MCP servers that expose an HTTP endpoint, making it easier to integrate with remote or cloud-hosted MCP services.
How would it work?
The feature would introduce a new class (e.g.,
MCPServerHttp
) that implements the same interface as the current stdio-based server, but sends each MCP request as an HTTP POST to a configurable endpoint. This class would handle serialization of JSON-RPC messages, manage request/response cycles, and allow for optional headers (e.g., for authentication).Why is this useful?
Additional context:
I have already implemented this feature in my own project and would like to contribute it upstream via a pull request. The implementation uses
httpx
for async HTTP requests, is compatible with the existing agent/runner workflow, and handles errors gracefully. I am happy to adapt the code to fit the maintainers' preferences and add tests/documentation as needed.Let me know if you'd like to see the implementation or have any questions!
The text was updated successfully, but these errors were encountered: