anthropics / anthropics/claude-cookbooks
Recipe proposal: Discovering APIs at runtime with MCP
- Vorherrschende Sprache
- Jupyter Notebook
- Sterne
- 52.7k
- Forks
- 6.3k
- Ø Merge
- 25 Min.
- Gemergte PRs (30 T.)
- 6
Beschreibung
## Recipe idea
A notebook showing **how Claude can pick the right external API for a task at runtime**, instead of hard-coding the choice or relying on training-data defaults.
This would slot naturally into `tool_use/` next to the existing `tool_search_with_embeddings.ipynb` and `tool_search_alternate_approaches.ipynb` recipes - they cover finding the right *internal* tool; this would cover finding the right *external* API.
## Why it matters
A common pattern: agents need to send email / store vectors / accept payments. Claude often defaults to whatever was most popular at training time (Mailgun, Pinecone, Stripe). Often the better choice for an agent is something newer with cleaner SDKs and env-var auth (Resend, Qdrant, etc.).
The recipe would demonstrate using an MCP server to query a live, scored directory of APIs and let Claude reason over the data before picking.
## Proposed structure
```
tool_use/discovering_apis_with_mcp.ipynb
```
1. **Setup** - install an example MCP server that exposes API metadata (CLIRank: \`npx clirank-mcp-server\`, free, no auth, 416+ APIs scored)
2. **Demo 1** - agent asks for transactional email APIs, gets ranked results with capability diffs, picks one
3. **Demo 2** - agent does a head-to-head comparison before committing to an integration
4. **Demo 3** - agent submits a missing API to the directory mid-session (closes the loop)
5. **Discussion** - the general pattern: any directory exposing structured data via MCP can be queried this way
## Source for the demo
CLIRank ([clirank.dev](https://clirank.dev), [github.com/alexanderclapp/clirank-mcp-server](https://github.com/alexanderclapp/clirank-mcp-server)) - independent, MIT-licensed, public REST API + MCP server. Happy to use a different example if you'd prefer something more vendor-neutral.
## Author
I built CLIRank, so flagging the conflict of interest. Happy to write the notebook either way and let you decide whether the example fits. The pattern (querying a structured directory via MCP for runtime tool selection) is the part that generalises - the specific server is interchangeable.
Pre-flight check before writing: does this fit, and if so, are there any framing constraints you'd want me to follow?
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.