Skip to content

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

Closed
@skanderkaroui

Description

@skanderkaroui

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions