Stonex
БесплатноНе проверенMCP server exposing StoneX Client REST API endpoints as tools, enabling account balances, positions, activity, and performance retrieval via natural language. R
Описание
MCP server exposing StoneX Client REST API endpoints as tools, enabling account balances, positions, activity, and performance retrieval via natural language. Requires a user-supplied access token or session cookie.
README
Typed TypeScript client for the StoneX Client (torchapi) REST API, plus an MCP server that exposes those endpoints as tools.
Auth is not automated (no Okta/MFA in this project). You log into StoneX Client in a browser, export a cookies.txt file, and pass the path to that file on the CLI.
Requirements
- Bun 1.1+ (for local development /
preparebuild) - Node.js 18+ (to run the published
binbundle)
Install
bun install
Auth: cookies.txt
- Install a browser extension that exports Netscape
cookies.txt(e.g. Get cookies.txt LOCALLY). - Log into https://client.stonex.com/client/.
- Export cookies for
client.stonex.comto a file (e.g.client.stonex.com_cookies.txt). - Pass that path to the server:
stonex-mcp --cookies /path/to/client.stonex.com_cookies.txt
The server reads session cookies from that file and calls GET https://client.stonex.com/client/token only when it needs a Bearer JWT.
Token cache
Derived access tokens are cached on disk so repeated MCP tool calls do not mint a new token every time:
| OS | Path |
|---|---|
| Windows | %LOCALAPPDATA%\stonex-mcp\access-token.json |
| macOS | ~/Library/Caches/stonex-mcp/access-token.json |
| Linux | ${XDG_CACHE_HOME:-~/.cache}/stonex-mcp/access-token.json |
When the cached JWT is missing or near expiry, a new token is requested using the cookies file and written back to the cache. If refresh starts failing with 401, re-export cookies after logging into StoneX Client again.
Treat the cookies file and cached token like passwords. Do not commit them.
Run the MCP server
bun start -- --cookies /path/to/client.stonex.com_cookies.txt
# or after build:
node dist/stonex-mcp.js --cookies /path/to/client.stonex.com_cookies.txt
Cursor / Claude Desktop config
{
"mcpServers": {
"stonex": {
"command": "npx",
"args": [
"-y",
"stonex-mcp",
"--cookies",
"C:/Users/YOU/Downloads/client.stonex.com_cookies.txt"
]
}
}
}
npx runs the built Node bundle (dist/stonex-mcp.js, produced by bun run build / prepare). Local equivalent: "command": "bun", "args": ["run", "/path/to/stonex-mcp/src/cli.ts", "--cookies", "/path/to/cookies.txt"].
Typed client
import { StoneXClient } from "./src/client/index.ts";
import { sessionCookieFromCookiesTxtFile } from "./src/auth/cookiesTxt.ts";
import { resolveAuth } from "./src/auth/resolveAuth.ts";
import { writeTokenCache } from "./src/auth/tokenCache.ts";
const { accessToken, sessionCookie } = await resolveAuth(
"/path/to/client.stonex.com_cookies.txt",
);
const client = new StoneXClient({
accessToken,
sessionCookie,
onAccessToken: (token) => writeTokenCache(token),
});
const accounts = await client.getAccounts();
const summary = await client.getAccountSummary({
accountNumber: accounts[0]!.acctNo,
});
Or build a cookie header yourself with sessionCookieFromCookiesTxtFile(...).
Endpoints mirror the StoneX Client SPA (https://vulcan.stonex.com/torchapi): accounts, balances, summary, positions, activity, performance, projected income, documents, and related user/account metadata.
Установить Stonex в Claude Desktop, Claude Code, Cursor
unyly install stonex-mcpСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add stonex-mcp -- npx -y stonex-mcpПошаговые гайды: как установить Stonex
FAQ
Stonex MCP бесплатный?
Да, Stonex MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Stonex?
Нет, Stonex работает без API-ключей и переменных окружения.
Stonex — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить Stonex в Claude Desktop, Claude Code или Cursor?
Открой Stonex на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare Stonex with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
