Skip to main content

一个基于MCP的简单计算器服务

Project description

MCP计算器服务

这是一个基于MCP(Model Control Protocol)的简单计算器服务,提供基本的数学运算功能。

功能特性

  • 加法运算
  • 减法运算
  • 乘法运算
  • 除法运算(包含除零检查)

安装

pip install mcp-server-jisuanqi

使用方法

  1. 启动服务:
# 激活虚拟环境(如果使用)
source .venv/bin/activate

# 运行服务
python -m mcp_server_jisuanqi
  1. 使用MCP客户端调用:
from mcp.client import Client

client = Client()

# 加法运算
result = client.jisuanqi.mcp_jisuanqi_add(a=5, b=3)  # 返回 8

# 减法运算
result = client.jisuanqi.mcp_jisuanqi_subtract(a=10, b=4)  # 返回 6

# 乘法运算
result = client.jisuanqi.mcp_jisuanqi_multiply(a=6, b=7)  # 返回 42

# 除法运算
result = client.jisuanqi.mcp_jisuanqi_divide(a=15, b=3)  # 返回 5

开发环境设置

  1. 克隆仓库:
git clone https://github.com/yourusername/mcp-server-jisuanqi.git
cd mcp-server-jisuanqi
  1. 创建并激活虚拟环境:
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# 或
.venv\Scripts\activate  # Windows
  1. 安装依赖:
pip install -e ".[dev]"

许可证

MIT License

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

mcp_server_jisuanqi-0.1.0.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

mcp_server_jisuanqi-0.1.0-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_jisuanqi-0.1.0.tar.gz.

File metadata

  • Download URL: mcp_server_jisuanqi-0.1.0.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for mcp_server_jisuanqi-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9d6268e800abbd3a9e7b6b9c9897ac0bd5f607daa07c6aca37907326c4ee89cd
MD5 4a3cdb4c16dc3b1830d2bd18eeb0a72f
BLAKE2b-256 fe836a48cc2b0e49704fa0780d754b81cc8cf9a74f0d24dbe1d4cb5e0ad3e0ce

See more details on using hashes here.

File details

Details for the file mcp_server_jisuanqi-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_jisuanqi-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 903da9179fe2e256bda6f9961ce3bd98824e698d4b6282569e287f658fcb64a4
MD5 25a0e7c493938d23a552503e07f9f3f9
BLAKE2b-256 f7a525a6ffc678b66b986220a4e888e808628ba3a17856831ace4f58bf7bdb91

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