Skip to main content

Keplore MDS

一个简单的 MCP (Model Context Protocol) 服务器,提供数学加法操作。

安装

开发模式安装

pip install -e .

普通安装

pip install .

使用方法

1. 作为 MCP 服务器运行

方法 1: 使用命令行入口

keplore-mds

方法 2: 使用 Python 模块

python -m mds.main

方法 3: 直接运行主文件

python mds/main.py

2. 作为 Python 包导入使用

# 导入整个包
import mds

# 使用加法函数
result = mds.add(5, 3)
print(f"5 + 3 = {result}")  # 输出: 5 + 3 = 8

# 创建 MCP 服务器实例
server = mds.create_server()

3. 导入具体模块

# 只导入工具函数
from mds.tools import add
result = add(10, 20)

# 导入服务器相关功能
from mds.server import create_server, run_server

# 创建服务器
server = create_server()

# 运行服务器
run_server()

项目结构

mds/
├── __init__.py          # 包初始化文件
├── main.py             # 主入口点
├── server.py           # MCP 服务器配置
├── tools.py            # 业务逻辑函数
└── test_tools.py       # 测试文件

开发

运行测试

python test_package.py

安装开发依赖

pip install -e .[dev]

MCP 工具

这个服务器提供以下 MCP 工具:

add

  • 描述: 添加两个数字
  • 参数:
    • a (int): 第一个数字
    • b (int): 第二个数字
  • 返回: 两个数字的和

示例

作为 MCP 服务器

当作为 MCP 服务器运行时,其他应用程序可以通过 stdio 协议与之通信,调用 add 工具。

作为 Python 库

from mds import add

# 简单使用
print(add(1, 2))  # 输出: 3
print(add(-5, 10))  # 输出: 5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keplore_mds-0.1.0.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

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

keplore_mds-0.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: keplore_mds-0.1.0.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.13

File hashes

Hashes for keplore_mds-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f786e8b54e1cbf8e23b371f7d06bfb1d838a4e7582cff1bbebb918b4c447101d
MD5 1f2afa63456e3b286b96dca381cc5136
BLAKE2b-256 4a68fc971779774907e67e1dccc40265b23b2fc2fb855ced5515fe776aa60f82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for keplore_mds-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c6fcd060118a48f5fa750ff91ffab99ccd55ffd9f0bb71e017cad4a00591356
MD5 4193a57337ffb0e358167f1e0697eb18
BLAKE2b-256 b25e33ef558e5ec0b82276cbd8cbb80b7a9a08fdb8a0956034ab0740a6d70c43

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.1

2 files

This release

0.1.0 This release

2 files

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