@virga-mcp/server
# @virga-mcp/server
MCP (Model Context Protocol) server for the [Virga Weather API](https://api.virga.dev). Exposes weather data as native tools for LLM clients.
## Quick Start
### Claude Code
```bash
claude mcp add --transport stdio --env VIRGA_API_KEY=sk_virga_prod_xxx virga-weather -- npx -y @virga-mcp/server
```
### Codex CLI
```bash
codex mcp add virga-weather --env VIRGA_API_KEY=sk_virga_prod_xxx -- npx -y @virga-mcp/server
```
### Gemini CLI
```bash
gemini mcp add virga-weather -- npx -y @virga-mcp/server --api-key sk_virga_prod_xxx
```
Or add to `~/.gemini/settings.json`:
```json
{
"mcpServers": {
"virga-weather": {
"command": "npx",
"args": ["-y", "@virga-mcp/server", "--api-key", "sk_virga_prod_xxx"]
}
}
}
```
### Claude Desktop
Add to your config file:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"virga-weather": {
"command": "npx",
"args": ["-y", "@virga-mcp/server"],
"env": {
"VIRGA_API_KEY": "sk_virga_prod_xxx"
}
}
}
}
```
### Cursor
Add as an MCP server in Cursor settings (Settings > MCP Servers), or add to `.cursor/mcp.json`:
```json
{
"mcpServers": {
"virga-weather": {
"command": "npx",
"args": ["-y", "@virga-mcp/server", "--api-key", "sk_virga_prod_xxx"]
}
}
}
```
### Windsurf
Add to your MCP configuration:
```json
{
"virga-weather": {
"command": "npx",
"args": ["-y", "@virga-mcp/server", "--api-key", "sk_virga_prod_xxx"]
}
}
```
### OpenCode
Add to `opencode.json`:
```json
{
"mcp": {
"virga-weather": {
"type": "local",
"command": ["npx", "-y", "@virga-mcp/server"],
"environment": {
"VIRGA_API_KEY": "sk_virga_prod_xxx"
}
}
}
}
```
### Xcode (26.3+)
Xcode 26.3 has native MCP support. Add to your Xcode MCP configuration:
```json
{
"servers": {
"virga-weather": {
"command": "npx",
"arguments": ["-y", "@virga-mcp/server"],
"environment": {
"VIRGA_API_KEY": "sk_virga_prod_xxx"
}
}
}
}
```
### Environment Variable
You can also set the API key as an environment variable instead of passing it as a flag:
```bash
VIRGA_API_KEY=sk_virga_prod_xxx npx @virga-mcp/server
```
## Weather Tools
| Tool | Description | Credits |
|------|-------------|---------|
| `get_current_weather` | Current weather conditions for a lat/lon | 1 |
| `get_hourly_forecast` | Hourly forecast (1-120 hours) | 2 |
| `get_daily_forecast` | Daily forecast (1-16 days) | 2 |
| `get_historical_weather` | Historical weather for a specific date | 3 |
| `search_location` | Geocode a place name to lat/lon | 0 (free) |
## Account & Billing Tools
| Tool | Description |
|------|-------------|
| `create_account` | Create a new account, get a stage API key |
| `accept_terms` | Accept the current terms of service |
| `activate_billing` | Set up payment method (returns Stripe checkout URL) |
| `purchase_credits` | Buy a credit bundle (returns Stripe checkout URL) |
| `get_billing_status` | Credit balance, spend caps, auto-topup config |
| `list_api_keys` | List all API keys for the account |
| `create_api_key` | Create a new API key (stage or production) |
| `revoke_api_key` | Permanently revoke an API key |
| `get_usage` | API usage history with credit costs |
## Resources
| Resource | URI | Description |
|----------|-----|-------------|
| Account Status | `weather://account/status` | Credit balance, rate limits, usage |
| Terms | `weather://terms` | Current terms of service |
| Pricing | `weather://pricing` | Credit costs per tool and bundles |
| OpenAPI Spec | `weather://openapi` | Full OpenAPI 3.1 specification |
| Onboarding | `weather://onboarding` | Step-by-step autonomous setup guide |
| Docs | `weather://docs` | Condensed LLM-friendly documentation |
## Prompt Templates
| Prompt | Description |
|--------|-------------|
| `setup_weather_account` | Guided walkthrough for account creation and billing setup |
| `check_weather` | Check current weather at a location by name |
| `weather_forecast` | Get a daily or hourly forecast for a location |
## CLI Options
| Flag | Description | Default |
|------|-------------|---------|
| `--api-key <key>` | Virga API key | `VIRGA_API_KEY` env var |
| `--base-url <url>` | API base URL | `https://api.virga.dev` |
| `--help` | Show help | |
| `--version` | Show version | |
## Getting an API Key
Use the `setup_weather_account` prompt template, or follow these steps:
1. Create an account: `POST https://api.virga.dev/api/v1/accounts`
2. Accept terms: `POST https://api.virga.dev/api/v1/terms/accept`
3. Set up billing: `POST https://api.virga.dev/api/v1/billing/activate`
4. Purchase credits: `POST https://api.virga.dev/api/v1/billing/credits`
5. Create a production key: `POST https://api.virga.dev/api/v1/keys`
Or use a stage key (free, no credits required) for testing.
TDQS
Scored across 14 tools
The five weather/geocoding tools have clearly distinct temporal scopes (current, hourly, daily, historical) and search_location is a clear geocoder. The account/billing/key tools are mostly distinct, though create_account vs create_api_key and get_billing_status vs get_usage could be momentarily confused by an agent, but descriptions disambiguate them.
All 14 tools follow a strict snake_case verb_noun pattern (get_*, create_*, list_*, revoke_*, accept_*, activate_*, purchase_*, search_location). No mixed conventions or vague single-word names.
14 tools is well within the ideal 3-15 range and each tool maps to a concrete operation: weather retrieval, geocoding, account onboarding, billing, key management, and usage. Nothing feels redundant or padded.
The weather and lifecycle surface is strong: read weather data, geocode, create account, accept terms, activate billing, buy credits, manage keys, check usage. However, get_billing_status exposes spend caps and auto-topup configuration with no corresponding tools to set them, and there is no way to delete an account or update key metadata — minor but real dead ends.