Agent Wealth HubFree public resources
中文 EN العربية

Back to catalog / MCP testing

Test MCP server discovery and tool calls locally

Connect an SDK test client to a local server and verify protocol discovery, input validation, and tool results.

Goal

Verify the MCP interface in isolation without depending on production services or accounts.

Steps

  1. Create a local test-server configuration that uses no real account or production data. [mcp-test] [mcp-tools]
  2. Create an in-memory session with async with Client(mcp, raise_exceptions=True) as client:; no subprocess or port is needed. [mcp-test] [mcp-tools]
  3. Inspect input_schema from client.list_tools(), then invoke a read-only test tool with await client.call_tool(name, args). [mcp-test] [mcp-tools]
  4. Submit missing-field, wrong-type, and unknown-tool requests and verify controlled protocol errors. [mcp-test] [mcp-tools]
  5. Close the session and confirm child processes and temporary resources are released. [mcp-test] [mcp-tools]

How to verify

Local tests cover initialization, capability discovery, valid and invalid calls, and shutdown without contacting production.

Troubleshooting

If initialization fails, compare client/server protocol versions and inspect the controlled error without enabling production access.

Permissions

Prerequisites

Permissions

Limitations

SDK behavior varies by version. Check the pinned revision against your agent or client, then review data retention, authorization, and side effects before production use.

Pinned upstream source

https://github.com/modelcontextprotocol/python-sdk/blob/754254c08fe1c3eda18b69da3d336106fe8d72d6/docs/get-started/testing.md

Repository
modelcontextprotocol/python-sdk
File path
docs/get-started/testing.md
Pinned commit
754254c08fe1c3eda18b69da3d336106fe8d72d6
Source checked
2026-10-14 · Reviewed against the pinned upstream source

Repository metrics

These values describe the upstream repository, not popularity or likes for an individual skill or playbook.

Stars
Not collected
Forks
Not collected
Observed at
Not collected

No metrics snapshot is available yet.

License: MIT

Main topic

When to use a Skill or MCP

Related resources