File size: 1,518 Bytes
a8b4b87 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # LEADER: modelcontextprotocol/python-sdk
**URL:** https://github.com/modelcontextprotocol/python-sdk
**License:** MIT
**License SHA (blob):** `3d48435454b105021b4f777c11b6b07d8d2ffea3`
**HEAD commit (main):** `161834d4aee2633c42d3976c8f8751b6c4d947d5`
**Commit date:** 2026-05-08T16:42:44Z
## Why chosen
| Criterion | python-sdk | gorilla |
|---|---|---|
| License | MIT ✓ | Apache-2.0 ✓ |
| Dispatch primitive | `session.call_tool(name, args)` — 1 RPC call | OpenFunctions requires inference server |
| Kernel extractability | Pure Python, sync-wrappable | Coupled to model weights |
| Mockability | `invoke` callable injection trivial | Requires HTTP stub |
| Dependency footprint | `anyio` + `pydantic` | `torch` / vLLM |
**Decision:** python-sdk wins. Its `ToolManager.call_tool(name, args, context)` pattern reduces to a single dict lookup + async run — extractable to ≤10 sync lines with a mockable callable injected at the boundary. gorilla/OpenFunctions is powerful for LLM-driven selection but mandates a model server, violating the kernel-size constraint.
## Dispatch anatomy (from source)
```
src/mcp/client/session.py → ClientSession.call_tool(name, args)
src/mcp/server/mcpserver/tools/tool_manager.py → ToolManager.call_tool(name, args, ctx)
src/mcp/server/mcpserver/tools/base.py → Tool.run(args, ctx)
```
Core pattern: `tool = registry[name]; result = tool.fn(**args)`. Everything else is schema validation and async transport — stripped in the kernel.
|