Skip to content

Add HTTP (non-stdio) MCP server support to Agents SDK #616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
skanderkaroui opened this issue Apr 27, 2025 · 4 comments
Closed

Add HTTP (non-stdio) MCP server support to Agents SDK #616

skanderkaroui opened this issue Apr 27, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@skanderkaroui
Copy link

Please read this first

  • Have you read the docs? Agents SDK docs Yes
  • 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!

@skanderkaroui skanderkaroui added the enhancement New feature or request label Apr 27, 2025
@pakrym-oai
Copy link
Contributor

@skanderkaroui
Copy link
Author

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.

@pakrym-oai
Copy link
Contributor

We'll support transports described by the MCP spec, today it's SSE and streamable HTTP in the future (https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http / #600)

@skanderkaroui
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants