Docs navigation
Reference
Weather MCP
Agents
Set up the Weather MCP
Connect the Weather MCP to Claude Code, Claude Desktop, Cursor, VS Code, or any MCP client. Most tools need an API key. Without one, 4 tools are free and every other tool takes an x402 payment per call. The stdio bridge needs Node.js 22 or later.
Get a key with npx -y @smarterweather/mcp-onboarding@latest login (human) or trial (no account). The key goes to the project .env, and the bridge reads it via envFile / SMARTERWEATHER_ENV_FILE / ./.env. No config below holds the key.
One-click install
Installs the stdio bridge into your client. No key yet? Run login or trial in the project first (see Prerequisites for the other ways). Each host's per-project config is below.
One-click installs are global; for the key, put the per-project config in the project's .cursor/mcp.json / .vscode/mcp.json.
Prerequisites
- Node.js 22 or later (the stdio bridge runs with
npx) - An API key, from one of:
loginor the dashboard: needs a free Smarter Weather account (create one)trial: no account neededcreate_api_keyon the Onboarding MCP: needs a free account and an OAuth sign-in. The one-click onboarding install connects anonymously (discovery tools only), so addSMARTERWEATHER_ONBOARDING_AUTH=requiredto itsenvfor the stdio bridge to sign you in first
Claude Desktop
Add the following to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS). Claude Desktop has no project folder, so point the bridge at the project .env with an absolute path. The config holds a path, never the key:
{
"mcpServers": {
"smarterweather": {
"command": "npx",
"args": [
"-y",
"@smarterweather/mcp-weather@latest"
],
"env": {
"SMARTERWEATHER_ENV_FILE": "/absolute/path/to/your/project/.env"
}
}
}
}Claude Code
No --env flag, so no key lands in ~/.claude.json. Run login or trial in the project root, then run Claude Code from the project root:
claude mcp add smarterweather -- npx -y @smarterweather/mcp-weather@latestCursor
For a manual merge into the project .cursor/mcp.json (envFile loads the project's .env, so no key goes in the config):
{
"mcpServers": {
"smarterweather": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@smarterweather/mcp-weather@latest"
],
"envFile": "${workspaceFolder}/.env"
}
}
}VS Code
The project .vscode/mcp.json uses the servers key; envFile works the same way:
{
"servers": {
"smarterweather": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@smarterweather/mcp-weather@latest"
],
"envFile": "${workspaceFolder}/.env"
}
}
}Without a key
The Weather MCP does not offer OAuth sign-in to generic MCP clients, so use an API key. With no key, tool calls return x402 payment requirements, except get_context, search_data, describe_data, and get_status, which stay free.
Generic MCP client
Any stdio-capable client can run the same bridge. It reads the key from SMARTERWEATHER_API_KEY, then SMARTERWEATHER_ENV_FILE, then ./.env:
npx -y @smarterweather/mcp-weather@latestDo not append @preview — latest is the GA bridge. The hosted Weather MCP is at https://mcp.smarterweather.com; the npm package is a thin stdio-to-Streamable-HTTP proxy.
Remote HTTP
Clients that support remote MCP servers with headers can connect to https://mcp.smarterweather.com directly (Cursor syntax shown). Every connection serves the same tools:
{
"mcpServers": {
"smarterweather": {
"url": "https://mcp.smarterweather.com",
"headers": {
"Authorization": "Bearer ${env:SMARTERWEATHER_API_KEY}"
}
}
}
}Cursor and Claude Code (.mcp.json, written ${SMARTERWEATHER_API_KEY}) read the key from the client's environment. VS Code instead prompts for it once: use type: "http" with a promptString input marked password: true and Bearer ${input:<id>}. Either way the key is never pasted into the file.
Apps launched from the Dock, Start menu or a desktop shortcut don't see exports from ~/.zshrc or ~/.bashrc. An unset variable sends an empty Bearer header, which fails with a 401 (it is not treated as keyless). Start the client from a shell that has the variable set, or use the stdio bridge with envFile above. envFile doesn't apply to remote servers, so the stdio bridge stays the default for desktop hosts.
Verify the connection
After setup, try this prompt in your MCP client:
What's the weather in Denver, CO right now?
Your agent should call get_data with "select": ["forecast"] and location (or ask search_data for that call first), then answer with current conditions.
Inspect it
To see the server without an MCP client in the loop, open it in the MCP Inspector (version 2, which needs Node.js 22.19 or later). No key is needed to list the tools with their input schemas and run the free discovery tools, such as get_platform_status:
npx -y @modelcontextprotocol/inspector@2 --transport http --server-url https://mcp.smarterweather.comEvery other tool needs a key. With SMARTERWEATHER_API_KEY set in your shell (as for Remote HTTP above), pass it as a header:
npx -y @modelcontextprotocol/inspector@2 --transport http --server-url https://mcp.smarterweather.com --header "Authorization: Bearer $SMARTERWEATHER_API_KEY"If the variable is unset, empty, or still a placeholder such as sw_live_..., the server answers 401. Typing the key into an export SMARTERWEATHER_API_KEY= line leaves it in your shell history.
While the Inspector runs, the expanded key is also visible in the machine's process list. On a shared machine, start the Inspector with no server instead:
npx -y @modelcontextprotocol/inspector@2It opens your server catalog. Add a server there with the Streamable HTTP transport, the URL https://mcp.smarterweather.com, and an Authorization header (Bearer and your key) under Custom Headers. The Inspector saves custom headers in plain text in ~/.mcp-inspector/mcp.json, readable only by your user, so remove the header when you are done.
For a terminal or CI check, the Inspector CLI prints the tool list. Listing tools needs no key:
npx -y @modelcontextprotocol/inspector@2 --cli https://mcp.smarterweather.com --transport http --method tools/listTo run a tool in your browser instead, use the Tool reference. To call the REST API, open the API playground.
Troubleshooting
- Tools not appearing: stdio children do not inherit your shell. Check that the
.envthe config points at (envFileorSMARTERWEATHER_ENV_FILE) containsSMARTERWEATHER_API_KEY; the bridge logs one stderr line naming where it looked. - Claude Code can't find the key: start
claudefrom the project root, or re-add the server with-e SMARTERWEATHER_ENV_FILE=/absolute/path/to/project/.env(a path, never the key). - Connection timeout: the bridge needs Node.js 22 or later. Run
node --versionto verify.