MCP Weather & Files AI Server MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/gabriellsanabria/mcp-weather-server.git
cd mcp-weather-server
pip install -r requirements.txt
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "WEATHER_API_KEY=${WEATHER_API_KEY}" -e "OPENAI_API_KEY=${OPENAI_API_KEY}" -e "ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}" weather-files-ai -- python "<FULL_PATH_TO_MCP_WEATHER_SERVER>/dist/index.js"

Replace <FULL_PATH_TO_MCP_WEATHER_SERVER>/dist/index.js with the actual folder you prepared in step 1.

Required:WEATHER_API_KEYOPENAI_API_KEYANTHROPIC_API_KEY
README.md

Real-time weather data, local file navigation, and AI-powered analysis.

MCP Weather & Files AI Server

Servidor avançado baseado no protocolo Model Context Protocol (MCP), oferecendo integração com dados meteorológicos em tempo real, acesso ao sistema de arquivos local e análise inteligente de dados para clientes compatíveis com MCP.

Demonstração Visual

Esta interface permite simular chamadas de ferramentas, visualizar logs em tempo real e validar a conectividade com as APIs externas de forma visual.

Funcionalidades

  • Dados Meteorológicos: Informações em tempo real via OpenWeatherMap.org.
  • Gerenciamento de Arquivos: Leitura segura de arquivos locais e navegação em diretórios.
  • Informações Geográficas: Dados detalhados sobre países e regiões via RestCountries API.
  • Análise com Inteligência Artificial: Integração com OpenAI (provedor primário) e Anthropic (fallback automático).
  • Arquitetura Assíncrona: Implementação de alta performance utilizando asyncio e httpx.

Ferramentas Disponíveis

1. `get_weather`

Recupera condições climáticas atuais para uma cidade específica.

  • city (string): Nome da cidade.
  • country_code (string, opcional): Código ISO do país.

2. `read_file`

Realiza a leitura de arquivos de texto locais de forma segura.

  • file_path (string): Caminho absoluto ou relativo do arquivo.

3. `list_directory`

Lista o conteúdo de diretórios locais com metadados de arquivos.

  • directory_path (string): Caminho do diretório alvo.

4. `get_location_facts`

Fornece dados demográficos e geográficos de um país.

  • country (string): Nome comum ou oficial do país.

5. `analyze_with_ai`

Realiza análises complexas e gera recomendações através de LLMs.

  • prompt (string): Task ou pergunta para análise.
  • context (string, opcional): Dados suplementares para a análise.
  • Estratégia: Utiliza GPT-4o-mini por padrão, com failover para Claude 3.5 Sonnet em caso de falha.

Requisitos Técnicos

  • Python 3.10 ou superior
  • MCP SDK
  • httpx
  • asyncio
  • Pydantic

Instalação

# Clonar o repositório
git clone https://github.com/gabriellsanabria/mcp-weather-server.git
cd mcp-weather-server

# Configurar ambiente virtual
python -m venv venv
# Ativação Windows: .\venv\Scripts\activate
# Ativação Linux/Mac: source venv/bin/activate

# Instalar dependências
pip install -r requirements.txt

Configuração

  1. Obtenha uma chave de API em OpenWeatherMap.org.
  2. Configure as variáveis de ambiente no arquivo .env (baseado no .env.example):
    WEATHER_API_KEY="sua_chave_aqui"
    OPENAI_API_KEY="sua_chave_aqui"
    ANTHROPIC_API_KEY="sua_chave_aqui"
    

Integração com Claude Desktop

Adicione a seguinte configuração ao seu arquivo claude_desktop_config.json:

{
  "mcpServers": {
    "weather-files-ai": {
      "command": "python",
      "args": ["C:/caminho/para/server.py"],
      "env": {
        "WEATHER_API_KEY": "sua_chave",
        "OPENAI_API_KEY": "sua_chave",
        "ANTHROPIC_API_KEY": "sua_chave"
      }
    }
  }
}

Dashboard Web

O projeto inclui uma interface de gerenciamento moderna para testar as ferramentas e visualizar o status do servidor via navegador.

Como Executar:

  1. Inicie a API do Dashboard:
    python api.py
    
  2. Acesse no navegador: 👉 http://localhost:8000

Demonstração Visual

Esta interface permite simular chamadas de ferramentas, visualizar logs em tempo real e validar a conectividade com as APIs externas de forma visual.

Segurança

  • Validação de caminhos para prevenir ataques de directory traversal.
  • Operações de arquivo restritas à leitura (read-only).
  • Esquemas de ferramentas rigorosamente definidos.

Licença

MIT

Autor

Gabriel Sanabria

Tools (5)

get_weatherRetrieves current weather conditions for a specific city.
read_fileSecurely reads local text files.
list_directoryLists the contents of local directories with file metadata.
get_location_factsProvides demographic and geographic data for a country.
analyze_with_aiPerforms complex analysis and generates recommendations using LLMs.

Environment Variables

WEATHER_API_KEYrequiredAPI key for OpenWeatherMap
OPENAI_API_KEYrequiredAPI key for OpenAI
ANTHROPIC_API_KEYrequiredAPI key for Anthropic

Configuration

claude_desktop_config.json
{"mcpServers": {"weather-files-ai": {"command": "python", "args": ["C:/caminho/para/server.py"], "env": {"WEATHER_API_KEY": "sua_chave", "OPENAI_API_KEY": "sua_chave", "ANTHROPIC_API_KEY": "sua_chave"}}}}

Try it

What is the current weather in Tokyo, Japan?
Read the contents of the file at ./project/notes.txt and summarize it.
List all files in the current directory to help me find my configuration file.
Tell me some interesting demographic facts about Brazil.
Analyze the text I just read from the file and suggest improvements.

Frequently Asked Questions

What are the key features of MCP Weather & Files AI Server?

Real-time weather data integration via OpenWeatherMap. Secure local file system reading and directory navigation. Geographic and demographic data retrieval via RestCountries API. AI-powered analysis with OpenAI and Anthropic fallback. Asynchronous architecture using asyncio and httpx.

What can I use MCP Weather & Files AI Server for?

Automating weather-based reports for specific geographic locations. Quickly summarizing local project documentation files. Gathering country-specific data for research or travel planning. Performing intelligent analysis on local text-based data logs.

How do I install MCP Weather & Files AI Server?

Install MCP Weather & Files AI Server by running: git clone https://github.com/gabriellsanabria/mcp-weather-server.git && cd mcp-weather-server && pip install -r requirements.txt

What MCP clients work with MCP Weather & Files AI Server?

MCP Weather & Files AI Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Weather & Files AI Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare