Sign In

@leanroute/mcp-server

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leanroute/mcp-server

MCP server for Leanroute — lets agents (Claude Code, Cursor, Windsurf, Cline) list models, check pricing, route LLM calls, and manage keys/usage/credit on their Leanroute account.

latest
Source
npmnpm
Version
0.1.3
Version published
Maintainers
1
Created
Source

@leanroute/mcp-server

Model Context Protocol server for Leanroute — an LLM gateway that lets your agent hit 13 providers (OpenAI, Anthropic, Google, xAI, DeepSeek, Groq, Meta, and more) through one API with prompt caching, semantic caching, failover, and per-key spend caps.

This package lets agents — Claude Code, Cursor, Windsurf, Cline, Claude Desktop — discover Leanroute as a tool source and use it directly.

What tools does it expose?

ToolWhat it does
list_modelsList models this account can dispatch to
get_pricingFull pricing catalog (input/output $/M, cached-input discount)
cheapest_forRank cheapest models for a task tier
route_callDispatch an LLM completion (OpenAI chat-completions shape)
get_usageAggregated spend, grouped by day/model/provider/key
get_credit_balanceCurrent prepaid balance in USD
list_keysList runtime gateway keys
create_runtime_keyMint a new runtime key
revoke_runtime_keyRevoke a runtime key

The server cannot top up credit, upload BYOK provider keys, or mint admin keys. Those actions stay behind the dashboard for safety.

Install

You don't have to install — just point your MCP client at npx @leanroute/mcp-server.

Configure

1. Mint an admin key

At https://leanroute.dev/dashboard/admin-keys, click New admin key and copy the gw_admin_* value.

2. Optionally mint a runtime key

If you want the agent to use the route_call tool (actually dispatch LLM completions through Leanroute), also mint a gw_live_* runtime key at https://leanroute.dev/dashboard/keys. Skip this if the agent only needs to check pricing/usage.

3. Wire it up in your MCP client

Claude Code / Claude Desktop (~/.config/claude/claude_desktop_config.json):

{
  "mcpServers": {
    "leanroute": {
      "command": "npx",
      "args": ["-y", "@leanroute/mcp-server"],
      "env": {
        "LEANROUTE_ADMIN_KEY": "gw_admin_xxx",
        "LEANROUTE_RUNTIME_KEY": "gw_live_xxx"
      }
    }
  }
}

Cursor — same shape under .cursor/mcp.json in your project or ~/.cursor/mcp.json globally.

Windsurf / Cline — check the tool's MCP configuration docs; the command + env format is the standard.

Environment variables

VarRequiredDefaultNotes
LEANROUTE_ADMIN_KEYyesgw_admin_* from /dashboard/admin-keys
LEANROUTE_RUNTIME_KEYnogw_live_* — only needed for route_call
LEANROUTE_BASE_URLnohttps://api.leanroute.devOverride for self-hosted instances

Security model

  • Admin keys cannot dispatch LLM traffic. If a runtime key leaks, the attacker cannot enumerate/mutate account state.
  • Runtime keys cannot hit /platform/v1/*. If an admin key leaks, the attacker cannot drain your LLM budget.
  • Neither key class can top up credit or upload provider keys. Those require a browser session.

License

Apache-2.0

Keywords

mcp

FAQs

Package last updated on 22 Aug 2026

Related posts