three.ws Portfolio — Claude Code MCP server: features and setup
Connects an agent to portfolio values, wallet balances and closed trades through MCP. It can also send tokens on Solana.
claude mcp add --env THREE_WS_BASE=<THREE_WS_BASE> --env THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> --env THREE_WS_SESSION=<THREE_WS_SESSION> --env SOLANA_RPC_URL=<SOLANA_RPC_URL> --env SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY> --transport stdio portfolio-mcp -- npx -y @three-ws/portfolio-mcpWhat three.ws Portfolio does
The server reads live information from three.ws and Solana RPC. It can return portfolio value and its history, token-level positions, a public feed of closed trades with realized PnL, and on-chain balances for Solana addresses. Account data requires a three.ws session; the trade feed and balance lookup do not.
send_transfer signs and broadcasts a real SOL or SPL token transfer on Solana mainnet. Supply a key through SOLANA_SECRET_KEY or the secret parameter, and set confirm: true to execute. Transfers cannot be reversed, so verify the recipient and amount before calling the tool. Node.js >= 20 is required.
What it helps with
- check current asset values across owned wallets
- review portfolio value over time
- find realized PnL for closed trades
- look up SOL and SPL balances for an address
- send SOL or an SPL token from a wallet
Example prompts for the agent
- Show my current portfolio value with a breakdown by wallet.
- Review my portfolio history for the last 30 days and find closed trades for this token.
- Prepare a 0.1 SOL transfer to this address, verify the recipient and amount, then ask me to confirm.
How to install three.ws Portfolio
Platform CLI
claude mcp add --env THREE_WS_BASE=<THREE_WS_BASE> --env THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> --env THREE_WS_SESSION=<THREE_WS_SESSION> --env SOLANA_RPC_URL=<SOLANA_RPC_URL> --env SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY> --transport stdio portfolio-mcp -- npx -y @three-ws/portfolio-mcpReplace <…> with your own values. 3 more environment variables are in the server README
Platform CLI
codex mcp add portfolio-mcp --env THREE_WS_BASE=<THREE_WS_BASE> --env THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> --env THREE_WS_SESSION=<THREE_WS_SESSION> --env SOLANA_RPC_URL=<SOLANA_RPC_URL> --env SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY> -- npx -y @three-ws/portfolio-mcpReplace <…> with your own values. 3 more environment variables are in the server README
Config file
{
"mcpServers": {
"portfolio-mcp": {
"command": "npx",
"args": [
"-y",
"@three-ws/portfolio-mcp"
],
"env": {
"THREE_WS_BASE": "<THREE_WS_BASE>",
"THREE_WS_TIMEOUT_MS": "<THREE_WS_TIMEOUT_MS>",
"THREE_WS_SESSION": "<THREE_WS_SESSION>",
"SOLANA_RPC_URL": "<SOLANA_RPC_URL>",
"SOLANA_SECRET_KEY": "<SOLANA_SECRET_KEY>"
}
}
}
}Replace <…> with your own values. 3 more environment variables are in the server README
Config file
{
"servers": {
"portfolio-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@three-ws/portfolio-mcp"
],
"env": {
"THREE_WS_BASE": "<THREE_WS_BASE>",
"THREE_WS_TIMEOUT_MS": "<THREE_WS_TIMEOUT_MS>",
"THREE_WS_SESSION": "<THREE_WS_SESSION>",
"SOLANA_RPC_URL": "<SOLANA_RPC_URL>",
"SOLANA_SECRET_KEY": "<SOLANA_SECRET_KEY>"
}
}
}
}Replace <…> with your own values. 3 more environment variables are in the server README
Platform CLI
gemini mcp add -e THREE_WS_BASE=<THREE_WS_BASE> -e THREE_WS_TIMEOUT_MS=<THREE_WS_TIMEOUT_MS> -e THREE_WS_SESSION=<THREE_WS_SESSION> -e SOLANA_RPC_URL=<SOLANA_RPC_URL> -e SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY> portfolio-mcp npx -y @three-ws/portfolio-mcpReplace <…> with your own values. 3 more environment variables are in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about three.ws Portfolio
How do I install three.ws Portfolio in Claude Code?
Run claude mcp add portfolio-mcp -e THREE_WS_SESSION=<THREE_WS_SESSION> -e SOLANA_SECRET_KEY=<SOLANA_SECRET_KEY> -- npx -y @three-ws/portfolio-mcp. The session enables account data, while the key is used for transfers.
What does three.ws Portfolio do?
It exposes portfolio values and history, token positions, closed trades, and Solana wallet balances to an agent over MCP. It can also sign and broadcast a Solana mainnet transfer.
Which data can I access without a three.ws session?
The public closed-trade feed and on-chain balances for Solana addresses work without a session. Portfolio data tied to your account requires THREE_WS_SESSION.