Skip to main content

Add your description here

Project description

Add Two Numbers MCP Server

一个简单而实用的 MCP 服务,提供数字相加计算和个性化问候功能。

功能特性

  • 数字相加工具: 提供两个整数相加的计算功能
  • 个性化问候资源: 根据提供的姓名生成个性化问候语
  • 轻量级设计: 基于 FastMCP 框架,简单易用
  • 标准 MCP 协议: 完全兼容 Model Context Protocol 标准

安装方式

通过 pip 安装

pip install add-two-num

从源码安装

git clone <your-repo-url>
cd add-two-num
pip install -e .

服务配置

基本配置

{
  "mcpServers": {
    "add-two-num": {
      "command": "uvx",
      "args": ["add-two-num@latest"],
      "env": {}
    }
  }
}

本地开发配置

{
  "mcpServers": {
    "add-two-num": {
      "command": "python",
      "args": ["-m", "add_two_num"],
      "cwd": "/path/to/add-two-num",
      "env": {}
    }
  }
}

可用工具

sum

计算两个整数的和。

参数:

  • a (int): 第一个整数
  • b (int): 第二个整数

返回值:

  • int: 两个数的和

示例:

# 调用示例
result = sum(5, 3)  # 返回 8

可用资源

greeting://{name}

生成个性化问候语。

参数:

  • name (str): 要问候的姓名

返回值:

  • str: 个性化问候语

示例:

greeting://Alice  # 返回 "Hello, Alice!"

使用指南

  1. 配置 MCP 客户端: 将上述服务配置添加到你的 MCP 客户端配置文件中
  2. 启动服务: MCP 客户端会自动启动 add-two-num 服务
  3. 使用工具: 通过 MCP 客户端调用 sum 工具进行数字计算
  4. 访问资源: 通过 greeting:// URI 获取个性化问候语

技术规格

  • Python 版本: >= 3.13
  • 依赖框架: FastMCP, MCP CLI
  • 通信协议: stdio
  • 协议版本: MCP 1.11.0+

开发说明

本地开发

# 克隆仓库
git clone <your-repo-url>
cd add-two-num

# 安装依赖
pip install -e .

# 运行服务
python -m add_two_num

测试

# 测试工具调用
echo '{"jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": {"name": "sum", "arguments": {"a": 5, "b": 3}}}' | python -m add_two_num

许可证

本项目采用 MIT 许可证。

贡献

欢迎提交 Issue 和 Pull Request 来改进这个项目!

作者

更新日志

v0.1.0

  • 初始版本发布
  • 实现基本的数字相加功能
  • 添加个性化问候资源

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

abin_add_two_num-0.1.2.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

abin_add_two_num-0.1.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file abin_add_two_num-0.1.2.tar.gz.

File metadata

  • Download URL: abin_add_two_num-0.1.2.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.20

File hashes

Hashes for abin_add_two_num-0.1.2.tar.gz
Algorithm Hash digest
SHA256 92900447a33f2ef4102f815a4805790d40b8164a1674d8d48566eb5c16841a06
MD5 38389963c1e2e09350a18af3d7da195a
BLAKE2b-256 1fb8d468e919903d5b57825666967c27a69fe368562b55b7a34de0e1082c32bf

See more details on using hashes here.

File details

Details for the file abin_add_two_num-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for abin_add_two_num-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af38809831faf89b807522d341a83d1d836dfba042337969a7cbc2b863148550
MD5 73ee288ab8521c34fb645c7c49e23a2c
BLAKE2b-256 04d74fcab632e9a648f02666f23be6a74bcfbebfb26f7b5f6ff23e012c098e70

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