Skip to content
Docs navigation

Built for agents

Your agent can sign you up, create an API key, and set up the Weather MCP. You approve once in the browser. With no one present, it can start on a 72-hour trial key.

Smarter Weather covers the 50 US states and DC only. Coverage details

Paste this prompt into your agent, or add the Onboarding MCP yourself.

Install the Smarter Weather onboarding skill. The skills CLI needs Node.js 22.20 or later. Run `npx skills@1.7.4 add https://developers.smarterweather.com --skill smarterweather-onboarding` and select your agent. You can read the skill directly at https://developers.smarterweather.com/.well-known/skills/smarterweather-onboarding/SKILL.md (raw: https://raw.githubusercontent.com/smarterweather/developer/main/plugins/smarterweather-onboarding/skills/smarterweather-onboarding/SKILL.md). Then use the onboarding skill to sign up, create an API key, and set up the Weather MCP.
Manual config

Claude Code

claude mcp add smarterweather-onboarding -- npx -y @smarterweather/mcp-onboarding@latest

Cursor (.cursor/mcp.json); VS Code (.vscode/mcp.json) uses the servers key

{
  "mcpServers": {
    "smarterweather-onboarding": {
      "command": "npx",
      "args": [
        "-y",
        "@smarterweather/mcp-onboarding@latest"
      ]
    }
  }
}

The onboarding flow, end to end

