Skip to main content

A minimal MCP server demo exposing a hello tool.

Project description

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 中的以下字段:

  • name
  • version
  • description
  • license
  • authors
  • urls

然后执行:

python -m build
python -m twine upload dist/*

如果要先发布到 TestPyPI:

python -m twine upload --repository testpypi dist/*

后续可扩展方向

  • 增加更多 tools
  • 添加 resources / prompts
  • 增加 CI 工作流
  • 添加 lint 和类型检查
  • 接入真实业务逻辑

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vulndify_mcp_server-0.3.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

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

Hashes for vulndify_mcp_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f40eba0b3b99d23344ca136e14012210a4d919101ccee0cd99db07a783969c50
MD5 41c60844bf6452bdff85fabdc64002a0
BLAKE2b-256 28d1d38dad6ea89d5c7cc43d4c6c14598909003f697c3fc28b6c1aae5b3f37c5

See more details on using hashes here.

File details

Details for the file vulndify_mcp_server-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for vulndify_mcp_server-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28a3e941b1ca69b766ba7d3dbff4b8b4e47d81501b0de0ac1b0278c0deff7f8e
MD5 aaef4f99cf73148528316eda8600b945
BLAKE2b-256 047f757cad3ca62bbbedea312be98214e96ddb617acbe44dce7eefcbf20f8628

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page