Cover image
Try Now
2025-04-02

Ein Template -Repository für MCP

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Python Server MCP - Cryptocurrency Price Service

This project implements an MCP (Model Context Protocol) server that provides cryptocurrency price information. The server is built using Python and the MCP framework to create an API that can be consumed by different clients.

Docker

Docker build: docker build -t mcp/python-server-mcp -f Dockerfile .

Add the following to your mcp.json file:

{
  "mcpServers": {
    "python-server-mcp": {
      "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",
      }
    }
  }
}

Features

  • Real-time cryptocurrency price retrieval
  • Environment-based configuration (development, production, staging, local)
  • CoinMarketCap API integration
  • Docker container deployment

Requirements

  • Python 3.12+
  • uv (package and virtual environment manager)
  • Docker (optional, for container execution)

Installation

Using uv (recommended)

# Clone the repository
git clone <repository-url>
cd PythonServerMcp

Create and activate virtual environment with uv

uv venv
source .venv/bin/activate

Install dependencies

uv sync

Configuration

  1. Create a .env file in the project root with the following variables:
ENVIRONMENT=DEV  # Options: LOCAL, DEV, STAGING, PROD
COINMARKETCAP_API_KEY=your_api_key_here
  1. You can also create specific environment files for each environment:
    • .dev.env - For development environment
    • .staging.env - For staging environment
    • .prod.env - For production environment

Usage

Local Execution

python main.py

This will start the MCP server that will listen for requests through standard input/output (stdio).

Using Docker

# Build the image
docker build -t test-mcp -f Dockerfile --platform linux/amd64 .

# Run the container
docker run -it test-mcp

Project Structure

.
├── main.py
└── src
    ├── __init__.py
    ├── core
    │   ├── common
    │   │   ├── crypto_schema.py
    │   │   └── schema.py
    │   ├── config.py
    │   ├── settings
    │   │   ├── __init__.py
    │   │   ├── base.py
    │   │   ├── development.py
    │   │   ├── environment.py
    │   │   ├── local.py
    │   │   ├── production.py
    │   │   └── staging.py
    │   └── utils
    │       ├── datetime.py
    │       ├── extended_enum.py
    │       ├── filename_generator.py
    │       ├── passwords.py
    │       ├── query_utils.py
    │       └── redis.py
    ├── mcp_server.py
    ├── resources
    │   ├── __init__.py
    │   └── coinmarketcap_resource.py
    ├── server.py
    ├── services
    │   ├── __init__.py
    │   └── coinmarketcap_service.py
    └── tools
        ├── __init__.py
        └── prices.py

Development

Adding New Tools to the MCP Server

To add a new tool to the MCP server, follow these steps:

  1. Define the function in the src/__init__.py file
  2. Register the tool in the main() function
  3. Document the tool with docstrings

Example:

@server.add_tool
def my_new_tool(parameter1: str, parameter2: int) -> str:
    """
    Description of what the tool does.
    
    Args:
        parameter1: Description of parameter 1
        parameter2: Description of parameter 2
        
    Returns:
        Description of what is returned
    """
    # Tool implementation
    return result

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • Entdecken Sie die umfassendste und aktuellste Sammlung von MCP-Servern auf dem Markt. Dieses Repository dient als zentraler Hub und bietet einen umfangreichen Katalog von Open-Source- und Proprietary MCP-Servern mit Funktionen, Dokumentationslinks und Mitwirkenden.

  • jae-jae
  • MCP -Server für den Fetch -Webseiteninhalt mit dem Headless -Browser von Dramatikern.

  • HiveNexus
  • Ein KI-Chat-Bot für kleine und mittelgroße Teams, die Modelle wie Deepseek, Open AI, Claude und Gemini unterstützt. 专为中小团队设计的 ai 聊天应用 , 支持 Deepseek 、 Open ai 、 claude 、 Gemini 等模型。

  • ravitemer
  • Ein leistungsstarkes Neovim -Plugin für die Verwaltung von MCP -Servern (Modellkontextprotokoll)

  • patruff
  • Brücke zwischen Ollama und MCP -Servern und ermöglicht es lokalen LLMs, Modellkontextprotokoll -Tools zu verwenden

    Reviews

    3 (1)
    Avatar
    user_V5ZBI7ql
    2025-04-16

    PythonServerMcp by stevearagonsite is a game-changer for server-side programming in Python. Its robust features and seamless integration have significantly enhanced my development workflows. The clarity of documentation on the GitHub page makes it easy to implement and get productive quickly. Highly recommend for Python enthusiasts! Check it out here: https://github.com/stevearagonsite/PythonServerMcp