
A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A command-line toolkit that converts Python functions or scripts into standard MCP services and can run or package them for deployment.
mcpy-cli: build and run MCP services from Python files is cataloged as an MCP server attributed to liuhaotian9420. A command-line toolkit that converts Python functions or scripts into standard MCP services and can run or package them for deployment. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
No reviewed records to display. This does not establish that upstream lacks this capability.
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for mcpy-cli: build and run MCP services from Python files are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
README.md · 428372c55677 · Fetched 2026-11-13 13:32:26 UTC
Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.
Showing the last retrieved documentation snapshot; check the source for current changes.
欢迎使用 mcpy-cli!本指南将帮助您快速上手,通过简单的步骤创建、运行、转换和部署自己的 MCP (模型上下文协议) 服务。
mcpy-cli?这是一个专为简化 MCP 服务开发而设计的工具包。它能帮助您:
Python >= 3.10, 且安装了 FastMCP, 推荐安装 uv
# 使用 pip 下载
pip install mcpy-cli
# 使用 uv (如已安装)
uv pip install mcpy-cli
# 使用 uv (未安装)
pip install uv
uv pip install mcpy-cli
mcpy-cli example
# 假设在根目录下有一个 sample_tools.py 的文件
mcpy-cli run --source-path sample_tools.py
或者如果你安装了 uv
uvx --from mcpy-cli mcpy-cli --source-path sample_tools.py run
服务启动后,访问测试页面: http://localhost:8080/mcp-server/mcp
推荐使用 MCP inspector 打开该页面
本项目提供两种将 .py 脚本转换为 MCP 服务的工具,本地运行工具(run)和打包(package)
1. 本地运行
mcpy-cli run 命令可以在本地将多个 Python 文件中的函数部署为指定端口的 MCP 服务2. 打包
mcpy-cli package 命令可以将指定文件夹打包在一个名为 project 的文件夹之中# 启动服务
mcpy-cli run --source-path /path/to/your/code --port 8080
# 或者使用 uvx
uvx mcpy-cli run --source-path /path/to/your/code --port 8080
# 打包服务(用于生产部署)
mcpy-cli package --source-path /path/to/your/code --package-name my-service
# 或者使用 uvx
uvx mcpy-cli package --source-path /path/to/your/code --package-name my-service
# 查看帮助
mcpy-cli --help
# 或者使用 uvx
uvx mcpy-cli --help
本项目提供两种不同的 MCP 服务架构,您可以根据具体需求选择:
工作原理:
使用示例:
# 使用组合模式(默认)
mcpy-cli run --source-path ./my_tools --mode composed
# 访问地址:http://localhost:8080/mcp-server/mcp
# 工具调用:tool_file1_add, tool_file2_calculate 等
工作原理:
使用示例:
# 使用路由模式
mcpy-cli run --source-path ./my_tools --mode routed
# 访问地址:
# http://localhost:8080/math_tools - 数学工具模块
# http://localhost:8080/text_tools - 文本工具模块
# http://localhost:8080/data_tools - 数据工具模块
| 参数 | 描述 | 默认值 |
|---|---|---|
--source-path | 包含 Python 代码的文件或目录 | 当前目录 |
--port | 服务监听端口 | 8080 |
--host | 服务监听地址 | 127.0.0.1 |
--mcp-name | 服务名称 | 自动生成 |
--mode | 架构模式 (composed/routed) | composed |
--legacy-sse | 使用传统SSE传输 (已弃用) | 关闭 |
使用本地运行工具启动服务后,您可以通过以下方式调用:
使用 MCP Inspector,在左上角选择【streamable-http】,输入生成的服务 url (默认地址为 http://localhost:8080/mcp-server/mcp)
以 CherryStudio 为例
mcpy-cli 支持多种传输协议配置:
默认模式(Streamable HTTP):推荐使用,更稳定和简单
mcpy-cli run --source-path ./my_tools
传统SSE模式:通过 --legacy-sse 启用(已弃用,仅供兼容性使用)
mcpy-cli run --source-path ./my_tools --legacy-sse
⚠️ 注意:传统SSE模式在某些云环境(如Knative/Istio)中可能遇到路径问题,建议使用默认的Streamable HTTP模式。
mcpy-cli 支持通过事件存储(EventStore)实现服务持久化和状态恢复功能。当启用此特性时,服务会将 JSON-RPC 消息存储起来,允许在服务中断或重启后从特定事件点恢复执行。
SQLiteEventStore,将事件数据保存在本地 SQLite 数据库文件中。--enable-event-store 标志。--event-store-path 参数指定事件存储数据库文件的路径。如果未指定,默认为 ./mcp_event_store.db。# 启用事件存储并指定数据库路径
mcpy-cli run --source-path ./my_tools --enable-event-store --event-store-path ./my_service_events.db
此功能对于需要长时间运行或维护会话状态的 MCP 服务特别有用。
为了提高性能并减少重复计算,工具提供了会话级别的工具调用缓存(SessionToolCallCache)。
此机制有助于优化那些在会话中可能被频繁调用的工具的响应速度。
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for mcpy-cli: build and run MCP services from Python files from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/mcpy-cli)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.
No reviewed package or image identity; download statistics are not listed yet.
Alternative and complementary servers in the same category

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.