Simple Python MCP

v1.0.0Developer Toolsstable

The Model Context Protocol (MCP) is a standardized way to supply context to large language models (LLMs). Using the MCP Python SDK, you can build servers that expose data (resources), functionality (tools), and interaction templates (prompts) to LLM

simple-mcp-server-with-pythonmcpai-integration
Share:
15
Stars
0
Downloads
0
Weekly
0/5

What is Simple Python MCP?

Simple Python MCP is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) is a standardized way to supply context to large language models (llms). using the mcp python sdk, you can build servers that expose data (resources), functionality (tools...

The Model Context Protocol (MCP) is a standardized way to supply context to large language models (LLMs). Using the MCP Python SDK, you can build servers that expose data (resources), functionality (tools), and interaction templates (prompts) to LLM

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • The Model Context Protocol (MCP) is a standardized way to su

Use Cases

Build MCP servers using the Python SDK with resources and tools.
ruslanmv

Maintainer

LicenseMIT
Languageshell
Versionv1.0.0
UpdatedMar 26, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx simple-mcp-server-with-python

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Simple Python MCP

Simple MCP Server with Python is a hands-on tutorial project that demonstrates how to build a Model Context Protocol server using the official MCP Python SDK. It walks through all three MCP primitives — tools (model-controlled functions), resources (application-controlled data), and prompts (user-controlled templates) — with minimal, understandable code. Developers use this project as a foundation for building their own custom MCP servers in Python, learning the SDK's conventions before adding their own business logic.

Prerequisites

  • Python 3.7 or newer (3.11+ recommended for best compatibility)
  • Node.js 18.x installed (required by the MCP Inspector dev tool)
  • pip or uv package manager
  • An MCP-compatible client such as Claude Desktop for testing the final server
1

Create a project directory and virtual environment

Set up an isolated Python environment for the MCP server project to avoid dependency conflicts.

mkdir my-mcp-server && cd my-mcp-server
python -m venv .venv
source .venv/bin/activate
2

Install the MCP Python SDK

Install the mcp package with its CLI extras. Alternatively, use uv for faster dependency resolution.

pip install "mcp[cli]"
# OR with uv:
uv init mcp-server && cd mcp-server && uv add "mcp[cli]"
3

Create your server file with tools, resources, and prompts

Write a server.py that registers an add tool, a greeting resource, and a code review prompt using the MCP SDK decorators. These three primitives cover the core MCP building blocks.

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("my-server")

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers together"""
    return a + b

@mcp.resource("greeting://{name}")
def greeting(name: str) -> str:
    return f"Hello, {name}!"

@mcp.prompt()
def review_code(code: str) -> str:
    return f"Please review this code:\n\n{code}"

if __name__ == "__main__":
    mcp.run()
4

Test interactively with MCP Inspector

Use the mcp dev command to launch an interactive web UI at http://localhost:6274 where you can call tools, read resources, and test prompts without connecting a full AI client.

mcp dev server.py
5

Configure Claude Desktop to use your server

Add your server to Claude Desktop's configuration file so it can use your tools and resources in conversations.

{
  "mcpServers": {
    "my-python-mcp": {
      "command": "python",
      "args": ["/absolute/path/to/server.py"]
    }
  }
}
6

Run a test client to verify tool calls

Write a simple client.py that connects to your server via stdio and calls the add tool programmatically to confirm everything works end-to-end.

python server.py  # Terminal 1
python client.py  # Terminal 2 (if you write a client)

Simple Python MCP Examples

Client configuration

Configure Claude Desktop to run your custom Python MCP server as a local subprocess.

{
  "mcpServers": {
    "simple-python-mcp": {
      "command": "python",
      "args": ["/path/to/your/server.py"]
    }
  }
}

Prompts to try

Once your server is running and connected, try these prompts in Claude Desktop to exercise each MCP primitive.

- "Add 10 and 15 using the add tool."
- "Fetch the greeting resource for the name Alice."
- "Use the review_code prompt to review this Python snippet: print(1+1)"
- "List all available tools on the connected MCP server."

Troubleshooting Simple Python MCP

mcp command not found after installation

Ensure your virtual environment is activated (source .venv/bin/activate) and that you installed the CLI extras: pip install "mcp[cli]". The mcp binary is placed in .venv/bin/.

MCP Inspector fails to start or cannot reach localhost:6274

MCP Inspector requires Node.js 18.x. Run node --version to confirm. If Node is missing or outdated, install it from nodejs.org before running mcp dev server.py.

Claude Desktop does not list any tools from the server

Use an absolute path to server.py in the configuration, not a relative path. Restart Claude Desktop after editing the config. Check the Claude Desktop logs for Python errors that indicate the server failed to start.

Frequently Asked Questions about Simple Python MCP

What is Simple Python MCP?

Simple Python MCP is a Model Context Protocol (MCP) server that model context protocol (mcp) is a standardized way to supply context to large language models (llms). using the mcp python sdk, you can build servers that expose data (resources), functionality (tools), and interaction templates (prompts) to llm It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Simple Python MCP?

Follow the installation instructions on the Simple Python MCP GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with Simple Python MCP?

Simple Python MCP works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Simple Python MCP free to use?

Yes, Simple Python MCP is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "simple-mcp-server-with-python": { "command": "npx", "args": ["-y", "simple-mcp-server-with-python"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Simple Python MCP?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides