MCP Doctor

MCP Doctor

A diagnostic tool that evaluates the contract quality of MCP servers across dimensions like safety, efficiency, and documentation to provide actionable improvements. It helps developers ensure their servers are optimized for human users, distribution platforms, and AI agents.

Category
访问服务器

README

<!-- mcp-name: io.github.Jiansen/mcp-doctor -->

<p align="center"> <img src="assets/avatar-512.png" width="120" alt="mcp-doctor logo"> </p>

<h1 align="center">MCP Doctor</h1>

<p align="center"> <a href="https://pypi.org/project/mcp-doctor/"><img src="https://img.shields.io/pypi/v/mcp-doctor" alt="PyPI"></a> <a href="https://github.com/Jiansen/mcp-doctor/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue" alt="License"></a> <a href="https://pypi.org/project/mcp-doctor/"><img src="https://img.shields.io/pypi/pyversions/mcp-doctor" alt="Python"></a> <a href="https://github.com/Jiansen/mcp-doctor/stargazers"><img src="https://img.shields.io/github/stars/Jiansen/mcp-doctor?style=social" alt="GitHub Stars"></a> </p>

<p align="center">Check and improve the contract quality of any MCP server — for humans, agents, and platforms.</p>

Problem

Most MCP servers are built with only one audience in mind (usually human developers reading a README). But a successful MCP server needs to satisfy three audiences simultaneously:

  • Distribution platforms (Registry, Smithery, PulseMCP, Glama) need structured metadata
  • Human users need clear purpose, trust signals, and low install friction
  • AI agents need unambiguous tool descriptions, declared side effects, and token-efficient responses

MCP Doctor checks all six dimensions of "contract quality" and gives you actionable recommendations.

Quick Start

pip install mcp-doctor
mcp-doctor check /path/to/your-mcp-server

What It Checks

Dimension Question
Task Clarity Is the server's purpose immediately clear?
Trust & Safety Are side effects, permissions, and safety boundaries declared?
Interface Quality Are tools well-named, well-described, and well-typed?
Token Efficiency Will tool responses fit an agent's context budget?
Install Friction How fast can someone go from discovery to first use?
Cross-platform Readiness Is metadata complete for Registry, Smithery, PulseMCP, Glama?

Usage

CLI

# Terminal output (default, rule-based)
mcp-doctor check /path/to/server

# JSON output (for CI/CD)
mcp-doctor check /path/to/server --format json

# Markdown output (for README badges or reports)
mcp-doctor check /path/to/server --format markdown

# AI-enhanced evaluation (requires OPENAI_API_KEY)
mcp-doctor check /path/to/server --mode ai

# AI mode with a specific model
mcp-doctor check /path/to/server --mode ai --model gpt-4o

As an MCP Server

MCP Doctor is also an MCP server, so AI agents can use it to check other servers:

{
  "mcpServers": {
    "mcp-doctor": {
      "command": "python",
      "args": ["-m", "mcp_doctor.mcp_server"]
    }
  }
}

Tools:

  • check_server(path, format, mode, model) — Run all 6 checks. Use mode="ai" for LLM-enhanced review.
  • list_dimensions() — List what MCP Doctor evaluates

For AI Agents: Quick Install

One-liner (paste this to your AI agent):

Install mcp-doctor (pip install mcp-doctor) and add it to your MCP config with command python -m mcp_doctor.mcp_server. Then use the check_server tool to check any MCP server's quality.

Step by step:

  1. Install: pip install mcp-doctor
  2. Add to your MCP configuration:
    {
      "mcpServers": {
        "mcp-doctor": {
          "command": "python",
          "args": ["-m", "mcp_doctor.mcp_server"]
        }
      }
    }
    
  3. Use the check_server tool with a path to any MCP server repo
  4. If MCP is not available, fall back to CLI: mcp-doctor check /path/to/server --format json

Agent workflow: check server -> review scores -> identify lowest dimensions -> follow recommendations

Scoring

Each dimension is scored 0-100 and graded A/B/C/D:

  • A (90+): Exemplary
  • B (75-89): Good, minor gaps
  • C (55-74): Adequate, notable gaps
  • D (<55): Needs significant improvement

Theoretical Foundation

MCP Doctor is based on the Contract Quality Framework — the principle that a successful MCP product's promises (what it does, what it costs, what risks it carries) should be equally parseable by platforms, humans, and agents.

The framework draws from:

  • Anthropic's "Writing effective tools for agents" (tool description engineering, namespacing, token efficiency)
  • Official MCP Registry requirements (server.json schema, namespace verification)
  • Cross-platform analysis of Smithery, PulseMCP, Glama ranking signals

Evaluation Modes

Mode Flag Deterministic Network API Key
Rule-based (default) --mode rule Yes No No
AI-enhanced --mode ai No Yes (LLM API) OPENAI_API_KEY

Rule-based mode is fully offline and deterministic. No network calls, no LLM, no API keys needed.

AI mode sends a metadata summary (server name, tool definitions, README preview, rule-based scores) to an OpenAI-compatible API for qualitative review. No source code is sent. Reports include model name and version for reproducibility.

AI mode supports any OpenAI-compatible provider:

  • OPENAI_API_KEY — API key (required for AI mode)
  • OPENAI_BASE_URL — Custom endpoint (for Ollama, vLLM, LM Studio, Azure, etc.)
  • MCP_DOCTOR_MODEL — Model name (default: gpt-4o-mini)

Install AI support: pip install mcp-doctor[ai]

Trust & Permissions

MCP Doctor is read-only. It never modifies, deletes, or creates files.

What it accesses Why
server.json Parse MCP metadata
README.md Check documentation quality
LICENSE Verify license presence
*.py, *.json in src/ Detect tool definitions

All MCP tools have readOnlyHint: true and destructiveHint: false annotations.

Feedback

Found a bug? Have a suggestion? We'd love to hear from you:

  • GitHub Issues: https://github.com/Jiansen/mcp-doctor/issues
  • Quick report (if you have gh CLI):
    gh issue create --repo Jiansen/mcp-doctor --title "Bug: ..." --body "..."
    

If you're an agent, include the JSON output of check_server in your report for context.

Contributing

git clone https://github.com/Jiansen/mcp-doctor.git
cd mcp-doctor
pip install -e ".[dev,ai]"
ruff check src/ tests/
pytest tests/ -v

If MCP Doctor helped you improve your server, consider giving it a star on GitHub — it helps others discover the tool.

Star on GitHub

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选