SDKs

MCP Server

Model Context Protocol server exposing Solvela tools to MCP-compatible agents

Overview

The Solvela MCP server exposes the gateway's capabilities as MCP tools, enabling MCP-compatible AI agents (like Claude Desktop) to call LLMs through Solvela's x402 payment infrastructure.

Installation

The MCP server is not published to npm today (package.json is marked private: true). Build it from the monorepo:

git clone https://github.com/solvela-ai/solvela.git
cd solvela/sdks/mcp
npm install
npm run build
# Built artifact: dist/index.js

Run it directly to confirm the build:

node dist/index.js

Configuration

The server reads these environment variables on startup:

VariableRequiredDescription
SOLANA_WALLET_KEYYes (for paid calls)Base58-encoded Solana keypair secret
SOLANA_RPC_URLYes (for paid calls)Solana JSON-RPC endpoint
SOLVELA_API_URLNoGateway base URL (default https://api.solvela.ai)
SOLVELA_SESSION_BUDGETNoPer-session USDC cap (e.g. 2.00)
SOLVELA_TIMEOUT_MSNoHTTP timeout for gateway calls
SOLVELA_SIGNING_MODENoauto / escrow / direct / off (default auto)
SOLVELA_ESCROW_PROGRAM_IDIf escrow modeEscrow program ID on Solana mainnet
SOLVELA_RECIPIENT_WALLETIf escrow modeGateway recipient pubkey
export SOLVELA_API_URL=https://api.solvela.ai
export SOLANA_WALLET_KEY=<base58-keypair-secret>
export SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

Warning

SOLANA_WALLET_KEY is the full Solana keypair secret. Treat it like any other production credential — never commit it to source, and prefer a secrets manager or your host's encrypted env-var store over a plaintext shell profile.

Claude Desktop integration

Add an entry to claude_desktop_config.json that points at your locally-built dist/index.js (absolute path required — npx is not available because the package is not on npm):

{
  "mcpServers": {
    "solvela": {
      "command": "node",
      "args": ["/absolute/path/to/solvela/sdks/mcp/dist/index.js"],
      "env": {
        "SOLVELA_API_URL": "https://api.solvela.ai",
        "SOLANA_WALLET_KEY": "<base58-keypair-secret>",
        "SOLANA_RPC_URL": "https://api.mainnet-beta.solana.com"
      }
    }
  }
}

Available tools

The MCP server exposes the following tools to connected agents:

ToolDescription
chatSend a chat completion request to a specified model
list_modelsList available models with pricing
healthCheck gateway health
get_costEstimate cost for a model and token count

Example usage in Claude Desktop

Once configured, Claude can call the Solvela gateway directly:

User: Use Solvela to ask GPT-4o what the capital of France is.
Claude: [calls solvela.chat with model="openai/gpt-4o"]

Warning

The MCP server signing is currently a stub — it uses placeholder payment signatures. For production use, implement proper Solana transaction signing in the MCP server or use the TypeScript or Python SDK directly.

Note

Source code: sdks/mcp/ in the monorepo.