Skip to Content

Selflane MCP server

The Selflane MCP server gives AI tools ready-made answers about a business: sales compared with the period before, labor cost as a percent of sales, cash over and short, and what's 86'd right now. Use it when an AI model is the client. Use the REST API when your own code is.

The server lives at:

https://developer.selflane.com/mcp

MCP or the REST API

Both read the same data and use the same keys and scopes. They differ in what they hand back.

REST API (/v1)MCP server (/mcp)
ClientYour own codeAn AI model, through an MCP client
ReturnsRaw records: every order, payment, and timecardAnswers worked out on the server: totals, comparisons, rankings, and a short list of matches
MoneyInteger centsCurrency units (dollars), rounded to cents
ChangesNone. Every request is a GET.Can set a menu item's picture and send feedback to Selflane
Sign-inAPI keyAPI key, or the owner signs in from Claude, ChatGPT, Grok, or Cursor
PlanPOS plan or aboveEssential plan or above

If you're building a dashboard or syncing to an accounting system, use the REST API. If you want an assistant or agent to answer questions about the business, use MCP. It keeps the model from paging through thousands of raw records.

Who connects how

  • Owners using Claude, ChatGPT, Grok, or Cursor's agents at cursor.com/agents connect by signing in. They don't need a key or a developer. Send them to Connect an AI assistant.
  • Everyone else connects with an API key. That includes Claude Code, the Cursor editor and CLI, and your own agent. The rest of this page covers that path.

Sign-in works only for the assistants in the first group, because Selflane accepts sign-in only from their web addresses.

Get a key

Ask the owner for an API key, as in Getting started. For MCP:

  • The key needs Reports. Without it, the server refuses the key.
  • Each other scope adds tools. See Scopes and tools.
  • Each location on the key needs the Essential plan or above. The 30-day trial only starts when an owner connects by signing in, never from a key.

Connect

The server uses Streamable HTTP. Send the key as a bearer token in the Authorization header.

Claude Code

Add the server to .mcp.json in your project. Claude Code reads ${SELFLANE_API_KEY} from your environment when it starts, so the key stays out of the file:

{
  "mcpServers": {
    "selflane": {
      "type": "http",
      "url": "https://developer.selflane.com/mcp",
      "headers": {
        "Authorization": "Bearer ${SELFLANE_API_KEY}"
      }
    }
  }
}

You can also add it from the command line, for yourself only:

claude mcp add --transport http selflane https://developer.selflane.com/mcp \
  --header "Authorization: Bearer $SELFLANE_API_KEY"

Your shell fills in the key before Claude Code sees it, so the key itself is saved in your Claude Code settings. Don't add --scope project to this command: that writes the key into .mcp.json, which gets committed.

Cursor

Add the server to .cursor/mcp.json in your project, or ~/.cursor/mcp.json for every project:

{
  "mcpServers": {
    "selflane": {
      "url": "https://developer.selflane.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SELFLANE_API_KEY}"
      }
    }
  }
}

Other MCP clients

Any client that speaks Streamable HTTP and can send a header works. Point it at https://developer.selflane.com/mcp with Authorization: Bearer sl_live_….

The server supports MCP protocol versions 2025-11-25, 2025-06-18, and 2025-03-26. It has no sessions and doesn't stream: each POST carries one JSON-RPC message and gets one JSON response. Batches are refused.

The key reads everything its scopes cover. Keep it in an environment variable or secrets manager, not in a config file you commit.

Scopes and tools

tools/list shows only the tools the key's scopes allow. A key with every read scope sees every read tool.

ScopeTools
reports:readget_sales_summary, compare_locations, get_sales_today, get_staff_sales, send_feedback
timecards:readget_labor_summary
staff.pay:readAdds labor cost and labor as a percent of net sales to get_labor_summary
orders:readfind_orders, get_order
orders.customer:readAdds the customer's name and phone to get_order
payouts:readget_payouts
cash:readget_cash_summary
menu:readsearch_menu, get_menu_overview
menu:writerequest_dish_picture_upload

payments:read and staff:read add no tools. API keys can't carry menu:write, so changing menu pictures works only when an owner connects by signing in and turns on Change menu pictures.

See MCP tools for each tool's arguments and what it returns.

Changes the server can make

Every tool is marked read-only except two. MCP clients ask the user before calling these:

  • request_dish_picture_upload makes a single-use link that sets one menu item's picture. See Change a menu picture.
  • send_feedback sends what the tools couldn't answer to Selflane. It shows in the owner's Back Office Help list.

Errors

A tool the model called wrongly comes back as a normal result with isError: true and a message the model can act on. For example: a date range that's too long, a location outside the key, or a location below the Essential plan. The model usually fixes the call and tries again.

The connection itself fails over HTTP:

ResponseMeaning
401No key, or the key is invalid, revoked, or expired. See Authentication.
403 insufficient_scopeThe key lacks reports:read, or it called a real tool whose scope it doesn't have. Such a tool isn't in the key's tools/list. The WWW-Authenticate header names the missing scope.
400 unsupported_protocol_versionThe client asked for a protocol version the server doesn't support.
405A GET or DELETE. Only POST is supported.

A tool name the server doesn't have at all is JSON-RPC error -32602. An unknown method is -32601, and an unexpected failure is -32603.

On this page