Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@truemarkets-mcp-serverCheck my USDC balance and get a quote to buy 5 SOL"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
truemarkets-mcp-server
MCP (Model Context Protocol) server for True Markets. Gives AI agents native trading capabilities without shelling out to bash.
Why this exists
The True Markets CLI (tm) works with agents through bash skills — the agent runs tm buy SOL 50 -o json --force and parses stdout. This works, but has fundamental problems:
Two-quote problem:
--dry-runand--forcefetch separate quotes. The agent decides based on quote A but executes at quote B's price.No slippage protection: No mechanism to reject execution if price moves.
Process overhead: Every command spawns a new process, re-reads credentials, re-establishes HTTP connections.
Fragile parsing: Agent must parse JSON from stdout mixed with stderr warnings.
The MCP server solves all of these:
Quote caching:
tm_get_quotereturns aquote_idcached for 60 seconds.tm_execute_tradeuses the same quote — no price surprise.Structured responses: Tools return typed JSON via MCP's
structuredContent, no stdout parsing.Persistent auth: Credentials loaded once on startup, tokens refreshed automatically.
Native tool calls: Agents call tools directly instead of composing bash strings.
Tools
Read-only
Tool | Description |
| Get token price in USDC (no API key needed) |
| Get token balances across chains |
| List available tokens |
| Get account email and wallet addresses |
Trading
Tool | Description | Destructive |
| Get a trade quote (cached 60s) | No |
| Execute a cached quote | Yes |
| Prepare outbound transfer | No |
| Execute a prepared transfer | Yes |
Agent workflow
1. tm_get_balances → check available funds
2. tm_get_quote(buy, SOL, 50) → inspect price, fee, issues
3. [agent decides: price acceptable? issues empty?]
4. tm_execute_trade(quote_id) → execute the SAME quoteCompare to the CLI flow where step 4 fetches a new quote silently.
Setup
Prerequisites
Node.js 18+
Existing True Markets account (
tm signup/tm loginvia the CLI)API key configured (
tm config set api_key <key>)
The MCP server reads credentials from ~/.config/truemarkets/ — the same location the CLI uses. No separate auth setup needed.
Install
npm install -g truemarkets-mcp-serverConfigure your agent
Claude Code / claude.ai
Add to your MCP config (.claude/mcp.json or via settings):
{
"mcpServers": {
"truemarkets": {
"command": "truemarkets-mcp-server",
"args": []
}
}
}Cursor
Add to .cursor/mcp.json:
{
"mcpServers": {
"truemarkets": {
"command": "npx",
"args": ["truemarkets-mcp-server"]
}
}
}Environment variables
Variable | Description |
| Override stored auth token |
| Override stored API key |
Development
git clone https://github.com/true-markets/mcp-server.git
cd mcp-server
npm install
npm run build
npm startTest with the MCP inspector:
npx @modelcontextprotocol/inspector node dist/index.jsArchitecture
src/
├── index.ts # Entry point, stdio transport
├── constants.ts # API host, paths, version
├── types.ts # Shared types and helpers
├── services/
│ ├── auth.ts # Token/key management (reads ~/.config/truemarkets/)
│ ├── api-client.ts # DeFi Gateway HTTP client
│ └── signer.ts # Turnkey P256 payload signing
└── tools/
├── read.ts # Read-only tools (price, balances, assets, profile)
└── trade.ts # Trading tools (quote, execute, transfer)License
MIT
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.