Commit graph

10 commits

Author SHA1 Message Date
westhood
775d3e237e
Ensure item.model_dump only contains JSON serializable types (#801)
The EmbeddedResource from MCP tool call contains a field with type
AnyUrl that is not JSON-serializable. To avoid this exception, use
item.model_dump(mode="json") to ensure a JSON-serializable return value.
2025-06-02 11:10:21 -04:00
Daniele Morotti
003cbfe5f5
Added mcp 'instructions' attribute to the server (#706)
Added the `instructions` attribute to the MCP servers to solve #704 .

Let me know if you want to add an example to the documentation.
2025-05-18 13:25:08 -04:00
Akshit97
1847008e0f
feat: Streamable HTTP support (#643)
Co-authored-by: aagarwal25 <akshit_agarwal@intuit.com>
2025-05-14 14:45:14 -04:00
Nathan Brake
af80e3a971
Prevent MCP ClientSession hang (#580)
Per
https://modelcontextprotocol.io/specification/draft/basic/lifecycle#timeouts

"Implementations SHOULD establish timeouts for all sent requests, to
prevent hung connections and resource exhaustion. When the request has
not received a success or error response within the timeout period, the
sender SHOULD issue a cancellation notification for that request and
stop waiting for a response.

SDKs and other middleware SHOULD allow these timeouts to be configured
on a per-request basis."

I picked 5 seconds since that's the default for SSE
2025-04-24 12:12:46 -04:00
Steven Heidel
2bdf9b7b11
Pass through organization/project headers to tracing backend, fix speech_group enum (#562) 2025-04-21 16:59:46 -04:00
Rohan Mehta
50bbfdd8be
Ensure MCP works when inputSchema.properties is missing (#454)
Resolves #449 - TLDR, [OpenAI's
API](https://platform.openai.com/docs/api-reference/responses/create)
expects the properties field to be present, whereas the MCP schema
explicitly allows omitting the properties field. [MCP
Spec](https://github.com/modelcontextprotocol/specification/blob/main/schema/2025-03-26/schema.json)
2025-04-07 18:38:36 -04:00
Rohan Mehta
01f5e86ea5
Convert MCP schemas to strict where possible (#414)
## Summary:
Towards #404. I made this configurable because it's not clear this is
always a good thing to do. I also made it default to False because I'm
not sure if this could cause errors.

If it works out well, we can switch the default in the future as a small
breaking changes

## Test Plan:
Unit tests
2025-04-01 16:50:13 -04:00
Rohan Mehta
010022777b [5/n] MCP tracing
## Summary:

Adds tracing and tests for tracing.
- Tools are added to the agents
- Theres a span for the mcp tools lookup
- Functions have MCP data

## Test Plan:

Unit tests
.
2025-03-25 19:28:48 -04:00
Rohan Mehta
b98a6bd4ac [4/n] Add docs for MCP
Just adding docs.
-
2025-03-25 13:25:50 -04:00
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