Skip to main content
Glama
surplus-mcp

surplus-mcp

Official
by surplusrh

The official MCP server for Surplus

Give Claude, Cursor, Windsurf and any MCP client direct access to open and frontier LLMs, with live pricing and spend tracking, through one API key.

npm CI License: MIT MCP

Website · Get an API key · Report an issue


Why

Your assistant is good at one model. Surplus gives it the rest of the catalogue: Qwen, DeepSeek, GLM, Claude and more behind a single OpenAI-compatible API. With this server installed, your agent can:

  • Delegate work to the right model. Hand a long summarisation to a cheap fast model, or ask a second model for a review.

  • Compare models side by side on the same prompt without leaving the chat.

  • Stay inside budget. Every reply comes back with its token count and exact USD cost, and the agent can check your balance before a long job.

  • Verify confidential inference. Fetch the signed enclave receipt for any tee/… response.

Related MCP server: WarungCyber MCP Server

Quick start

1. Get a key at surplusllm.com/account. It looks like sk-surplus-….

2. Add the server to your client.

claude mcp add surplus -e SURPLUS_API_KEY=sk-surplus-... -- npx -y surplus-mcp

Settings → Developer → Edit Config, then add to claude_desktop_config.json:

{
  "mcpServers": {
    "surplus": {
      "command": "npx",
      "args": ["-y", "surplus-mcp"],
      "env": { "SURPLUS_API_KEY": "sk-surplus-..." }
    }
  }
}

Add to ~/.cursor/mcp.json (or .cursor/mcp.json in a project):

{
  "mcpServers": {
    "surplus": {
      "command": "npx",
      "args": ["-y", "surplus-mcp"],
      "env": { "SURPLUS_API_KEY": "sk-surplus-..." }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "surplus": {
      "command": "npx",
      "args": ["-y", "surplus-mcp"],
      "env": { "SURPLUS_API_KEY": "sk-surplus-..." }
    }
  }
}

Add to .vscode/mcp.json:

{
  "servers": {
    "surplus": {
      "command": "npx",
      "args": ["-y", "surplus-mcp"],
      "env": { "SURPLUS_API_KEY": "sk-surplus-..." }
    }
  }
}

3. Ask your assistant.

"List the Qwen models on Surplus and their prices."

"Ask qwen/qwen3.8-flash and deepseek/deepseek-v4-flash to explain this function, then compare the answers."

"How much have I spent on Surplus today?"

Tools

Tool

Description

Key required

list_models

Every available model with context length, vision and tool-calling support, and USD price per 1M tokens. Filter with search.

—

chat

Run a single prompt or a full messages conversation on any model. Returns the reply plus tokens used and cost.

✓

get_balance

Your credit balance and free daily allowance.

✓

get_usage

Your most recent billed requests, newest first.

✓

get_tee_receipt

The signed enclave receipt for a confidential (tee/…) response.

✓

Configuration

Variable

Default

Description

SURPLUS_API_KEY

—

Your API key. Without it, only list_models is available.

SURPLUS_DEFAULT_MODEL

—

Model chat uses when none is given, e.g. qwen/qwen3.8-flash.

SURPLUS_BASE_URL

https://api.surplusllm.com/api/v1

API endpoint. Must be https (plain http is allowed for localhost only).

SURPLUS_TIMEOUT_MS

120000

Per-request timeout in milliseconds.

Security

  • Your key is sent only to SURPLUS_BASE_URL, over HTTPS, and is never logged.

  • The server runs locally over stdio. It opens no ports and stores nothing on disk.

  • API errors come back to the assistant as readable tool errors; they never crash the server.

Development

Requires Node.js 20 or later.

git clone https://github.com/surplusrh/surplus-mcp.git
cd surplus-mcp
npm install
npm test
npm run build

Explore the tools interactively with the MCP Inspector:

npx @modelcontextprotocol/inspector node dist/index.js

Contributions are welcome. Please open an issue first for anything larger than a small fix.

License

MIT © Surplus

Available Tools

5 tools
chatRun inference on SurplusA

Send a prompt to a model on Surplus and return its reply. Billed to the configured API key. Pass prompt for a single turn, or messages for a full conversation. Call list_models to pick a model id.

Inputs: model, prompt, system, messages, +2 more.

get_balanceSurplus balanceA
Read-only

Show the USD credit balance and the free daily allowance for the configured API key.

Inputs: no named parameters.

get_tee_receiptConfidential inference receiptA
Read-only

Fetch the signed TEE receipt for one of your confidential (tee/…) responses, to verify it ran inside the enclave.

Inputs: id (required).

get_usageSurplus usageA
Read-only

List the most recent requests billed to the configured API key, newest first, with model, tokens and cost.

Inputs: limit.

list_modelsList Surplus modelsA
Read-only

List models available on Surplus with context length and USD price per 1M tokens. Use search to filter by id or name.

Inputs: search.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool targets a distinct resource/action: catalog browsing (list_models), inference (chat), attestation (get_tee_receipt), and two clearly separated billing views (get_balance = current credit, get_usage = historical requests). The balance/usage pair is the only near-neighbor, and the descriptions make the boundary explicit.

    Naming Consistency4/5

    Four of five tools follow a clean verb_noun snake_case pattern (list_models, get_tee_receipt, get_balance, get_usage). The single bare verb `chat` is a minor deviation, though it reads naturally for an inference endpoint.

    Tool Count5/5

    Five tools is tightly scoped for an LLM API gateway: discovery, inference, attestation, and account visibility, with no redundant entries. Every tool earns its place.

    Completeness4/5

    Core workflows are covered end to end: find a model, call it, verify the TEE receipt, and monitor spend. Minor gaps exist (no per-model detail endpoint, no usage filtering/pagination, no non-chat endpoints like embeddings), but agents can work around these via list_models search and the provided usage listing.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Connects Claude Desktop, Cursor, or any MCP-compatible client to 36+ frontier LLMs with automatic per-token payments in USDC on Solana.
      5
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP clients to browse a live catalog of 100+ models with pricing, rankings and measured uptime, check credits and spend, and send chat completions through an OAuth-authenticated, per-connection key capped by a spend limit. Read tools are free, and paid calls are priced and approved before any credit is used.
      MIT