vulndify-mcp-server
一个最小可运行的 MCP Server 示例项目,基于官方 Python SDK mcp 构建,并暴露一个演示用 tool:
- tool 名称:
hello - 调用结果: 直接返回字符串
hello
这个项目已经包含:
- Python 包结构
- MCP Server 入口
- 可发布到 PyPI 的
pyproject.toml - 基础测试
- 本地开发和打包说明
目录结构
.
├── pyproject.toml
├── README.md
├── LICENSE
├── src
│ └── vulndify_mcp_server
│ ├── __init__.py
│ ├── __main__.py
│ └── server.py
└── tests
└── test_server.py
本地安装
建议先创建虚拟环境,然后安装本项目:
python -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
启动服务
安装后可以直接通过命令行启动:
vulndify-mcp-server
也可以用模块方式启动:
python -m vulndify_mcp_server
服务默认通过 stdio 方式运行,适合被 MCP Client 拉起。
核心代码示例
hello tool 定义在 src/vulndify_mcp_server/server.py 中,调用时直接返回固定字符串:
@mcp.tool(name="hello")
def hello_tool() -> str:
return "hello"
开发测试
运行测试:
pytest
构建发布包:
python -m build
检查发布产物:
twine check dist/*
发布到 PyPI
正式发布前,建议先修改 pyproject.toml 中的以下字段:
nameversiondescriptionlicenseauthorsurls
然后执行:
python -m build
python -m twine upload dist/*
如果要先发布到 TestPyPI:
python -m twine upload --repository testpypi dist/*
后续可扩展方向
- 增加更多 tools
- 添加 resources / prompts
- 增加 CI 工作流
- 添加 lint 和类型检查
- 接入真实业务逻辑
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vulndify_mcp_server-0.3.0.tar.gz
(73.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file vulndify_mcp_server-0.3.0.tar.gz.
File metadata
- Download URL: vulndify_mcp_server-0.3.0.tar.gz
- Upload date:
- Size: 73.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f40eba0b3b99d23344ca136e14012210a4d919101ccee0cd99db07a783969c50
|
|
| MD5 |
41c60844bf6452bdff85fabdc64002a0
|
|
| BLAKE2b-256 |
28d1d38dad6ea89d5c7cc43d4c6c14598909003f697c3fc28b6c1aae5b3f37c5
|
File details
Details for the file vulndify_mcp_server-0.3.0-py3-none-any.whl.
File metadata
- Download URL: vulndify_mcp_server-0.3.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28a3e941b1ca69b766ba7d3dbff4b8b4e47d81501b0de0ac1b0278c0deff7f8e
|
|
| MD5 |
aaef4f99cf73148528316eda8600b945
|
|
| BLAKE2b-256 |
047f757cad3ca62bbbedea312be98214e96ddb617acbe44dce7eefcbf20f8628
|