Skip to main content

nop-mcp

一个空操作的 MCP (Model Context Protocol) 服务器,专门设计为不实现任何工具的占位符服务器。

功能

  • 实现完整的 MCP 服务器协议
  • list_tools 接口返回空工具列表
  • 专用于占位、测试或需要无功能MCP服务器的特殊场景

使用场景

  • 占位符:在系统配置中需要MCP服务器但不需要实际功能时
  • 测试环境:测试MCP客户端连接和基础协议功能
  • 开发调试:验证MCP协议实现而不受具体工具干扰
  • 兼容性测试:确保MCP客户端能正确处理无工具的服务器

安装

从 PyPI 安装(推荐)

pip install nop-mcp

本地开发安装

# 激活虚拟环境
source .venv/bin/activate

# 依赖已预装,直接使用即可

使用方法

直接运行

# 从PyPI安装后
nop-mcp

# 或使用模块方式
python -m nop_mcp.server

# 本地开发时使用便捷脚本
python run_server.py

在 Claude Desktop 中配置

在 ~/Library/Application Support/Claude/claude_desktop_config.json 中添加:

{
    "mcpServers": {
        "nop-mcp": {
            "command": "nop-mcp"
        }
    }
}

或者如果是本地开发版本:

{
    "mcpServers": {
        "nop-mcp": {
            "command": "python",
            "args": [
                "-m", 
                "nop_mcp.server"
            ],
            "cwd": "/path/to/your/nop-mcp"
        }
    }
}

开发

# 激活环境
source .venv/bin/activate

# 运行测试
python -m pytest tests/ -v

# 代码格式化
python -m black .

# 代码检查
python -m flake8 nop_mcp tests run_server.py --max-line-length=88

发布到 PyPI

项目包含完整的 PyPI 发布脚本:

# 快速发布到测试PyPI(推荐首次使用)
./scripts/quick-start.sh

# 或分步操作:
# 1. 构建包
./scripts/build.sh

# 2. 上传到测试PyPI
./scripts/upload-test.sh

# 3. 上传到正式PyPI
./scripts/upload.sh

# 清理构建文件
./scripts/clean.sh

详细发布指南请参阅 PUBLISH.md。

项目结构

nop-mcp/
├── nop_mcp/              # 主包
│   ├── __init__.py       # 包初始化
│   └── server.py         # 空操作MCP服务器实现
├── tests/                # 测试代码
│   ├── __init__.py
│   └── test_server.py    # 服务器测试
├── scripts/              # 发布脚本
│   ├── build.sh          # 构建脚本
│   ├── upload.sh         # 上传到PyPI
│   ├── upload-test.sh    # 上传到测试PyPI
│   ├── clean.sh          # 清理脚本
│   └── quick-start.sh    # 快速开始脚本
├── .venv/                # 虚拟环境(Python 3.13)
├── .gitignore            # Git忽略文件
├── LICENSE               # MIT许可证
├── PUBLISH.md            # 发布指南
├── pyproject.toml        # 项目配置
├── README.md             # 项目说明
├── run_server.py         # 便捷启动脚本
└── USAGE.md              # 详细使用说明

验证

项目已完全配置并验证:

  • ✅ 实现完整的MCP协议
  • ✅ 返回空工具列表
  • ✅ 支持标准stdio传输
  • ✅ 所有测试通过
  • ✅ 代码质量检查通过
  • ✅ PyPI发布就绪

Metadata

Release files for nop-mcp 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for nop-mcp 0.1.1
File Size Uploaded Provenance
nop_mcp-0.1.1.tar.gz 4.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for nop-mcp 0.1.1
File Interpreter ABI Platform
nop_mcp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / nop_mcp-0.1.1.tar.gz

Download URL nop_mcp-0.1.1.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5cae3551396e7dff6955257393f10ab52edede025b7085e6458ced2f247dd743
BLAKE2b-256 checksum
How to use checksums
3f38252a46c5c93b7e6e4f26b578b4b18b99cea1a417fd3ec874e94a18697b8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / nop_mcp-0.1.1-py3-none-any.whl

Download URL nop_mcp-0.1.1-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
094bc62dc18a08fc02304ae195f8d607c79e6a222f223a0ea2d03655e8901243
BLAKE2b-256 checksum
How to use checksums
179456cc448260a1651ca4717f8fbdae0f561ef7cd285809566bbbef4e32ce6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for nop-mcp 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page