MCP Python 服务器—API 包装器
该项目用 Python 创建了一个 MCP 服务器,它公开了一个用于查询外部 API 的工具。与支持模型上下文协议 (MCP) 的 Claude Desktop 或 ChatGPT Desktop 兼容。
✨ 特点
通过 MCP 公开工具
对外部 API 的 HTTP 查询
通过 claude.json 直接与 Claude/Desktop 集成
🚀 要求
Python 3.9+
mcp[cli](可通过 pip 或 uv 安装)
Claude 或 ChatGPT 桌面版(支持 MCP)
📁 项目结构
⚙️ 安装
使用 pip
带紫外线(推荐)
MCP 的安装
使用 .env 安装
安装依赖项
环境变量
在项目根目录中创建一个.env
文件来定义可选的环境变量:
👷 快速入门(Quickstart)
创建服务器server.py
在开发模式下本地运行
以生产模式运行
或者使用 uv:
🚀 与 Claude/Desktop 集成
在 Claude/Desktop 配置文件夹中找到 claude.json:
在 Windows 上:%APPDATA%\Claude\claude.json
在 Linux/macOS 上:~/.claude/claude.json
例子:
🤖 在 Claude/Desktop 中使用
你可以问模特:
使用带有“ping”参数的consult_api工具
并且该模型将使用您的 MCP 服务器进行实时 HTTP 调用。
🎁 奖励:工具扩展
🔍 资源
MCP 官方文档: https://docs.mcp.run/
Python SDK 存储库: https://github.com/modelcontextprotocol/mcp
✅ 用爱和 httpx 🚀 制作
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
实现模型上下文协议的 Python 服务器,它公开用于查询外部 API 的工具,与 Claude Desktop 和 ChatGPT Desktop 兼容。
Related MCP Servers
- -securityAlicense-qualityA Python-based server that implements the Model Context Protocol to interface with Claude Desktop as an MCP client, supporting interaction through efficient memory management.Last updated -1MIT License
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to perform Python development tasks through file operations, code analysis, project management, and safe code execution.Last updated -5
- -securityAlicense-qualityA streamlined foundation for building Model Context Protocol servers in Python, designed to make AI-assisted development of MCP tools easier and more efficient.Last updated -13MIT License
- AsecurityFlicenseAqualityA Python-based Model Context Protocol server that integrates with Claude Desktop, allowing users to connect to Hubble API services by configuring the server with their Hubble API key.Last updated -7