Skip to main content
Glama

MCP-Server

Ein erweiterbarer Model Context Protocol (MCP)-Server mit Wetter- und Zeit-Tools. Entwickelt zum Lernen – verbinden Sie ihn mit Claude Desktop und beginnen Sie zu chatten.

Erste Schritte

1. Klonen & Installieren

git clone <repo-url> && cd mcp-server
python3 -m venv .venv
source .venv/bin/activate   # macOS / Linux / WSL
pip install -e .

Oder mit uv:

git clone <repo-url> && cd mcp-server
uv venv
source .venv/bin/activate
uv pip install -e .

2. Mit Claude Desktop verbinden

Führen Sie das Setup-Skript aus, um die Konfigurationsdatei von Claude Desktop automatisch zu schreiben:

macOS:

python setup_claude_agent.py

Dies schreibt ~/Library/Application Support/Claude/claude_desktop_config.json und verweist auf das .venv/bin/python Ihres Projekts.

Wenn sich Ihr Projekt an einem nicht standardmäßigen Speicherort befindet, geben Sie diesen explizit an:

python setup_claude_agent.py --project-path /path/to/mcp-server

Windows (via WSL):

python3 setup_claude_agent.py --windows --win-user <YourWindowsUser> --wsl-user <YourWSLUser>

Zum Beispiel:

python3 setup_claude_agent.py --windows --win-user Cam --wsl-user cam

Dies schreibt %APPDATA%\Claude\claude_desktop_config.json und konfiguriert Claude Desktop so, dass der Server über WSL gestartet wird.

3. Claude Desktop neu starten

Schließen Sie Claude Desktop und öffnen Sie es erneut. Um zu überprüfen, ob der Server verbunden ist, gehen Sie zu Einstellungen → Entwickler — Sie sollten mcp-server mit einem grünen running-Badge sehen.

4. Ausprobieren

Fragen Sie Claude eines der folgenden Dinge:

  • "Wie spät ist es?" — verwendet das get_current_time-Tool

  • "Hole Wetterwarnungen für Kalifornien" — verwendet die Ressource weather://alerts/CA

  • "Wie ist die Vorhersage für Breitengrad 40.7128, Längengrad -74.0060?" — verwendet die Vorhersage-Ressource

Sie müssen den Server nicht manuell starten — Claude Desktop startet ihn automatisch.


Related MCP server: mcp-weather

Verfügbare Tools & Ressourcen

Typ

Name

Was es tut

Tool

get_current_time

Gibt die aktuelle Uhrzeit mit automatischer Zeitzonenerkennung zurück

Ressource

weather://alerts/{state}

Wetterwarnungen für einen US-Bundesstaat (z. B. CA, NY)

Ressource

weather://forecast/{lat}/{lon}

5-Perioden-Vorhersage für Koordinaten

Prompt

analyze_weather_prompt

Leitet Claude durch eine vollständige Wetteranalyse

Prompt

timezone_helper_prompt

Hilft bei Zeitzonenprüfungen, Konvertierungen und Vergleichen

Eigene Tools hinzufügen

Öffnen Sie src/mcp_server/server.py und fügen Sie eine Funktion mit dem @mcp.tool()-Dekorator hinzu:

@mcp.tool()
async def my_tool(param: str) -> str:
    """Description of what this tool does."""
    return f"Result for {param}"

Starten Sie Claude Desktop neu, um die Änderung zu übernehmen.

Für Ressourcen und Prompts siehe CONTRIBUTING.md.

Tests ausführen

pip install -e ".[dev]"   # or: uv pip install -e ".[dev]"
pytest

Projektstruktur

src/mcp_server/
├── server.py              # MCP server entry point — register tools here
└── tools/
    ├── weather/           # Weather alerts & forecasts (NWS API)
    ├── time/              # IP-based timezone & current time
    └── conversation/      # Conversation tools

Lizenz

MIT

Ressourcen

Available Tools

4 tools
clear_old_cacheA

Clear expired weather cache entries.

Args: max_age_minutes: Maximum age in minutes before considering expired

Returns: Status message with number of entries removed

Inputs: max_age_minutes. Returns: result

get_alertsA

Get active weather alerts for a US state.

Provides current weather alerts and warnings for the specified state. Checks cache first (30 min expiry), fetches fresh if needed.

Args: state: Two-letter US state code (e.g. CA, NY)

Inputs: state (required). Returns: result

get_current_timeA

Get the current time based on the user's IP address.

This tool determines the user's timezone from their IP address using geolocation and returns the current local time in that timezone.

Args: ip_address: Optional IP address to determine timezone. If not provided or empty string, attempts to detect automatically or defaults to UTC.

Returns: Formatted string with current time, timezone, day, and ISO timestamp

Inputs: ip_address. Returns: result

get_forecastA

Get weather forecast for geographic coordinates.

Provides a 5-day forecast for the specified location. Checks cache first (60 min expiry), fetches fresh if needed.

Args: latitude: Latitude of the location (-90 to 90) longitude: Longitude of the location (-180 to 180)

Inputs: latitude (required), longitude (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool targets a distinct function: cache management, alerts, current time, and forecast. No overlap or ambiguity.

    Naming Consistency5/5

    All names follow a consistent verb_noun snake_case pattern (clear_old_cache, get_alerts, get_current_time, get_forecast).

    Tool Count4/5

    With 4 tools, the set is slightly sparse but well-scoped for a combined weather/time server. Each tool serves a clear purpose.

    Completeness3/5

    Missing current weather conditions and location-based time input; only alerts and forecast for weather, time only via IP. Notable gaps exist.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server built with the mcp-framework to provide weather-related tools and data to AI clients. It enables integration of weather capabilities and custom tools into the MCP ecosystem for use with platforms like Claude Desktop.
      -
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides weather and time tools, enabling users to get current time, weather alerts, and forecasts through natural language with Claude Desktop.
      4
      MIT