Metadata-Version: 2.4
Name: mcp-utility-server
Version: 1.0.0
Summary: A feature-rich MCP (Model Context Protocol) Server with 16 utility tools
Author-email: CyGuo <gg1413491348@126.com>
License: MIT
Project-URL: Homepage, https://github.com/UnbornPerson/mcp-utility-server
Project-URL: Documentation, https://github.com/UnbornPerson/mcp-utility-server#readme
Project-URL: Repository, https://github.com/UnbornPerson/mcp-utility-server
Project-URL: Issues, https://github.com/UnbornPerson/mcp-utility-server/issues
Keywords: mcp,model-context-protocol,ai,tools,utilities,claude,cursor
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: fastapi>=0.100.0
Requires-Dist: uvicorn>=0.23.0
Provides-Extra: all
Requires-Dist: fastapi>=0.100.0; extra == "all"
Requires-Dist: uvicorn>=0.23.0; extra == "all"

# MCP Utility Server

[![PyPI](https://img.shields.io/pypi/v/mcp-utility-server)](https://pypi.org/project/mcp-utility-server/)
[![Python](https://img.shields.io/pypi/pyversions/mcp-utility-server)](https://pypi.org/project/mcp-utility-server/)
[![License](https://img.shields.io/pypi/l/mcp-utility-server)](https://github.com/UnbornPerson/mcp-utility-server)

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

## ✨ 特性

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

## 🛠️ 安装

```bash
pip install mcp-utility-server
```

## 🚀 快速开始

### 命令行启动

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

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

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

### Python代码启动

```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 使用

### 健康检查

```bash
curl http://localhost:8003/
```

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

### 列出所有工具

```bash
curl http://localhost:8003/tools
```

### 调用工具

```bash
# 天气查询
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`:

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

### Cursor

在设置中添加 MCP Server:

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

## 📦 版本

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

## 🧩 扩展开发

添加新工具非常简单:

```python
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

## 🙏 感谢

- [FastAPI](https://fastapi.tiangolo.com/) - Web 框架
- [MCP](https://modelcontextprotocol.io/) - 协议设计

## ⭐ Star

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

---

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