three.ws Portfolio

v0.1.2
io.github.nirholas/portfolio-mcp Checked 2 hours ago Published 1 month ago

An agent's trading state — portfolio value, PnL, live balances, trade feed, and signed transfers.

Values you need

VariableWhat it is
THREE_WS_BASEoptional Base URL of the three.ws API that serves the portfolio + trades endpoints. Override only when self-hosting or targeting a preview deployment. Default: https://three.ws
THREE_WS_TIMEOUT_MSoptional Per-request timeout in milliseconds for the live three.ws API reads. Default: 20000
THREE_WS_SESSIONoptional secret Your three.ws session token (the value of the `__Host-sid` cookie from a signed-in browser). Required for the account-scoped reads — get_portfolio_summary, get_portfolio_history, get_portfolio_asset — which return data for the agents YOU own. The public trade feed and on-chain balance reads do n
SOLANA_RPC_URLoptional Solana mainnet RPC endpoint used by get_wallet_balances and send_transfer. Defaults to https://api.mainnet-beta.solana.com — bring your own (Helius / Quicknode / Triton) for production traffic. Default: https://api.mainnet-beta.solana.com
SOLANA_SECRET_KEYrequired secret Base58-encoded Solana secret key for the wallet that send_transfer signs from. REQUIRED for send_transfer (the only write tool); a per-call `secret` arg overrides it. Not needed for any read tool. Treat like cash.
MAX_SOL_PER_TXoptional Per-transaction spend cap in SOL for native SOL transfers via send_transfer. Bounds the blast radius of a leaked key or an injected argument. Default: 0.5
RECIPIENT_ALLOWLISToptional Optional comma-separated base58 pubkeys. When set, send_transfer refuses any recipient not in the list.
REQUIRE_CONFIRMoptional When on (default), send_transfer refuses until re-issued with confirm:true. Set 0/false to disable the gate. Default: true

npm (npx) verified

Requires Node.js 18+

Run in a terminal
claude mcp add portfolio-mcp -e 'SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY>' -- npx -y @three-ws/portfolio-mcp@0.1.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "portfolio-mcp": {
      "args": [
        "-y",
        "@three-ws/portfolio-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "SOLANA_SECRET_KEY": "<SOLANA_SECRET_KEY>"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "portfolio-mcp": {
      "args": [
        "-y",
        "@three-ws/portfolio-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "SOLANA_SECRET_KEY": "<SOLANA_SECRET_KEY>"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "SOLANA_SECRET_KEY",
      "id": "solana-secret-key",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "portfolio-mcp": {
      "args": [
        "-y",
        "@three-ws/portfolio-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "SOLANA_SECRET_KEY": "${input:solana-secret-key}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.portfolio-mcp]
command = "npx"
args = ["-y", "@three-ws/portfolio-mcp@0.1.2"]
env = { "SOLANA_SECRET_KEY" = "<SOLANA_SECRET_KEY>" }

For AI agents

  1. Ask the user for: SOLANA_SECRET_KEY. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: get_portfolio_summary, get_portfolio_history, get_portfolio_asset, get_trades_feed, get_wallet_balances, send_transfer.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json