python-mcp-server-quality

A set of development rules for building and reviewing Python MCP servers. It covers tools, data resources, prompts, local and web connections, validation, testing, packaging, and safe error handling.

In plain words
What is it for?
Creating, auditing, or improving Python MCP servers, including FastMCP tools, resource and prompt design, stdio or HTTP transport, MCP Inspector checks, and uv packaging.
Why use it?
It gives developers a checklist for making agent-facing servers predictable, secure, testable, and safe to run. MCP is a standard that connects agents to tools and data.

Skill for Claude CodeCodex

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 skills/priyanshuchawda/codeaudit/python-mcp-server-quality
Any agent
npx skills add priyanshuchawda/codeaudit --skill python-mcp-server-quality
Clone the repo
git clone --depth 1 https://github.com/priyanshuchawda/codeaudit

Made for: Claude Code, Codex.

Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 439 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.00045 $0.00439
Opus 5 $0.00023 $0.00219
Sonnet 5 $0.00009 $0.00088
Haiku 4.5 $0.00005 $0.00044

Measured yesterday against content hash f35b627589bb, 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-server-quality 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.

skills/python-mcp-server-quality/SKILL.md · 36 lines

What it actually says

Python MCP Server Quality

Core Standard

Python MCP servers should be small, typed, read/write behavior should be explicit, and stdio output must remain protocol-safe.

Required Checks

  • Server shape: use FastMCP from the official Python MCP SDK unless the project has a clear reason not to.
  • Tools: one tool equals one capability; every tool has type hints, docstring, validation, bounded filesystem/network behavior, and structured return data.
  • Resources: expose read-only docs, config, indexes, or templates as resources instead of action tools.
  • Prompts: keep reusable instructions parameterized and do not embed secrets or hidden authority.
  • Transport: use stdio for local clients and streamable HTTP behind HTTPS/auth for remote clients.
  • Stdio safety: never print logs to stdout; use stderr or MCP context logging.
  • Errors: return useful, redacted errors; do not leak stack traces, tokens, env values, paths outside the selected project, or provider internals.
  • Testing: cover tool functions directly, then verify with MCP Inspector or an in-memory/client smoke test.
  • Packaging: prefer uv, pyproject.toml, pinned Python version, and documented uv run commands.

Generation Workflow

For new Python MCP servers, combine this skill with python-mcp-server-generator and mcp-builder. Start with a minimal working server, add tests before expanding tools, then document client setup for Codex, Claude Code, Cursor, VS Code, and MCP Inspector.

Common Mistakes

  • Returning broad dictionaries without stable keys or documented schema.
  • Using one generic run_command or manage_project tool instead of focused tools.
  • Letting tools read arbitrary paths without resolving them under an allowed project root.
  • Adding write, delete, push, deploy, or merge operations before an explicit approval model exists.
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 · 36 lines · 45 tokens per session scan A f35b627589bb

Subscribe to this mod's changes

python-mcp-server-quality is a skill published in the GitHub repository priyanshuchawda/codeaudit (1 stars, last pushed 4mo ago), licensed MIT. It adds 45 tokens to every session and 439 once invoked, about $0.0002 per session on Opus 5. 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.

Related

Other skills, from other repositories

auth-web-cloudbase

CloudBase Web Authentication Quick Guide for frontend integration after auth-tool has already been checked. Provides concise and practical Web authentication solutions with multiple login methods and complete user management.

TencentCloudBase/CloudBase-AI-Toolkit · 38 tokens

browse-and-evaluate

Use when exploring the ai-agent-skills catalog to find, compare, and evaluate skills before installing. Always use --fields to limit output size and --dry-run before committing to an install.

MoizIbnYousaf/Ai-Agent-Skills · 43 tokens

specflow-use

To connect Rosetta with Grid Dynamics SpecFlow MCP; only when SpecFlow is mentioned and the MCP is installed.

griddynamics/rosetta · 27 tokens

loop-engineering

Shared loop-engineering reference for COG skills - the agent loop, deterministic verifiers, termination conditions, in-loop context management, and named patterns. Invoke when designing or debugging a skill that iterates (search-verify-retry, scan-until-dry, fetch-retry-gate).

huytieu/COG-second-brain · 63 tokens

telnyx-messaging-hosted-curl

Set up hosted SMS numbers, toll-free verification, and RCS messaging. Use when migrating numbers or enabling rich messaging features. This skill provides REST API (curl) examples.

team-telnyx/ai · 45 tokens

render-airdrop-carousel

Assemble a viral iOS "AirDrop" notification-carousel video ad (≈6–8s, 9:16) from a brand line plus 6–16 real product photos — a native AirDrop share-sheet card ("Brand would like to share a · Decline / Accept") springs up and its preview window CYCLES through the products, landing on a range/lineup payoff with an…

gooseworks-ai/goose-skills · 207 tokens