openai-agents-python/src/agents/mcp/__init__.py
Rohan Mehta 97e3dc3c76 [1/n] Add MCP types to the SDK
### Summary:
1. Add the MCP dep for python 3.10, since it doesn't support 3.9 and below
2. Create MCPServer, which is the agents SDK representation of an MCP server
3. Create implementations for HTTP-SSE and StdIO servers, directly copying the [MCP SDK example](https://github.com/modelcontextprotocol/python-sdk/blob/main/examples/clients/simple-chatbot/mcp_simple_chatbot/main.py)
4. Add a util to transform MCP tools into Agent SDK tools

Note: I added optional caching support to the servers. That way, if you happen to know a server's tools don't change, you can just cache them.

### Test Plan:

Checks pass. I added tests at the end of the stack.
2025-03-25 12:51:40 -04:00

21 lines
359 B
Python

try:
from .server import (
MCPServer,
MCPServerSse,
MCPServerSseParams,
MCPServerStdio,
MCPServerStdioParams,
)
except ImportError:
pass
from .util import MCPUtil
__all__ = [
"MCPServer",
"MCPServerSse",
"MCPServerSseParams",
"MCPServerStdio",
"MCPServerStdioParams",
"MCPUtil",
]