Skip to main content
Glama

Python Server MCP

Python Server MCP – Kryptowährungspreisdienst

Dieses Projekt implementiert einen MCP-Server (Model Context Protocol), der Preisinformationen zu Kryptowährungen bereitstellt. Der Server basiert auf Python und dem MCP-Framework, um eine API zu erstellen, die von verschiedenen Clients genutzt werden kann.

Docker

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

Fügen Sie Ihrer mcp.json Datei Folgendes hinzu:

{ "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", } } } }

Merkmale

  • Echtzeit-Abruf von Kryptowährungspreisen
  • Umgebungsbasierte Konfiguration (Entwicklung, Produktion, Staging, lokal)
  • CoinMarketCap API-Integration
  • Bereitstellung von Docker-Containern

Anforderungen

  • Python 3.12+
  • uv (Paket- und virtueller Umgebungsmanager)
  • Docker (optional, zur Containerausführung)

Installation

Verwendung von UV (empfohlen)

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

Erstellen und aktivieren Sie virtuelle Umgebungen mit UV

uv venv source .venv/bin/activate

Installieren von Abhängigkeiten

uv sync

Konfiguration

  1. Erstellen Sie im Projektstammverzeichnis eine .env Datei mit den folgenden Variablen:
ENVIRONMENT=DEV # Options: LOCAL, DEV, STAGING, PROD COINMARKETCAP_API_KEY=your_api_key_here
  1. Sie können auch spezifische Umgebungsdateien für jede Umgebung erstellen:
    • .dev.env – Für die Entwicklungsumgebung
    • .staging.env – Für die Staging-Umgebung
    • .prod.env – Für die Produktionsumgebung

Verwendung

Lokale Ausführung

python main.py

Dadurch wird der MCP-Server gestartet, der über die Standardeingabe/-ausgabe (stdio) auf Anforderungen wartet.

Verwenden von Docker

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

Projektstruktur

. ├── 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

Entwicklung

Hinzufügen neuer Tools zum MCP-Server

Um dem MCP-Server ein neues Tool hinzuzufügen, gehen Sie folgendermaßen vor:

  1. Definieren Sie die Funktion in der Datei src/__init__.py
  2. Registrieren Sie das Tool in der Funktion main()
  3. Dokumentieren Sie das Tool mit Docstrings

Beispiel:

@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
-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Ein Preisdienst für Kryptowährungen, der Echtzeit-Preisinformationen zu Kryptowährungen über ein MCP-Framework (Model Context Protocol) mit CoinMarketCap-API-Integration bereitstellt.

  1. Docker
    1. Merkmale
      1. Anforderungen
        1. Installation
          1. Verwendung von UV (empfohlen)
          2. Erstellen und aktivieren Sie virtuelle Umgebungen mit UV
        2. Installieren von Abhängigkeiten
          1. Konfiguration
          2. Verwendung
          3. Projektstruktur
          4. Entwicklung

        Related MCP Servers

        • A
          security
          A
          license
          A
          quality
          Real-time cryptocurrency market data integration using CoinCap's public API, providing access to crypto prices and market information without API keys
          Last updated -
          3
          147
          37
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.
          Last updated -
          3
          196
          26
          TypeScript
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface. Updated to use Coin Cap API v3
          Last updated -
          3
          20
          TypeScript
          MIT License
          • Apple

        View all related MCP servers

        MCP directory API

        We provide all the information about MCP servers via our MCP API.

        curl -X GET 'https://glama.ai/api/mcp/v1/servers/stevearagonsite/PythonServerMcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server