MCP Python Server — API Wrapper
Supports configuration through environment variables for API keys and endpoints, allowing secure storage of authentication credentials
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Python Server — API Wrapperconsultar_api with parameter 'weather' to get current conditions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: MCP Starter
🚀 Requirements
Python 3.9+
mcp[cli] (installable via pip or uv)
Claude or ChatGPT Desktop (with MCP support)
📁 Project structure
.
├── servidores/profile.py # Servidor MCP con herramientas para interactuar con mi backend del curriculum.
├── server.py # Servidor MCP con herramienta "consultar_api".
├── .env # Variables opcionales para auth/API.
├── claude.json # Config. MCP para integrarlo directamente.
└── README.md # Este documento.⚙️ Installation
With pip
pip install "mcp[cli]"With UV (recommended)
uv init mcp-api-server
cd mcp-api-server
uv add "mcp[cli]"Installation of the MCP
mcp install mi_script.pyInstallation with .env
mcp install mi_script.py -f .envInstallation of dependencies
pip install -r requirements.txtEnvironment variables
Create a .env file in the project root to define optional environment variables:
# .env
API_KEY=mi_api_key
API_URL=https://miapi.com/consulta👷 Quick Start (Quickstart)
Create the server server.py
from mcp.server.fastmcp import FastMCP
import httpx
mcp = FastMCP("API Wrapper")
@mcp.tool(description="Consulta una API externa")
async def consultar_api(param: str) -> str:
"""Consulta una API externa con un parámetro y devuelve la respuesta."""
async with httpx.AsyncClient() as client:
r = await client.get(f"https://miapi.com/consulta?param={param}")
return r.textRun locally in dev mode
mcp dev server.pyRun in production mode
mcp run server.pyOr with uv:
uv run --with mcp[cli] mcp run server.py🚀 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:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"/codigo/backend-curso-inkor/proyectos_memes"
]
},
"Demo": {
"command": "uv",
"args": [
"run",
"--with",
"mcp[cli]",
"mcp",
"run",
"C:\\codigo\\backend-curso-inkor\\MCP\\server.py"
]
}
}
}🤖 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
@mcp.tool()
async def traducir(texto: str, lang: str) -> str:
return f"Traducido: {texto} → {lang}"🔍 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 deployed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A Model Context Protocol server for Wix AI tools
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA custom Model Context Protocol server that gives Claude Desktop and other LLMs access to file system operations and command execution capabilities through standardized tool interfaces.23Apache 2.0
- AlicenseDqualityDmaintenanceA foundation for building custom local Model Context Protocol (MCP) servers that provide tools accessible to AI assistants like Cursor or Claude Desktop.137MIT
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol server that allows integration with Claude Desktop by creating and managing custom tools that can be executed through the MCP framework.52 npm-
- FlicenseNot gradedqualityDmaintenanceA Model Context Protocol (MCP) server built with the mcp-framework for developing and managing custom tools. It provides a structured foundation for building and integrating modular components like data processors and API clients into Claude Desktop.5 npm-