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.1.tar.gz (5.0 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.1-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 5.0 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.1.tar.gz
Algorithm Hash digest
SHA256 0b3f4fab87cdd7839669204c6bbbb1d07a0c20d5e22e05ce3eee567e1c94f2c5
MD5 46ab2e7bfdfee8909fc1810085b28f0c
BLAKE2b-256 cff285106c333721c39500a05a6b2ab144f2bf61b2ebe661ebadc087c2f9ddc9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_mcp-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 04b9ca4ab6e5d206ce9e54fc0ee941d9a3b7f9e405baef83625199024b2cfdf6
MD5 878acdc95faf49fbb906efff3a6c6f20
BLAKE2b-256 5f246db39be3196ef9dfd6056f4e3306339358a17755cfc3a388df27ee3331a0

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