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.
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/userandtenant/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/currentGET /data/4.0/onecall/timeline/1minGET /data/4.0/onecall/timeline/15minGET /data/4.0/onecall/timeline/1hGET /data/4.0/onecall/timeline/1dayGET /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
- Copy
.env.exampleto.envand fill values. - Start local dependencies:
docker compose up -d postgres vault
- Install dependencies:
npm ci
- Generate endpoint inventory artifact:
npm run inventory:generate
- Run tests:
npm test
- Start MCP:
- stdio:
npm run start:stdio - http:
npm run start:http
- stdio:
Key Environment Variables
MCP_ADMIN_AUTH_KEY: Required for mutating tools when set.MCP_CONFIG_DEFAULT_TENANT_IDMCP_CONFIG_DEFAULT_PRINCIPAL_TYPEMCP_CONFIG_DEFAULT_PRINCIPAL_IDOPENWEATHER_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:generatenpm run inventory:checknpm 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
authorizationKeywhenMCP_ADMIN_AUTH_KEYis configured. MCP_ALLOW_SENSITIVE_OUTPUT=falseredacts sensitive values from tool output.
License
MIT (see LICENSE).
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.