Anonymous discovery → OAuth (your agent's host prompts you once) → key creation → self-configuration. The tools below cover the whole account lifecycle:

ToolAuthWhat it does
get_plansAnonymousCompare plans and pricing
get_documentationAnonymousFetch docs for any surface
sign_upAnonymousReturn the free sign-up link
start_trialstdioCreate a trial key through the stdio bridge; writes .env
create_api_keyOAuthCreate an API key (idempotent)
claim_trial_keyOAuthClaim a trial key onto the Free plan
list_api_keysOAuthEnumerate your keys
rotate_api_keyOAuthRotate a compromised key
revoke_api_keyOAuthRevoke a key
configure_mcpOAuthReturn ready-to-paste Weather MCP config
get_quickstartOAuthPersonalized first REST/MCP calls
get_usageOAuthCurrent-cycle usage and limits
get_billing_statusOAuthPlan, invoices, payment state
upgrade_planOAuthStart a plan-upgrade checkout
open_billing_portalOAuthOpen the Stripe billing portal
list_ideasOAuthBrowse community ideas
vote_ideaOAuthVote for a community idea

Machine-readable contracts

Your agent can fetch each of these and check what this page says:

Agent skills

Installable procedural knowledge in the open SKILL.md standard (Claude Code, Cursor, Codex CLI, Gemini CLI, Copilot, and more). Point your agent at a skill URL or drop it into your skills directory:

Discovery index: /.well-known/skills/index.json — also listed in llms.txt.

MCP Apps widgets

Onboarding tools return interactive widgets that render inside MCP-Apps-capable hosts — sign-up, usage, configuration, and upgrades without leaving the conversation:

Agent onboarding MCP sign-up tool
sign_up
Usage widget with current-cycle metering
get_usage
MCP configuration widget
configure_mcp
Plan upgrade widget
upgrade_plan

Agentic payments (x402)

Agents with wallets can pay per call on the Weather MCP, with no account and no API key. x402 is MCP-only: the REST API always needs a key. The Weather MCP returns x402 payment requirements in the tool result (USDC on Base). These tools stay free without a key: get_context, search_data, describe_data, and get_status. Paid tools start at $0.01 per call.

  1. Agent calls a paid tool keylessly and receives payment requirements in-band.
  2. Agent signs a USDC payment authorization with its wallet.
  3. Agent retries with the payment proof; the tool runs and the settlement receipt comes back in the result metadata.

Prefer a plan? A key from the Onboarding MCP works on the same endpoint. See pricing.

Key handling

Every recommended way to get a key (login, trial, stdio start_trial, and create_api_key or rotate_api_key through the stdio bridge) already writes SMARTERWEATHER_API_KEY to .env (mode 0600) and returns only a prefix. If you called the HTTP endpoints directly, do the same by hand. These rules are what next_steps.key_handling on every 401 points at.

  1. Keep the key only in .env as SMARTERWEATHER_API_KEY=… (gitignored). Never paste it into chat.
  2. Read it from the environment in code (process.env, os.environ); never inline the literal. For Cursor MCP, prefer envFile pointing at the project .env.
  3. Never echo the key into chat, logs, or a commit message.
  4. Use sw_test_* keys in CI and for load tests; rotate from the dashboard if a key ever lands in a repository.

Human present: login

Run npx -y @smarterweather/mcp-onboarding@latest login. It prints an approval link carrying a short code; the human opens the link, signs in, checks the code matches, and approves. Codes last 10 minutes. The CLI then writes a full key to .env.

Driving the RFC 8628 device grant yourself? See the device flow below.

No human present: trial

Run npx -y @smarterweather/mcp-onboarding@latest trial (or stdio start_trial). It writes a short-lived sw_live_* trial key to .env and prints only a prefix and a claim link. A human can later claim the same key onto the Free plan. You need Node.js 22 or later.

Agent and CLI trial key, no account

  • 300 requests over 72 hours, 10 a minute (burst 5).
  • Routes under /v1/weather, /v1/geocode, and /v1/alerts. /v1/catalog requests don't count toward the request budget.
  • Claim it within 7 days to keep the same key on the Free plan: 60 requests a minute, 1,000 a day, no card.
  • The portal playground's sandbox key: 100 requests over 24 hours, 20 a minute (burst 10), same routes and claim window.
  1. A 401 with if_no_human_present: trial advertises next_steps.trial.command when trial keys are on.
  2. The HTTP trial endpoints return the key in the body's api_key field. Write only that field to .env as SMARTERWEATHER_API_KEY= and never print it. Prefer the CLI or the stdio bridge.
  3. A human opens the claim link, signs in, accepts the Developer Terms, and claims the key. The same key keeps working on the Free plan.
  4. After OAuth, claim_trial_key accepts a ticket without showing the key again.

Let an agent get the key

An agent can start with no key: the API answers with a 401 that says what to do next.

curl -sS -D - 'https://api.smarterweather.com/v1/weather?lat=42.3601&lon=-71.0589'
type
"https://smarterweather.com/errors/unauthorized"
title
"Unauthorized"
status
401
detail
"Missing Authorization header. Pass your API key as 'Authorization: Bearer sw_live_*'."
instance
"/v1/weather"
next_steps
{
  "if_no_human_present": "trial",
  "recommended": "device_flow",
  "device_flow": {
    "href": "https://developers.smarterweather.com/agents?utm_campaign=401&utm_medium=problem-json&utm_source=api#device-flow",
    "description": "Human present: run the `command` below. It shows the human a verification URL and code, writes SMARTERWEATHER_API_KEY to ./.env (0600, gitignored), and prints only a key prefix. Without Node: device grant at the endpoints below, then POST api_keys_endpoint and write only the response's key field to .env as a SMARTERWEATHER_API_KEY= line (e.g. pipe through jq -r .key). Never print the key or access token.",
    "command": "npx -y @smarterweather/mcp-onboarding@latest login",
    "client_id": "k2h05BUoTP393zcD",
    "device_authorization_endpoint": "https://clerk.smarterweather.com/oauth/device_authorization",
    "token_endpoint": "https://clerk.smarterweather.com/oauth/token",
    "api_keys_endpoint": "https://api.smarterweather.com/developer/keys"
  },
  "trial": {
    "href": "https://developers.smarterweather.com/agents?utm_campaign=401&utm_medium=problem-json&utm_source=api#trial",
    "description": "No human present: run the `command` below. It mints a trial key, writes SMARTERWEATHER_API_KEY to ./.env (0600, gitignored), prints only a key prefix and claim link. Without Node: GET challenge_endpoint, solve the SHA-256 proof-of-work, then POST mint_endpoint with the JSON body {\"challenge_token\": \"<from the challenge>\", \"solution\": \"<decimal string>\", \"accept_terms\": <true only once the terms are accepted>, \"client\": {\"name\": \"<your app name>\"}}. Set accept_terms to true only after reading the terms at https://developers.smarterweather.com/legal/terms (newer challenge responses carry them as terms_url, plus a request_example whose accept_terms stays false until you change it). Its api_key field is the bearer; write only that field to .env as a SMARTERWEATHER_API_KEY= line and never print it. Claim into a free account before claim_expires_at.",
    "command": "npx -y @smarterweather/mcp-onboarding@latest trial",
    "challenge_endpoint": "https://api.smarterweather.com/developer/keys/trial/challenge",
    "mint_endpoint": "https://api.smarterweather.com/developer/keys/trial"
  },
  "agents": {
    "href": "https://developers.smarterweather.com/llms.txt?utm_campaign=401&utm_medium=problem-json&utm_source=api"
  },
  "errors": {
    "href": "https://developers.smarterweather.com/errors?utm_campaign=401&utm_medium=problem-json&utm_source=api"
  },
  "get_key": {
    "href": "https://developers.smarterweather.com/dashboard/api-keys?utm_campaign=401&utm_medium=problem-json&utm_source=api"
  },
  "key_handling": {
    "href": "https://developers.smarterweather.com/agents?utm_campaign=401&utm_medium=problem-json&utm_source=api#key-handling"
  },
  "keyless_x402": {
    "href": "https://developers.smarterweather.com/agents?utm_campaign=401&utm_medium=problem-json&utm_source=api#x402"
  },
  "onboarding_mcp": {
    "href": "https://developers.smarterweather.com/agents?utm_campaign=401&utm_medium=problem-json&utm_source=api"
  },
  "quickstart": {
    "href": "https://developers.smarterweather.com/quickstart?utm_campaign=401&utm_medium=problem-json&utm_source=api"
  }
}

The 401 carries a WWW-Authenticate challenge and an RFC 9457 problem with a next_steps map. recommended (device_flow) names the link to take when a person is present; if_no_human_present names the trial link to take when no one is. Links other than those two are shortened to their href above.

A person is present

Run npx -y @smarterweather/mcp-onboarding@latest login in the background or with a long shell timeout, and relay the link and code it prints. It blocks until the person approves, then writes SMARTERWEATHER_API_KEY to ./.env (mode 0600, gitignored) and prints only a key prefix. The 401's next_steps.device_flow.command names this command. You need Node.js 22 or later.

Without Node.js, use the device grant directly.

  1. POST device_authorization_endpoint with the advertised client_id and scope=openid email. Read device_code, user_code, verification_uri, and interval.
  2. Show the person verification_uri and user_code. Poll token_endpoint with grant_type=urn:ietf:params:oauth:grant-type:device_code every interval seconds. Handle authorization_pending, slow_down, and expired_token.
  3. POST api_keys_endpoint with the access token, the body { "name": "cli <project>", "origin": { "channel": "device_flow" } }, and a new Idempotency-Key UUID. On 403 email_not_verified, ask the person to verify their email, then retry. Write only the response's key field to .env as SMARTERWEATHER_API_KEY=.
  4. Discard the access token. Never print it or the key.
npx -y @smarterweather/mcp-onboarding@latest login
# Preferred: the one command above. Shows the human a URL, writes ./.env
# (0600, gitignored), prints only a key prefix.

# Raw recipe (no Node): reference only, not a runnable script; step 2 needs
# your own poll loop. Stop if .env already has SMARTERWEATHER_API_KEY.
# 1. Ask Clerk for a device code (client_id is public; it is in the 401 body).
curl -sS -X POST 'https://clerk.smarterweather.com/oauth/device_authorization' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  --data-urlencode 'client_id=k2h05BUoTP393zcD' \
  --data-urlencode 'scope=openid email'

# 2. Show the human verification_uri + user_code. Poll until they approve.
#    grant_type=urn:ietf:params:oauth:grant-type:device_code
#    handle authorization_pending / slow_down / expired_token.

# 3. Create a key and write ONLY its key field to .env. Nothing reaches the terminal.
# (umask 077; curl -sS -X POST 'https://api.smarterweather.com/developer/keys' \
#   -H "Authorization: Bearer $ACCESS_TOKEN" \
#   -H "Idempotency-Key: $(uuidgen)" \
#   -H 'Content-Type: application/json' \
#   -d '{"name":"cli my-project","origin":{"channel":"device_flow"}}' \
#   | jq -er '"SMARTERWEATHER_API_KEY=" + .key' >> .env)
# grep -qx '.env' .gitignore 2>/dev/null || echo .env >> .gitignore

# 4. Discard the access token (unset ACCESS_TOKEN).

No one is present

Follow No human present: trial above.

Result: .env holds a key and the terminal shows only its prefix.

Then: the Weather MCP

Once your agent has a key (or a wallet), point it at the Weather MCP for forecasts, alerts, radar, probabilistic guidance, and raw model data. 6 tools on every connection to https://mcp.smarterweather.com, for any MCP client. search_data takes a question in plain words and returns the get_data call that answers it. See the tool reference.

One-click installs are global; for the key, put the per-project config in the project's .cursor/mcp.json / .vscode/mcp.json.

Manual config

Claude Code

claude mcp add smarterweather -- npx -y @smarterweather/mcp-weather@latest

Per-project Cursor (.cursor/mcp.json); VS Code (.vscode/mcp.json) uses the servers key

{
  "mcpServers": {
    "smarterweather": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@smarterweather/mcp-weather@latest"
      ],
      "envFile": "${workspaceFolder}/.env"
    }
  }
}

Reads SMARTERWEATHER_API_KEY from your project's .env (written by login / trial). With no key, tool calls get x402 payment requirements; run login or trial.