AI assistants
Connect Claude or ChatGPT with MCP
Sansflow runs an MCP server, so an AI assistant can read one business's sales, tables, staff and stock and answer questions about them. You create a personal token, paste one URL into the assistant, and ask.
See what MCP can do for an owner, with example questions. This page is the setup.
What it is
- One URL per token:
https://pos.sansflow.com/api/mcp/<your-token>. The token sits in the path because Claude and ChatGPT connectors cannot send a header. - Acts as you: every tool runs with the rights of the person who created the token, inside the database. If that person leaves the business, the token stops working.
- Read-only by default: write tools exist only on tokens created with write access, and the server tells the assistant to confirm each write with you first.
- Guest data is opt-in: names, phone numbers and emails of guests come only from tokens with guest data access, which only an owner can grant.
Create a token
- Open AI tokens In Sansflow, open Developers → AI tokens (MCP) and create a token.
- Choose its reach Name it. Pick when it expires (never, 30 days, 90 days or a date). Limit it to some outlets, or leave it on all. Reading analytics is always on; tick Write operations or Guest data only if you need them.
- Copy the URL The token starts with
sfmcp_and is shown once, inside the full MCP URL. Treat the URL like a password.
You can revoke a token at any time from the same tab; the assistant loses access on its next call.
Connect Claude
- Add a custom connector In Claude, open Settings → Connectors → Add custom connector.
- Name and URL Name it Sansflow POS and paste your MCP URL as the server URL. Leave authentication empty: the token is in the URL.
- Turn it on in a chat Enable the connector in the chat composer and ask, for example, "What were yesterday's sales by payment method?"
Claude Desktop can also read it from claude_desktop_config.json:
{
"mcpServers": {
"sansflow": {
"type": "streamable-http",
"url": "https://pos.sansflow.com/api/mcp/<your-token>"
}
}
}Connect ChatGPT
- Turn on developer mode In ChatGPT, open Settings → Connectors → Advanced and enable developer mode.
- Add the server In a chat, choose + → Add sources → Connect more, and paste your MCP URL. No auth header: the token is in the URL.
- Use it Save, then attach the Sansflow connector to a new chat.
Other clients
{
"mcpServers": {
"sansflow": { "url": "https://pos.sansflow.com/api/mcp/<your-token>" }
}
}# ~/.codex/config.toml
[mcp_servers.sansflow]
type = "streamable-http"
url = "https://pos.sansflow.com/api/mcp/<your-token>"{
"mcpServers": {
"sansflow": { "serverUrl": "https://pos.sansflow.com/api/mcp/<your-token>" }
}
}Transport: MCP Streamable HTTP (POST, JSON; SSE is off)
Endpoint: https://pos.sansflow.com/api/mcp/<your-token>
Auth: the token is in the URL path; no Authorization header needed
Headers: Accept: application/json, text/event-stream
Content-Type: application/jsonTools
Dates are YYYY-MM-DD in the business's timezone, inclusive, at most 400 days apart. Money is whole rupiah: 45000 means Rp 45.000. List tools return at most 100 rows a call, newest first, with a next_cursor for the next page.
Read (every token)
list_locations | The outlets this token may read. |
get_sales_summary | Sales totals for a date range: gross, refunds, net, discounts, tax, fees, orders, average ticket. |
get_sales_trend | Sales per day, or per hour for ranges up to 7 days. |
get_sales_breakdown | Sales grouped by product, category, payment method, sale type, order source, cashier, outlet or customer. |
get_location_performance | Per-outlet sales, cost of goods, labour and expenses. |
get_table_analytics | Table turns, occupancy and revenue per table, zone, hour and server (up to 92 days). |
get_staff_labor | Hours worked and labour cost per employee. |
get_inventory_variance_summary | Theoretical against actual cost of goods, waste, staff meals and count coverage. |
get_kitchen_prep_stats | Kitchen preparation times (median, trimmed mean, p90) by station, product or daypart. |
list_orders · get_order | Orders, newest first, and one order in full with items and payments. |
list_reservations | Reservations by reserved time. |
list_open_bills | Bills open right now: table, party size, total, cashier. |
list_invoices | Invoices with status, totals, balance and due date. |
list_products | The catalogue: price, cost, category, stock, availability. |
list_shifts | Cashier shifts with opening and closing cash (cash figures need the right permission). |
list_staff | The staff roster: name, role, status, dates. No contact or HR data. |
list_refund_requests | Refund requests and their status. |
list_audit_log | Who did what, when. |
Guest data (tokens with guest data access)
list_customers · get_customer | Guests with contact details, loyalty points and tier; one guest with lifetime spend and recent orders. |
Write (tokens with write access, confirmed with you first)
create_ticket | Open an internal ticket for the team. |
post_platform_message | Send a bug report or feature request to the Sansflow team. |
approve_refund_request | Approve a pending refund request (needs the refund approval permission). |
Limits and errors
- 60 calls a minute per token; a write counts as two. Over it, the tool answers
rate_limitedwithretry_after_seconds. - A question that runs too long answers
timeout: ask again with a shorter range or one outlet. - Tool errors carry
structuredContent.error.reason, such asmissing_scope,location_requiredorforbidden.
| Connection error | JSON-RPC code | Meaning |
|---|---|---|
invalid | -32001 | The token is not recognised. |
revoked | -32003 | The token was revoked. |
expired | -32004 | The token passed its expiry date. |
not_a_member | -32006 | The person who created it left the business. |
payment_required | -32007 | The business's plan does not include AI integrations (HTTP 402). |
unavailable | -32603 | Sansflow could not be reached. Try again in a minute. |
Questions
Which AI assistants can connect to Sansflow?
Any client that speaks MCP over Streamable HTTP: Claude (web and desktop), ChatGPT with developer mode connectors, Cursor, Codex CLI, Windsurf and others. Each connects with the same token URL.
Can the assistant change anything in Sansflow?
Only if the token was created with write access. Then it can open a ticket, send feedback to Sansflow or approve a pending refund, it must confirm with you first, and it can never do more than the person who created the token.
Which plan do I need for MCP?
Connecting AI assistants via MCP is part of Sansflow Premium.
Stuck? Quote the request_id from the response and write toSansflow support.Checked against API v1 on .