Who it is forAn engineer testing an MCP server or building an app that uses tools from other MCP servers.
The problemTalking to MCP servers directly means handling transports, auth and protocol lifecycle yourself.
The outcomeA Python script that connects to any MCP server and calls its tools, with transport negotiation managed for you.
What you need first
- Python and uv (recommended) for installation
- An MCP client to connect your server to, such as an AI assistant or coding agent
- For TypeScript projects: the separate fastmcp-ts package
Steps
- Install with
uv add fastmcp - Read the Clients guide at gofastmcp.com
- Point a FastMCP client at the server URL; transport negotiation, authentication and protocol lifecycle are handled
- List the server's tools and call them from your script or tests
- Use the CLI option from the Clients docs for quick one-off checks
Prompt for your agent
Using PrefectHQ/fastmcp's client, write a Python script that connects to <MCP server URL>, lists its tools, and calls <tool> with <arguments>. Use it as a smoke test I can run in CI.
Caveat. The README describes the client but shows no client code, so use the Clients guide for the exact API.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for PrefectHQ/fastmcp and "Call any MCP server from your own Python code"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer