weather-mcp

weather-mcp

Multi-tenant MCP server for OpenWeather One Call API 4.0, providing weather data, alerts, and management tools with Vault/Postgres persistence and tenant scoping.

Category
Visit Server

README

weather-mcp

Multi-tenant MCP server for OpenWeather One Call API 4.0, built from the skeleton pattern with:

  • Persistent secrets in Vault
  • Persistent configuration in Postgres
  • Tenant/principal scoping (tenant/user and tenant/account)
  • Admin-guarded mutation tools through MCP_ADMIN_AUTH_KEY
  • Full One Call 4.0 endpoint coverage

What This MCP Exposes

OpenWeather One Call 4.0 endpoints covered:

  • GET /data/4.0/onecall/current
  • GET /data/4.0/onecall/timeline/1min
  • GET /data/4.0/onecall/timeline/15min
  • GET /data/4.0/onecall/timeline/1h
  • GET /data/4.0/onecall/timeline/1day
  • GET /data/4.0/onecall/alert/{alert_id}

Extra dedicated MCP tools:

  • Scope metadata and discovery
  • Query suggestion and schema discovery
  • Vault API key upsert/delete/status per tenant/principal
  • Postgres config get/list/set/delete per tenant/principal
  • Vault HTTP token create/revoke per tenant/principal
  • Safe pagination URL follower

Persistence Model

  • Secrets (OpenWeather API key, HTTP auth token index) are stored in Vault KV.
  • Config values are stored in Postgres table <app_name>_config.

Scope path examples:

  • Vault token index: weather/tenants/acme/users/sam/http/auth/token-index
  • Vault API key secret: weather/tenants/acme/users/sam/http/auth/token-index/openweather

Quick Start

  1. Copy .env.example to .env and fill values.
  2. Start local dependencies:
    • docker compose up -d postgres vault
  3. Install dependencies:
    • npm ci
  4. Generate endpoint inventory artifact:
    • npm run inventory:generate
  5. Run tests:
    • npm test
  6. Start MCP:
    • stdio: npm run start:stdio
    • http: npm run start:http

Key Environment Variables

  • MCP_ADMIN_AUTH_KEY: Required for mutating tools when set.
  • MCP_CONFIG_DEFAULT_TENANT_ID
  • MCP_CONFIG_DEFAULT_PRINCIPAL_TYPE
  • MCP_CONFIG_DEFAULT_PRINCIPAL_ID
  • OPENWEATHER_API_KEY: global fallback only; recommended pattern is scoped Vault key via tool.
  • MCP_HTTP_TOKEN_SOURCE=vault|static

See .env.example for complete list.

Tooling Reference

Detailed LLM-oriented tool contracts are in:

  • docs/tools.md

Coverage inventory artifact:

  • artifacts/openweather-onecall4-inventory.json

Inventory and Push Enforcement

Scripts:

  • npm run inventory:generate
  • npm run inventory:check
  • npm run verify:prepush

CI workflow .github/workflows/inventory-and-tests.yml enforces:

  • Inventory generation
  • Inventory file committed and stable
  • Full test pass through verify:prepush

Security Notes

  • Do not place production OpenWeather keys in plaintext env if scoped Vault keys are available.
  • Mutating tools should always be invoked with authorizationKey when MCP_ADMIN_AUTH_KEY is configured.
  • MCP_ALLOW_SENSITIVE_OUTPUT=false redacts sensitive values from tool output.

License

MIT (see LICENSE).

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured