Python MCP提示词服务
基于Model Context Protocol的Python SDK实现的提示词管理服务。
功能
- 连接Cloudflare Worker API获取提示词数据
- 提供MCP接口供Claude等AI助手调用
- 包含可靠的重试、超时和缓存机制
安装
- 创建虚拟环境
python -m venv venv
source venv/bin/activate # Linux/Mac
# 或者 venv\Scripts\activate # Windows
- 安装依赖
pip install -r requirements.txt
使用方法
直接测试API连接
运行direct_test.py测试直接连接到Cloudflare Worker API:
python direct_test.py
启动MCP服务器
python mcp_server.py
或使用MCP CLI工具:
mcp dev mcp_server.py
在Claude Desktop中安装
mcp install mcp_server.py --name "提示词管理服务"
测试MCP客户端
python test_client.py
配置选项
可以在mcp_server.py文件中修改以下配置项:
- WORKER_URL - Cloudflare Worker API的URL
- API_TIMEOUT - API请求超时时间(秒)
- RETRIES - 重试次数
代理配置
如需使用代理,可设置以下环境变量:
# Linux/Mac
export HTTP_PROXY=http://127.0.0.1:7890
export HTTPS_PROXY=http://127.0.0.1:7890
# Windows
set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=http://127.0.0.1:7890
Metadata
Release files for python-mcp 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_mcp-1.0.1.tar.gz | 5.0 kB | Without provenance | Details for python_mcp-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_mcp-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for python_mcp-1.0.1-py3-none-any.whl |
Total release size: 11.1 kB
Release files / python_mcp-1.0.1.tar.gz
| Download URL | python_mcp-1.0.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b3f4fab87cdd7839669204c6bbbb1d07a0c20d5e22e05ce3eee567e1c94f2c5
|
|
BLAKE2b-256 checksum How to use checksums |
cff285106c333721c39500a05a6b2ab144f2bf61b2ebe661ebadc087c2f9ddc9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Release files / python_mcp-1.0.1-py3-none-any.whl
| Download URL | python_mcp-1.0.1-py3-none-any.whl |
|---|---|
| Size | 6.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
04b9ca4ab6e5d206ce9e54fc0ee941d9a3b7f9e405baef83625199024b2cfdf6
|
|
BLAKE2b-256 checksum How to use checksums |
5f246db39be3196ef9dfd6056f4e3306339358a17755cfc3a388df27ee3331a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.2
|
Security for python-mcp 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.