- Home
- MCP servers
- Python
Python
- python
0
GitHub Stars
python
Language
7 months ago
First Indexed
3 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"stevearagonsite-pythonservermcp": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-p",
"8000:8000",
"-e",
"ENVIRONMENT",
"-e",
"COINMARKETCAP_API_KEY",
"mcp/python-server-mcp"
],
"env": {
"ENVIRONMENT": "PRODUCTION",
"COINMARKETCAP_API_KEY": "your-api-key"
}
}
}
}You can run and use a Python MCP server that provides real-time cryptocurrency price data. This MCP server is designed to be consumed by clients that speak the MCP protocol, exposing a straightforward way to fetch up-to-date prices from CoinMarketCap and related sources, with environment-based configuration and containerized deployment options.
How to use
To use this server, run it in your environment and connect an MCP client to the server’s interface. You can operate the server locally or inside a container. The server exposes price data for cryptocurrencies and supports configuration per environment. Start the server in your chosen mode, then use your MCP client to request price information for the coins you follow. The client communicates via the MCP protocol and receives structured price responses suitable for dashboards, analytics, or trading workflows.
How to install
Prerequisites you need on your system: Python 3.12 or newer, the uv package and virtual environment helper, and Docker if you want containerized execution.
# Prerequisites
python3 --version
uv --version
# If you plan to use Docker, ensure Docker is installed and accessible
Step 1: Clone the project and open the directory. Step 2: Create a virtual environment using uv and activate it. Step 3: Install dependencies with uv sync.
# Clone the repository (replace with your actual URL)
git clone <repository-url>
cd PythonServerMcp
# Create and activate virtual environment
uv venv
source .venv/bin/activate
# Install dependencies
uv sync
Step 4: Prepare configuration. Create a .env file at the project root with required variables, or use environment-specific files if you prefer per-environment settings.
ENVIRONMENT=DEV # Options: LOCAL, DEV, STAGING, PROD
COINMARKETCAP_API_KEY=your_api_key_here
Step 5: Start the server locally. You can run it directly in stdio mode for development.
python main.py
Step 6: If you prefer containerized execution, build and run the Docker image. The container will expose the server on port 8000 so you can point your MCP client to that endpoint.
# Build the image
docker build -t test-mcp -f Dockerfile --platform linux/amd64 .
# Run the container
docker run -it test-mcp
Additional configuration and notes
Configuration options include an environment selector and an API key for CoinMarketCap. You can place environment-specific settings in dedicated files (for example, .dev.env, .staging.env, .prod.env) to simplify switching between environments. The .env file in the project root should include ENVIRONMENT and COINMARKETCAP_API_KEY at minimum.
The server is designed to listen for incoming MCP requests via stdio when run locally, or expose an HTTP API when containerized with port mapping. Use the corresponding client configuration to connect to the server from your MCP ecosystem.
Project structure highlights help you navigate the source when you need to customize behavior or extend capabilities. Key components include the main MCP server entry point, configuration modules for different environments, and a resource layer for coin market data.
Project structure overview
The project is organized to separate core logic, configuration, resources, and services. The main entry points and supporting modules are arranged to enable straightforward extension when you want to add new data sources or tools.
Security and maintenance
Protect your API key by placing it in environment variables and avoiding hard-coded values in code. Use per-environment configuration files to limit exposure when moving between development, staging, and production. Rotate your CoinMarketCap API key as needed and limit permissions to the minimum required for price retrieval.
Project guidance for extending the MCP server
If you want to add new functionality, you can define new tools in the server code and register them so clients can invoke them via MCP. The process involves implementing the tool, registering it with the server, and documenting its input and return values so clients can interact with it reliably.
Available tools
my_new_tool
Description of what the tool does. Args: parameter1 (str) description, parameter2 (int) description. Returns: description of what is returned.