mcp_server
A minimal MCP server providing currency conversion, geocoding, and weather tools, with a CLI client supporting Spanish special commands.
README
Startup MVP — MCP Server & Client
This repository implements the project structure requested in the exercise: a small MCP-style tools server and a CLI client that can call the server's tools. The implementation is intentionally minimal and deterministic so it runs without external API keys, while also allowing integration with real APIs when the corresponding environment variables are provided.
Key features included:
- MCP tools server (
server/mcp_server.py) exposing endpoints for currency conversion, geocoding and weather. - Client CLI (
client/cli_interface.py) that supports English commands and Spanish special commands requested in the exercise (/salir,/clear,/status,/help). - Clear, documented project layout with environment example and requirements.
Architecture
- Server: FastAPI app in
server/mcp_server.pyproviding lightweight tools endpoints. - Client: Python CLI in
client/cli_interface.pythat calls the MCP server using HTTP. - Config:
config/settings.pycentralizes env-based settings.
Files and structure
startup-mvp/
├── server/
│ ├── __init__.py
│ ├── mcp_server.py # FastAPI app exposing tools
│ ├── currency_tools.py # Currency conversion helpers
│ ├── weather_tools.py # Weather helper (requires coords)
│ ├── geocoding_tools.py # City -> coordinates helper
│ └── api_clients.py # HTTP clients for external APIs
├── client/
│ ├── __init__.py
│ ├── openai_client.py # Client helpers that talk to the MCP server
│ └── cli_interface.py # CLI with Spanish special commands (/salir, /clear, /status)
├── config/
│ ├── __init__.py
│ └── settings.py # Environment-driven settings
├── main_server.py # Run the MCP server (uvicorn)
├── main_client.py # Run the CLI (asyncio)
├── requirements.txt
├── .env.example # Example env vars
└── README.md
Endpoints (MCP server)
POST /tools/convert_currency- body:{ "amount": float, "src": "USD", "dst": "EUR" }POST /tools/geocode- body:{ "city": "Madrid" }POST /tools/weather- body:{ "lat": float, "lon": float }
Added chat endpoints:
POST /chat/message- body:{ "user_message": "..." }— returns saved message and deterministic assistant reply.GET /chat/history- returns saved chat history.DELETE /chat/history- clears chat history.
Web UI:
The repository now includes a minimal web UI under ui/. When the MCP server is running you can open:
http://127.0.0.1:8000/ui/index.html
to interact with the /chat endpoints from the browser.
The server returns deterministic placeholder data when external API keys are not set.
Entrega (versión final)
The final, cleaned project ready for delivery is located in the entrega/ folder at the repository root. It contains only the files required by the exercise and a minimal CI workflow under entrega/.github/workflows/ci.yml.
All other auxiliary files, tests, Docker artifacts and scripts were moved to archivos_extras/.
CLI usage (important: supports Spanish special commands)
Start the server in one terminal:
python main_server.py
Start the client in another terminal:
python main_client.py
Commands you can use inside the CLI:
convert <amount> <src> <dst>— Convert currencies (e.g.convert 10 USD EUR).geocode <city>— Get coordinates for a city (e.g.geocode Madrid).weather <lat> <lon>— Get weather for coordinates (e.g.weather 40.41 -3.7).
Spanish special commands (as requested in the exercise):
/salir— Salir del CLI (equivalent toexit)./clear— Limpiar historial local (if present). Note: the MCP tools server does not persist chat history by default./status— Comprueba la disponibilidad del servidor MCP (intenta acceder a/openapi.json)./help— Mostrar esta ayuda.
All commands also accept English equivalents for exit/quit.
Running and testing
- Create and activate a virtualenv and install dependencies:
python -m venv venv
venv\Scripts\activate # Windows
pip install -r requirements.txt
- Launch the server and client as shown above, then try examples:
$ convert 10 USD EUR
$ geocode Barcelona
$ weather 41.3851 2.1734
$ /status
$ /salir
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.