mcp -demo
MCP Server demo code in Python
claude mcp add --transport stdio manishh-mcp-server-demo uv run currency.py \ --env CURRENCY_API_KEY="<your-API-key>"
How to use
This MCP server provides two AI-callable tools for working with currencies: convert_currency and list_currencies. The convert_currency tool takes an amount, a source currency code, and a target currency code to return the converted value. The list_currencies tool fetches and returns the supported currencies from an external Currency API. You can test and interact with these tools through standard MCP JSON-RPC requests, or by using the included test_mcp.py script to see the available tools and their expected payloads. When integrated with Claude Desktop, you can connect to the server by configuring the mcpServers.currency entry in claude_desktop_config.json, pointing to the UV runner that executes currency.py and optionally providing your Currency API key via the CURRENCY_API_KEY environment variable. This setup enables Claude to call the two tools directly from your local MCP server.
How to install
Prerequisites:
- Python 3.10+
- UV installed (for dependency management and running the MCP server)
- Access to a Currency API key
Installation steps:
-
Clone the repository: git clone https://github.com/manishh/mcp-server-demo cd <project-directory>
-
Create and activate a Python virtual environment (optional but recommended):
if using Python venv
python3 -m venv .venv source .venv/bin/activate # macOS/Linux .venv\Scripts\activate # Windows
-
Install dependencies and set up the environment: uv sync
-
Export your Currency API key (required by the server): export CURRENCY_API_KEY=your_api_key_here # macOS/Linux set CURRENCY_API_KEY=your_api_key_here # Windows
-
Start the MCP server: uv run currency.py
-
(Optional) Test available tools locally: python test_mcp.py
Notes:
- Ensure the CURRENCY_API_KEY environment variable is set before starting the server.
- The server uses stdio transport for integration with local AI agents like Claude Desktop.
Additional notes
Tips and troubleshooting:
- If you encounter authentication or key issues, verify that CURRENCY_API_KEY is correctly exported and accessible to the process running currency.py.
- For Claude Desktop integration, ensure the absolute path to the UV executable and the project directory are correctly configured in claude_desktop_config.json as shown in the README example.
- The server is educational and uses an external Currency API; rate limits or API changes may affect tool responses.
- The two available tools are:
- convert_currency: converts a given amount from one currency to another.
- list_currencies: returns a list of supported currencies from the external API.
- If you modify currency.py or related files, re-test with python test_mcp.py to verify tool availability and RPC formats.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP