Docs: Getting Started Menu

Run your own CSPR.trade MCP server using the npm packages. This is for developers who want a private instance, need testnet access, or want to customize the setup.

Just want to connect? Use the public endpoint — no setup needed. See the Getting Started guide.

The hosted mcp.cspr.trade deployment keeps file-based deploy input off. Remote callers should pass inline JSON to submit_transaction; the service will not read deploy files from the host filesystem.

Packages

Package Description
@make-software/cspr-trade-mcp MCP server — exposes 24 public tools over stdio or HTTP
@make-software/cspr-trade-mcp-sdk TypeScript SDK — market data, price history, quotes, analysis, and transaction building

Quick Start (stdio)

The simplest way to run your own instance — connects directly to your MCP client via stdio:

npm install @make-software/cspr-trade-mcp

Add to .claude.json:

{
  "mcpServers": {
    "cspr-trade": {
      "command": "npx",
      "args": ["@make-software/cspr-trade-mcp"],
      "env": { "CSPR_TRADE_NETWORK": "testnet" }
    }
  }
}

HTTP Server

For remote agents or shared deployments, run as an HTTP server:

CSPR_TRADE_NETWORK=mainnet CSPR_TRADE_TRANSPORT=http CSPR_TRADE_PORT=3001   npx @make-software/cspr-trade-mcp

Point any MCP client at http://your-host:3001/mcp.

Health check: http://your-host:3001/health

Local file-path workflow (optional)

By default, both the main MCP server and --signer mode expect inline JSON for deploys and signed transactions.

Set CSPR_TRADE_ENABLE_FILE_DEPLOY_INPUT=true only for local installs that intentionally want the temp-file workflow:

  • build tools write unsigned deploys to local temp files and return those paths
  • sign_deploy can read an unsigned deploy from one of those local paths
  • submit_transaction can read a signed deploy from one of those local paths

Example stdio config with the file-path workflow enabled locally:

{
  "mcpServers": {
    "cspr-trade": {
      "command": "npx",
      "args": ["@make-software/cspr-trade-mcp"],
      "env": {
        "CSPR_TRADE_NETWORK": "testnet",
        "CSPR_TRADE_ENABLE_FILE_DEPLOY_INPUT": "true"
      }
    },
    "cspr-signer": {
      "command": "npx",
      "args": ["@make-software/cspr-trade-mcp", "--signer"],
      "env": {
        "CSPR_TRADE_KEY_PATH": "~/.casper/secret_key.pem",
        "CSPR_TRADE_ENABLE_FILE_DEPLOY_INPUT": "true"
      }
    }
  }
}

Leave the flag unset for hosted or shared HTTP deployments unless every caller is expected to reference files on that same machine.

Local Signer Mode

A separate, local-only MCP instance that signs deploys without exposing private keys to the network or the LLM.

{
  "mcpServers": {
    "cspr-trade": {
      "url": "https://mcp.cspr.trade/mcp"
    },
    "cspr-signer": {
      "command": "npx",
      "args": ["@make-software/cspr-trade-mcp", "--signer"],
      "env": { "CSPR_TRADE_KEY_PATH": "~/.casper/secret_key.pem" }
    }
  }
}

Agent flow: build_swap (remote) → sign_deploy (local) → submit_transaction (remote). Private key never leaves your machine.

Tool counts by setup

  • Main server only: 24 public tools
  • Main server + signer: 23 total tools

Key Sources

Source Env Variable Description
pem_file CSPR_TRADE_KEY_PATH Path to PEM private key file
pem_env CSPR_TRADE_KEY_PEM PEM key content (inline)
mnemonic CSPR_TRADE_MNEMONIC BIP-39 phrase, derives via BIP-44 m/44'/506'/0'/0/{index}

Supports Ed25519 and Secp256k1 key algorithms.

Environment Variables

Server

Variable Default Description
CSPR_TRADE_NETWORK mainnet mainnet or testnet
CSPR_TRADE_API_URL (from config) Override API endpoint
CSPR_TRADE_TRANSPORT stdio stdio or http
CSPR_TRADE_HOST 0.0.0.0 HTTP listen host
CSPR_TRADE_PORT 3000 HTTP listen port
CSPR_TRADE_ALLOWED_HOSTS unset Optional comma-separated allowed hostnames for HTTP transport
CSPR_TRADE_RATE_LIMIT_WINDOW_MS 60000 HTTP rate-limit window
CSPR_TRADE_RATE_LIMIT_MAX 60 Max requests per rate-limit window
CSPR_TRADE_ENABLE_FILE_DEPLOY_INPUT false Enable local temp-file deploy workflow for build/sign/submit tools

Signer

Variable Description
CSPR_TRADE_KEY_PATH Path to PEM private key file
CSPR_TRADE_KEY_PEM PEM key content (inline)
CSPR_TRADE_MNEMONIC BIP-39 mnemonic phrase

Production Deployment

The repo includes deployment configs:

  • deploy/systemd/cspr-trade-mcp.service — systemd unit file
  • deploy/nginx/mcp.cspr.trade.conf — nginx reverse proxy config

Example with nginx + TLS

# Build
git clone https://github.com/make-software/cspr-trade-mcp.git
cd cspr-trade-mcp
npm install && npm run build

# Start the service
CSPR_TRADE_NETWORK=mainnet CSPR_TRADE_TRANSPORT=http   CSPR_TRADE_HOST=127.0.0.1 CSPR_TRADE_PORT=3010   node packages/mcp/dist/index.js

Put nginx in front with TLS (see deploy/nginx/mcp.cspr.trade.conf for a template).

Using the SDK Directly

For programmatic use without MCP:

npm install @make-software/cspr-trade-mcp-sdk
import { CsprTradeClient } from '@make-software/cspr-trade-mcp-sdk';

const client = new CsprTradeClient({ network: 'mainnet' });

// Get a swap quote
const quote = await client.getQuote({
  tokenIn: 'CSPR',
  tokenOut: 'USDT',
  amount: '1000',
  type: 'exact_in',
});
console.log(`${quote.amountInFormatted} CSPR → ${quote.amountOutFormatted} USDT`);
console.log(`Price impact: ${quote.priceImpact}%`);

Full SDK API reference: SDK docs