Skip to content

Conversation

rm-openai
Copy link
Collaborator

@rm-openai rm-openai commented Mar 25, 2025

Summary:

This enables users to use MCP inside the SDK.

  1. You add a list of MCP servers to Agent, via mcp_server=[...]
  2. When an agent runs, we look up its MCP tools and add them to the list of tools.
  3. When a tool call occurs, we call the relevant MCP server.

Notes:

  1. There's some refactoring to make sure we send the full list of tools to the Runner/Model etc.
  2. Right now, you could have a locally defined tool that conflicts with an MCP defined tool. I didn't add errors for that, will do in a followup.

Test Plan:

See unit tests. Also has an end to end example next PR.

### Summary:
This enables users to **use** MCP inside the SDK.
1. You add a list of MCP servers to `Agent`, via `mcp_server=[...]`
2. When an agent runs, we look up its MCP tools and add them to the list of tools.
3. When a tool call occurs, we call the relevant MCP server.

Notes:
1. There's some refactoring to make sure we send the full list of tools to the Runner/Model etc.
2. Right now, you could have a locally defined tool that conflicts with an MCP defined tool. I didn't add errors for that, will do in a followup.

### Test Plan:
See unit tests. Also has an end to end example next PR.
### Summary:
Spins up a stdio server with some local files, then asks the model questions.

### Test Plan:
Run the example, see it work.
Just adding docs.
-
@rm-openai rm-openai mentioned this pull request Mar 25, 2025
Just adding docs.
-
---
[//]: # (BEGIN SAPLING FOOTER)
* __->__ #324
* #322
* #321
* #320
### Summary:
Spins up a stdio server with some local files, then asks the model
questions.

### Test Plan:
Run the example, see it work.


---
[//]: # (BEGIN SAPLING FOOTER)
* #324
* __->__ #322
* #336
@rm-openai
Copy link
Collaborator Author

dupe of #321

@rm-openai rm-openai closed this Mar 25, 2025
@seratch seratch deleted the rm/pr336 branch September 9, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant