Skip to content

Add typed MCP tool discovery to the Python SDK - #145

Open
jobsrip wants to merge 1 commit into
prooflinedev:mainfrom
jobsrip:codex/mcp-list-tools
Open

jobsrip wants to merge 1 commit into
prooflinedev:mainfrom
jobsrip:codex/mcp-list-tools

Conversation

@jobsrip

@jobsrip jobsrip commented Dec 1, 2026

Copy link
Copy Markdown

Why

Python integrations can call known Proofline MCP tools, but they need a separate MCP client to discover what the server advertises. This adds typed tool discovery to both SDK clients.

Changes

  • Add client.mcp.list_tools() and await client.mcp.list_tools(). Each call returns one page with typed definitions, preserves server metadata, and exposes nextCursor for the next request.
  • Reuse the stateless MCP handshake. Tool discovery checks the advertised tools capability and never invokes a tool.
  • Tighten shared JSON-RPC validation so response IDs must be integers matching the request and invalid JSON constants are rejected. JSON media types are compared case-insensitively. Valid tools/call results, organization selection, and tool-level isError refusals retain their existing behavior.

Verification

  • python3 scripts/check.py passed on the rebased branch with 280 tests, type and contract checks, and wheel and source-distribution smoke tests.
  • Sync and async coverage uses a local loopback HTTP server for discovery, cursor pagination, preserved metadata, and error handling. The existing organization, knowledge, and fixes tests cover tools/call compatibility.
  • An authenticated request to the hosted Proofline MCP endpoint was not tested.

Implemented and reviewed with Codex under my direction.

AI assistance: implemented and reviewed with Codex under the author’s direction.

This branch has not been deployed

No deployments
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