MCP Setup — AI Assistant Tools (Claude Desktop, Cursor)
ThetaPrime can expose read-only tools to an MCP-capable AI assistant, so you can ask things like "what's my BankNifty strangle's P&L right now" or "is today's reconciliation clean" without opening the dashboard.
This is local and read-only. The assistant spawns mcp_server.py on your
own machine; it talks to your already-running ThetaPrime over localhost only
— nothing is exposed to the internet, and no strategy can be armed, disarmed,
or closed through it.
Requirements
-
ThetaPrime must be running — the tools read from it live, they don't work standalone.
-
A separate Python install to run
mcp_server.pyunder, with themcpandrequestspackages — ThetaPrime's own bundled runtime isn't a general-purpose interpreter and can't run other scripts. Any recent Python 3 from python.org works; this is unrelated to and doesn't affect your ThetaPrime install.
powershell
pip install mcp requests
- Your dashboard password (Settings → the same one you log in with).
Configure Claude Desktop
mcp_server.py ships in your install directory alongside app.exe (default
C:\Program Files\ThetaPrime\mcp_server.py — check your Start Menu shortcut's
target if you installed elsewhere).
Edit claude_desktop_config.json at %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"thetaprime": {
"command": "C:\\Users\\you\\AppData\\Local\\Programs\\Python\\Python312\\python.exe",
"args": ["C:\\Program Files\\ThetaPrime\\mcp_server.py"],
"env": {
"THETAPRIME_URL": "http://localhost:5000",
"THETAPRIME_MCP_PASSWORD": "your-dashboard-password"
}
}
}
}
Not sure which python.exe you have? Run (Get-Command python).Source in
PowerShell (after installing Python, if you haven't already).
Restart Claude Desktop after saving.
Tools
| Tool | Answers |
|---|---|
list_strategies |
Which strategies exist, enabled/mode/armed for each |
get_strategy_status(strategy) |
Armed/disarmed and paper/real for one strategy |
get_positions |
Open legs, entry prices, mode for every open position |
get_pnl(strategy?, from_date?, to_date?) |
P&L summary, optionally scoped |
get_reconciliation_status |
Last orphan-position check result |
get_recent_logs(n?) |
Recent App Event Log entries |
Not included
No write tools — arming, disarming, or closing a position always goes through the dashboard. There's no raw order-placement tool either way; ThetaPrime's unit is a configured strategy, not a manual order.