Build a Poker Bot or AI Agent With a Solver API & MCP
Wire your own poker app, custom bot, or LLM poker agent to sub-second GTO strategies using the AnonGTO Python SDK, TypeScript SDK, or MCP server.
Building a poker product used to mean spending a year writing a C++ or Rust CFR engine before you ever shipped a UI, bot, or study workflow. Today you can separate the two problems cleanly: we provide the sub-second GTO solver data; you build the product.
Whether you are wiring a custom study bot, a Discord/Telegram hand-review assistant, an automated sparring partner, or an LLM poker agent via MCP, the integration takes minutes instead of months.
Three ways to connect your code
- HTTP JSON API (
POST https://api.anongto.com/v1/solve) — Works from any language, described by a standard OpenAPI 3.1 spec. - Python & TypeScript SDKs — Typed clients with retries, batch helpers, and webhook signature verification.
- MCP Server — Exposes
solve_chart_spot,solve_spot, andlist_chartsas native tools so Claude, Cursor, or your own LLM agent can query equilibrium strategies directly instead of hallucinating poker math.
Example 1: A custom decision engine in Python
Suppose your app or study bot tracks a hand state and needs the equilibrium action mix and EV for the current decision. One call returns every action’s frequency and EV:
import random
from anongto import Client
client = Client() # reads ANONGTO_API_KEY
def pick_gto_action(spot: dict, hero_combo: str) -> dict:
res = client.solve({**spot, "detail": "combos"})
hand = res["hands"].get(hero_combo)
if not hand:
return {"action": "fold", "ev_bb": 0.0, "mix": {}}
mix = hand["strategy"] # e.g. {"check": 0.34, "bet 1.82": 0.66}
actions = list(mix.keys())
weights = list(mix.values())
chosen = random.choices(actions, weights=weights, k=1)[0]
return {
"action": chosen,
"ev_bb": hand["ev_bb"],
"mix": mix,
"accuracy_pct_pot": res["accuracy_pct_pot"],
}
Because detail: "combos" returns every combo in the acting player’s range, you can cache the response by spot key and reuse it across multiple simulations, quizzes, or users without paying for another solve.
Example 2: TypeScript backend for a web app or Discord bot
const res = await fetch("https://api.anongto.com/v1/solve", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.ANONGTO_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
mode: "ranges",
board: ["Ks", "9d", "4c"],
pot_bb: 6.5,
players: [
{ seat: "BB", stack_bb: 96.75, range: { text: "22-99, A2s-A9s, K2s+, Q7s+, J8s+, T8s+, 98s, A7o-AJo, K9o-KQo" } },
{ seat: "BTN", stack_bb: 96.75, range: { text: "22+, A2s+, K2s+, Q4s+, J6s+, T6s+, 96s+, 86s+, 75s+, A2o+, K8o+, Q9o+" } },
],
actions: [{ type: "check" }],
detail: "summary",
}),
});
const data = await res.json();
console.log(data.actions); // [{ label: "check", freq: ..., ev_bb: ... }, ...]
Example 3: Giving an AI agent a real poker solver with MCP
LLMs are great at explaining poker concepts and parsing natural-language hand descriptions (“BTN opens 2.5bb, BB calls, flop is Jh 9s 4d, BB checks — what should BTN do with AJo?”), but they are notoriously bad at computing actual Nash frequencies.
By attaching the AnonGTO MCP server to your agent, the LLM parses the user’s natural language, invokes the solver tool with structured parameters, and writes an accurate, grounded explanation backed by real equilibrium numbers and EVs.
- No fragile regex parsers for community bots
- Real
accuracy_pct_potnumbers attached to every coaching response - Works out of the box with Claude Desktop, Cursor, and custom MCP agent loops
Rules and best practices for production apps
- Keep your API key server-side. Never ship your key in client-side JavaScript or a mobile bundle; proxy calls through your backend and rate-limit per user.
- Cache aggressively by canonical spot. Common spots (like BTN vs BB on dry high-card flops) repeat constantly across users—caching cuts API usage by 5–10×.
- Respect acceptable use. The API is built for study tools, trainers, hand analyzers, coaching apps, research, and bots/agents operating within the API Terms.
Want to test a payload before writing code? Try the Interactive Playground or browse our Integration Guides.
Try it with a free API key
100 solves a day, every endpoint, no card required. Wire the solver into your poker app, trainer, or bot in minutes.