AI工具开发框架

一个用于学习和测试AI代理工具创建的Python MCP服务器框架,包含基础计算工具示例

  • by munnakona
  • Python
  • 本地部署
  • 更新于
在 GitHub 查看 munnakona/QT-GentAI-MCP

使用说明

QT GenAI MCP工具库

此存储库包含 两个实验性MCP(模型上下文协议)服务器 内置Python,可与Claude Desktop或任何MCP兼容环境一起使用。
它被设计为AI代理工具创建的学习和测试平台。


📁 存储库结构

QT GenAI/ ├── hello_mcp/#第一个演示简单添加工具的mcp服务器 │ ├── 你好.py │ └── README.md ├── calc_mcp/#具有多种算术运算的计算器mcp服务器 │ ├── calc_server.py │ ├── 操作.py │ └── README.md Mabalin遇到了i-print学生。 └── README.md#这个顶级README


🔹 hello_cp

目的: 一个演示在Python中创建单个可调用工具的最小MCP工具。

特征:

  • add(a, b) --将两个数字相加并返回结果。
  • 用途 FastMCPServer 用于MCP集成。
  • 与Claude Desktop或任何使用JSON-RPC的MCP客户端兼容 stdio.

运行服务器:

cd hello_mcp
uv run hello.py


Test with MCP Inspector:

mcp dev hello.py

🔹 calc_mcp

Purpose: A simple calculator MCP server providing multiple arithmetic operations.

Features:

add(a, b) — Adds two numbers.

subtract(a, b) — Subtracts b from a.

multiply(a, b) — Multiplies two numbers.

divide(a, b) — Divides a by b with zero-division handling.

Uses FastMCPServer for MCP integration.

Run the Server:

cd calc_mcp
uv run calc_server.py


Test with MCP Inspector:

mcp dev calc_server.py

🛠 Requirements

Python 3.10+

mcp-server package

uv for running scripts (optional, recommended)

Claude Desktop (optional, for testing)

Install Dependencies:

uv add mcp-server

🚀 Usage Example

Call the tools using a compatible MCP client or JSON-RPC interface.

hello_mcp Example:

{ "tool": "add", "params": { "a": 2, "b": 3 } }


Returns:

{ "result": 5 }


calc_mcp Example:

{ "tool": "multiply", "params": { "a": 4, "b": 6 } }


Returns:

{ "result": 24 }

📚 Contributing

Feel free to fork this repository and create your own MCP tools.

Add new functions decorated with @mcp.tool() in each server file.

Make pull requests to share improvements.

⚠ Notes

Do not commit .venv/ — add it to .gitignore.

Each MCP server is independent and can be run separately.

Designed primarily for learning and experimentation.


---

If you want, I can also **make this README “GitHub-ready with badges, folder diagrams, and nice formatting”** so it looks very professional on your main repo page.  

Do you want me to do tha