Installation

Setup RelayPlane MCP Server for Claude Code, Cursor, and other MCP clients.

Claude Code

Add RelayPlane to Claude Code with a single command:

1claude mcp add relayplane -- npx @relayplane/mcp-server

With Options

1# Custom output directory for generated code
2claude mcp add relayplane -- npx @relayplane/mcp-server --out-dir ./src/lib/relayplane
3
4# With budget override (default is $5/day)
5claude mcp add relayplane -- npx @relayplane/mcp-server --max-daily-cost 10
6
7# Both options
8claude mcp add relayplane -- npx @relayplane/mcp-server \
9 --out-dir ./src/lib/relayplane \
10 --max-daily-cost 10

Cursor

Add to your Cursor MCP configuration file:

1{
2 "mcpServers": {
3 "relayplane": {
4 "command": "npx",
5 "args": ["@relayplane/mcp-server"],
6 "env": {
7 "OPENAI_API_KEY": "sk-...",
8 "ANTHROPIC_API_KEY": "sk-ant-..."
9 }
10 }
11 }
12}

Environment Variables

Set your provider API keys as environment variables:

1# Required: At least one provider key
2export OPENAI_API_KEY=sk-...
3export ANTHROPIC_API_KEY=sk-ant-...
4
5# Optional: Additional providers
6export GOOGLE_API_KEY=...
7export XAI_API_KEY=...
You only need keys for the providers you want to use. The server will automatically detect which providers are available.

CLI Flags

FlagDefaultDescription
--out-dir./servers/relayplaneOutput directory for generated TypeScript code
--max-daily-cost5.00Daily provider cost limit in USD
--max-single-call-cost0.50Maximum cost per single call in USD
--max-calls-per-hour100Rate limit for API calls

Config File

For persistent configuration, create ~/.relayplane/mcp-config.json:

1{
2 "codegenOutDir": "./servers/relayplane",
3 "maxDailyCostUsd": 5.00,
4 "maxSingleCallCostUsd": 0.50,
5 "maxCallsPerHour": 100,
6 "providers": {
7 "openai": { "apiKey": "${OPENAI_API_KEY}" },
8 "anthropic": { "apiKey": "${ANTHROPIC_API_KEY}" }
9 }
10}

Generated Code API

On startup, the MCP server generates TypeScript files your agent can import directly. This follows Anthropic's recommendation for agents to write code that orchestrates tools.

1npx @relayplane/mcp-server --out-dir ./src/lib/relayplane

Files generated:

  • index.ts — Main exports
  • run.ts — Single model calls
  • workflow.ts — Multi-step workflows
  • models.ts — Available models
  • skills.ts — Skill discovery

Agents can then import and use these directly:

1import { run, workflow, listModels } from './src/lib/relayplane'
2
3// Single model call
4const result = await run({
5 model: 'openai:gpt-4o',
6 prompt: 'Summarize this document...'
7})
8
9// Multi-step workflow
10const workflowResult = await workflow({
11 name: 'invoice-processor',
12 steps: [
13 { name: 'extract', model: 'openai:gpt-4o', prompt: '...' },
14 { name: 'validate', model: 'anthropic:claude-3-5-sonnet', depends: ['extract'], prompt: '...' }
15 ],
16 input: { fileUrl: 'https://...' }
17})

Verify Installation

Test that the server is working by listing available models:

1# In Claude Code, ask:
2"List all available RelayPlane models"
3
4# The agent should call relay_models_list and show you the available models

Next Steps