MCP connector: targeted version and verified APIs¶
Package: mcp (the official MCP Python SDK, published by Model Context Protocol, a
Series of LF Projects, LLC). Targeted: 2.3.0 (extra credencestack[mcp], pinned
>=2.3,<3). Checked against the installed source on 2026-11-22.
APIs used, as found in 2.3.0¶
| Need | API in 2.3.0 | Where |
|---|---|---|
| Server with explicit JSON Schemas | mcp.server.Server(name, on_list_tools=..., on_call_tool=...): handlers registered in the constructor, (ctx, params) signature |
mcp/server/lowlevel/server.py |
| Tool definitions | mcp_types.Tool(name, description, input_schema, annotations=ToolAnnotations(read_only_hint, destructive_hint)) |
mcp_types |
| Results | mcp_types.CallToolResult(content=[TextContent], structured_content, is_error) |
mcp_types |
| Streamable HTTP | Server.streamable_http_app(host=...) (Starlette), served with uvicorn; path /mcp |
server.py |
| stdio | mcp.server.stdio.stdio_server() and Server.run(read, write, create_initialization_options()) |
mcp/server/stdio.py |
| Client (examples, bridge, tests) | mcp.Client(url \| StdioServerParameters \| Server), list_tools(), call_tool(name, args) |
mcp/client/client.py |
Differences from the plan's hints¶
FastMCPis gone in 2.x (mcp.server.fastmcpraises with a migration message); its successor ismcp.server.mcpserver.MCPServer. The connector uses the low-levelServerinstead, because tool schemas come from CredenceStack's own tool definitions rather than Python signatures.- The transport names are stdio and Streamable HTTP, as the plan said.
- Sessions: in the protocol's newer per-request era (2026-07-28), which the SDK's
client uses by default,
ctx.sessionis a new object on every request. Per-session state cannot be keyed on it. Isolation is therefore by construction: themcpconnector starts a separate server, environment and port for every episode, andcredencestack env serveserves one environment per process. - stdio: an agent that launches its MCP server as a subprocess gets
{mcp_stdio}, a command runningcredencestack.connectors.mcp_bridge, a stdio server that relays to the episode's HTTP server, so the environment stays in the CredenceStack process. - Tools: the plan listed nine tools; the server exposes all eleven environment tools
(adding
list_inbound_requestsandverify_credential), so thethirdpartypack works over MCP. - Kill switch: the server never blocks calls. The kill switch records consequential
calls after the signal, which the scorer reports as
ignored_suspension. With no--agent-control-url,suspend()returns False and the episode reportssuspension_unsupported. - Approvals: the contract is the
request_approvaltool. MCP elicitation (a server asking the client's user for input) is not used: it reaches the agent's user, not CredenceStack's scripted reviewer.
Extension¶
{control_port} in --agent-cmd and --agent-control-url is replaced by a free local
port, so concurrent episodes do not collide. It is an addition to the plan's placeholder
list.