Supports configuration through environment variables for API keys and endpoints, allowing secure storage of authentication credentials
MCP Python Server—API Wrapper
This project creates an MCP server in Python that exposes a tool for querying an external API. It is compatible with Claude Desktop or ChatGPT Desktop that support the Model Context Protocol (MCP).
✨ Features
Exposing a tool via MCP
HTTP query to an external API
Direct integration with Claude/Desktop via claude.json
Related MCP server: Optimized Memory MCP Server V2
🚀 Requirements
Python 3.9+
mcp[cli] (installable via pip or uv)
Claude or ChatGPT Desktop (with MCP support)
📁 Project structure
⚙️ Installation
With pip
With UV (recommended)
Installation of the MCP
Installation with .env
Installation of dependencies
Environment variables
Create a .env file in the project root to define optional environment variables:
👷 Quick Start (Quickstart)
Create the server server.py
Run locally in dev mode
Run in production mode
Or with uv:
🚀 Integration with Claude/Desktop
Locate claude.json in the Claude/Desktop configuration folder:
On Windows: %APPDATA%\Claude\claude.json
On Linux/macOS: ~/.claude/claude.json
Example:
🤖 Use within Claude/Desktop
You can ask the model:
Use the consult_api tool with the "ping" parameter
And the model will use your MCP server to make a real-time HTTP call.
🎁 Bonus: Tools Extension
🔍 Resources
Official MCP documentation: https://docs.mcp.run/
Python SDK repository: https://github.com/modelcontextprotocol/mcp
✅ Made with love and httpx 🚀
This server cannot be installed