Skip to main content

MCP提示词管理服务

Project description

Python MCP提示词服务

基于Model Context Protocol的Python SDK实现的提示词管理服务。

功能

  • 连接Cloudflare Worker API获取提示词数据
  • 提供MCP接口供Claude等AI助手调用
  • 包含可靠的重试、超时和缓存机制

安装

  1. 创建虚拟环境
python -m venv venv
source venv/bin/activate  # Linux/Mac
# 或者 venv\Scripts\activate  # Windows
  1. 安装依赖
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

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

python_mcp-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

python_mcp-1.0.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file python_mcp-1.0.0.tar.gz.

File metadata

  • Download URL: python_mcp-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for python_mcp-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b223b85cc8875d1ec981ac8c57715f8209ee744b82ece2a0dced06d4b33c2f77
MD5 99992f9a607b075bcf41489c1c4567ca
BLAKE2b-256 cba9125fb817f20ed97f5c92e043e0a9179063c47b966f88cee59b3f7342fb18

See more details on using hashes here.

File details

Details for the file python_mcp-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_mcp-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for python_mcp-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65363f981d617cf1d137d9c4f0bca89d133bfeadd28a6f419c311f1c49f14d7c
MD5 690cb3a3efb62e883eb764abecb3a8bc
BLAKE2b-256 af3e50b5c27c0c4c52b4b21c2a54297fff7b0a4b2f22f6520ff4931d5865eb27

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