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.jsRun it directly to confirm the build:
node dist/index.jsConfiguration
The server reads these environment variables on startup:
| Variable | Required | Description |
|---|---|---|
SOLANA_WALLET_KEY | Yes (for paid calls) | Base58-encoded Solana keypair secret |
SOLANA_RPC_URL | Yes (for paid calls) | Solana JSON-RPC endpoint |
SOLVELA_API_URL | No | Gateway base URL (default https://api.solvela.ai) |
SOLVELA_SESSION_BUDGET | No | Per-session USDC cap (e.g. 2.00) |
SOLVELA_TIMEOUT_MS | No | HTTP timeout for gateway calls |
SOLVELA_SIGNING_MODE | No | auto / escrow / direct / off (default auto) |
SOLVELA_ESCROW_PROGRAM_ID | If escrow mode | Escrow program ID on Solana mainnet |
SOLVELA_RECIPIENT_WALLET | If escrow mode | Gateway 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.comWarning
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:
| Tool | Description |
|---|---|
chat | Send a chat completion request to a specified model |
list_models | List available models with pricing |
health | Check gateway health |
get_cost | Estimate 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.