Skip to main content

MCP Utility Server

PyPI Python License

一个功能丰富、易于扩展的 MCP (Model Context Protocol) 服务器实现,提供16个实用工具。

✨ 特性

  • 🌤️ 天气查询 - 支持多城市天气查询
  • 🔍 网页搜索 - 模拟搜索引擎
  • 🧮 数学计算 - 安全表达式计算
  • 🔄 单位转换 - 长度/重量/温度/字节等
  • ⏰ 时间获取 - 多时区支持
  • 💬 每日名言 - 励志语录
  • 📝 笔记系统 - 创建和管理笔记
  • ⏰ 提醒系统 - 设置提醒
  • 🔗 URL处理 - 短链接生成/展开
  • 🔐 密码生成 - 安全随机密码
  • 🎲 随机选择 - 选项随机抽取
  • 📅 倒计时 - 目标日期倒计时

🛠️ 安装

pip install mcp-utility-server

🚀 快速开始

命令行启动

# 标准版 (6个工具)
mcp-server

# Pro版 (11个工具)
mcp-server-pro

# 企业版 (16个工具)
mcp-server-enterprise

Python代码启动

# 标准版
from mcp_utility_server import main
main()

# Pro版
from mcp_utility_server.main_pro import main
main()

# 企业版
from mcp_utility_server.main_enterprise import main
main()

服务默认运行在:

  • 标准版: http://localhost:8000
  • Pro版: http://localhost:8002
  • 企业版: http://localhost:8003

📖 API 使用

健康检查

curl http://localhost:8003/

响应:

{"status": "ok", "service": "MCP Utility Server Enterprise", "version": "3.0.0", "tools": 16}

列出所有工具

curl http://localhost:8003/tools

调用工具

# 天气查询
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"get_weather","arguments":{"city":"北京"}}'

# 数学计算
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"calculate","arguments":{"expr":"100*9.8"}}'

# 单位转换
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"convert_unit","arguments":{"value":1,"from":"kg","to":"lb"}}'

# 创建笔记
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"create_note","arguments":{"title":"My Note","content":"Hello World"}}'

# 添加提醒
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"add_reminder","arguments":{"message":"Meeting at 3pm","time":"15:00"}}'

# 生成密码
curl -X POST http://localhost:8003/tools/call \
  -H 'Content-Type: application/json' \
  -d '{"name":"generate_password","arguments":{"length":16}}'

🔧 在 AI 助手中使用

Claude Desktop

创建 ~/.claude/desktop.json:

{
  "mcpServers": {
    "mcp-utility": {
      "command": "python",
      "args": ["-m", "mcp_utility_server.main_enterprise"]
    }
  }
}

Cursor

在设置中添加 MCP Server:

{
  "mcpServers": {
    "mcp-utility": {
      "url": "http://localhost:8003"
    }
  }
}

📦 版本

版本 工具数 端口 命令
v1 6 8000 mcp-server
Pro 11 8002 mcp-server-pro
Enterprise 16 8003 mcp-server-enterprise

🧩 扩展开发

添加新工具非常简单:

def my_new_tool(param: str) -> str:
    """新工具描述"""
    return f"Result: {param}"

# 注册工具
TOOLS["my_new_tool"] = {
    "description": "我的新工具",
    "params": {"param": "参数描述"}
}

# 添加处理逻辑
elif tool_name == "my_new_tool":
    return {"result": [{"type": "text", "text": my_new_tool(args.get("param", ""))}]}

📄 许可证

MIT License

🙏 感谢

⭐ Star

如果对你有帮助,欢迎 star!


GitHub: https://github.com/UnbornPerson/mcp-utility-server

Metadata

Release files for mcp-utility-server 1.0.0

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

Source distribution (sdist)

Source distribution for mcp-utility-server 1.0.0
File Size Uploaded Provenance
mcp_utility_server-1.0.0.tar.gz 10.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for mcp-utility-server 1.0.0
File Interpreter ABI Platform
mcp_utility_server-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.4 kB

Release files / mcp_utility_server-1.0.0.tar.gz

Download URL mcp_utility_server-1.0.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b257fe69c8eab0879d513d71f2e0a90bdce59fcb2df9d713d93031b5fddaeb1c
BLAKE2b-256 checksum
How to use checksums
0bfb7bf1bd5531e9cf2cf9ff713e9c41127bca75f525934df76e228d1d303a31
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Release files / mcp_utility_server-1.0.0-py3-none-any.whl

Download URL mcp_utility_server-1.0.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc5cd6f0996a9f28162b889ce1045e42d188e5e49c39cf63858aa6e2397f1511
BLAKE2b-256 checksum
How to use checksums
2a8888985d67e2da46b39579195f053249c82431443dbce07a5bdae4486d2c8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.2

Security for mcp-utility-server 1.0.0

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

1.0.0 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