DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to build an MCP server and test it in the Inspector with Python SDK

Write a two-function server with the official SDK and try its tools in the MCP Inspector.

Short answer: Install with uv add "mcp[cli]"; then create server.py with an MCPServer, an add tool and a greeting resource, as in the README; open it in the Inspector with uv run mcp dev server.py. All steps.

Who it is forA developer new to MCP who wants to see a server working before wiring it into an assistant.

The problemIt is hard to know whether a new MCP server works until it is connected to a host.

The outcomeA server.py with a tool and a templated resource, tested interactively in the MCP Inspector.

What you need first

  • Python 3.11 or later
  • uv or pip
  • The cli extra for the mcp command-line tool
  • Optional: the MCP Inspector, which mcp dev opens

Steps

  1. Install with uv add "mcp[cli]"
  2. Create server.py with an MCPServer, an add tool and a greeting resource, as in the README
  3. Open it in the Inspector with uv run mcp dev server.py
  4. Call add with a=1 and b=2 and check you get 3 back
  5. Continue with the Get started guide in the docs

Prompt for your agent

Using modelcontextprotocol/python-sdk, create a server.py that exposes <tools> and a resource for <data>. Open it with `uv run mcp dev server.py` and show me each tool working in the Inspector.

Caveat. The SDK is on v2; code written for v1 needs the migration guide.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for modelcontextprotocol/python-sdk and "Build an MCP server and test it in the Inspector"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer