python_mcp_servers

A set of development rules for building Python MCP servers. It requires work to be planned, implemented one component at a time, tested immediately, verified, and documented.

In plain words
What is it for?
Guiding incremental Python MCP-server development, including project setup, testing, verification, and documentation.
Why use it?
It reduces the risk of creating several untested files or changes that fail together. MCP servers connect AI agents to software tools.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/kenlan2022/mcp_servers_showcase/python_mcp_servers
Clone the repo
git clone --depth 1 https://github.com/Kenlan2022/mcp_servers_showcase

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 2,839 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.02839
Opus 5 $0.00000 $0.01419
Sonnet 5 $0.00000 $0.00568
Haiku 4.5 $0.00000 $0.00284

Measured yesterday against content hash e3b866c19ae4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python_mcp_servers scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/python_mcp_servers.mdc · 491 lines

How it starts

The opening of the file, as written. The whole thing — 491 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python MCP Servers Development Rules

🚨 CRITICAL: Incremental Development Only

NEVER create multiple untested files in one go. Follow this strict workflow:

  1. Plan → Update TODO.md with specific tasks
  2. Implement → One component at a time
  3. Test → Write and run tests immediately
  4. Verify → Ensure it works before next step
  5. Document → Update progress and notes

Project Structure

mcp-servers/
├── .cursor/
│   └── rules/          # Cursor rules
├── servers/
│   ├── file-server/    # File operations server
│   └── db-server/      # Database operations server
├── shared/
│   └── common/         # Shared utilities
├── tests/              # Test suites
├── docs/               # Documentation
├── TODO.md             # High-level tasks
├── TASKS.md            # Detailed breakdown
└── pyproject.toml      # UV project config

UV Development Setup

Initial Setup

# Initialize with UV
uv init mcp-servers
cd mcp-servers

# Add core dependencies
uv add mcp fastapi uvicorn pydantic

# Add development dependencies
uv add --dev pytest pytest-asyncio black isort mypy ruff pre-commit

# Install project in development mode
uv pip install -e .

pyproject.toml Template

[project]
name = "mcp-servers"
version = "0.1.0"
description = "Python MCP servers collection"
dependencies = [
    "mcp>=0.1.0",
    "fastapi>=0.104.0",
    "uvicorn>=0.24.0",
    "pydantic>=2.0.0",
    "aiofiles>=23.0.0",
]

[project.optional-dependencies]
dev = [
    "pytest>=7.0.0",
    "pytest-asyncio>=0.21.0",
    "black>=23.0.0",
    "isort>=5.0.0",
    "mypy>=1.0.0",
    "ruff>=0.1.0",
    "pre-commit>=3.0.0",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.black]
line-length = 88
target-version = ['py311']

[tool.isort]
profile = "black"
line_length = 88

[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_configs = true

[tool.ruff]
line-length = 88
target-version = "py311"

Read the full file on GitHub · 491 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 491 lines · 0 tokens per session scan A e3b866c19ae4

Subscribe to this mod's changes

python_mcp_servers is a cursor rule published in the GitHub repository Kenlan2022/mcp_servers_showcase (0 stars, last pushed 1y ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,839 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.