Docs menu

Reference

Connect an assistant (MCP)

Connect Claude, ChatGPT, Cursor, Codex, OpenCode or another assistant to Lundot over MCP with sign-in or a key, and see which tools it can use.

On this page 8 sections

Connect an assistant in Settings, Assistants. MCP is off unless the server sets MCP_ENABLED. An assistant connects to https://lundot.com/mcp over the Model Context Protocol, reads the sites and reports you let it reach and, if you allow it, changes goals.

You connect by signing in and approving in your browser, with no key to copy. A key is only for an assistant or script that cannot sign in.

When MCP is off, /mcp answers 404 with mcp_disabled. The server operator can also turn sign-in off alone: that stops every signed-in assistant at once, while keys keep working.

Connect an assistant

Open Settings, then Assistants, and choose your assistant.

  1. Add Lundot. Claude Code takes one command, in user scope so it works in every folder:

    claude mcp add --transport http --scope user lundot https://lundot.com/mcp
    

    Cursor and VS Code have Add to Cursor and Add to VS Code buttons. Codex takes codex mcp add lundot --url https://lundot.com/mcp. Claude Desktop, claude.ai and ChatGPT add Lundot as a connector with Copy server URL. On a server you run yourself, use its address in place of lundot.com. For OpenCode, add Lundot to ~/.config/opencode/opencode.json or the project's opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "mcp": {
        "lundot": { "type": "remote", "url": "https://lundot.com/mcp" }
      }
    }
    

    Then run opencode mcp auth lundot to sign in.

  2. Sign in. The assistant opens Lundot. Choose a workspace and its sites, and approve. The page shows the assistant's name marked Not verified, its return address and what it asks for. Create and change goals is offered only if you can change goals yourself and is off unless you turn it on.

  3. Check it works. Ask "Which Lundot workspace am I connected to?". It answers with the whoami tool, and Settings, Assistants shows the connection.

Only approve an assistant you started yourself: the name it shows is its own claim, hence Not verified.

To disconnect, use Disconnect under Connected apps in Settings, Assistants; owners and admins also see Disconnect all. Removing a member, or lowering their access, ends their connections too. After 30 days without use, a sign-in must be approved again.

Use a key instead

For an assistant that cannot sign in, open Use a key with an assistant below the list in Settings, API keys:

  1. Create key. Access is read only unless you choose more. See API keys.

  2. Keep it in your keychain. Copy the key once and store it with the command for your system. On macOS:

    security add-generic-password -a "$USER" -s lundot-api-key -w
    echo 'export LUNDOT_API_KEY="$(security find-generic-password -s lundot-api-key -w)"' >> ~/.zshrc
    

    The profile line holds the lookup, not the key. Never paste the key into a chat, a file or a link.

  3. Add Lundot with the key's name. Name only LUNDOT_API_KEY, so the key never lands in a configuration file. For Claude Code, in single quotes:

    claude mcp add --transport http --scope user lundot https://lundot.com/mcp \
      --header 'Authorization: Bearer ${LUNDOT_API_KEY}'
    

    Codex: codex mcp add lundot --url https://lundot.com/mcp --bearer-token-env-var LUNDOT_API_KEY. Cursor reads "Authorization": "Bearer ${env:LUNDOT_API_KEY}" in ~/.cursor/mcp.json. OpenCode reads "Authorization": "Bearer {env:LUNDOT_API_KEY}" in opencode.json, with "oauth": false to use the key. VS Code asks for the key once and keeps it in its secret storage.

ChatGPT connects with sign-in only.

If the assistant cannot connect

/mcp refuses with an HTTP status and a problem body: reason says what is wrong, detail what to do, and requestId (also in X-Request-Id) identifies the request. Every 401 points to sign-in in WWW-Authenticate.

Status reason What it means What to do
401 credential_missing Nothing was sent. Sign in from the assistant, or send a key as Authorization: Bearer followed by the key.
401 key_unknown Lundot does not accept what was sent. Sign in again, or create a new key.
401 key_expired The key expired (the body says when). Create a new key, or a replacement.
401 key_revoked The key was revoked, or it is the old secret of a rotation whose overlap ended. Use the new secret, or create a new key.
400 request_invalid The Authorization header is malformed. Send Authorization: Bearer followed by the key or token.
403 scope_missing The connection may not do this (the body names the access). Connect again and approve it, or give the key that access.
429 rate_limited Too many requests from this connection (the Retry-After header says how long to wait). Wait and try again. Connecting, listing tools and whoami have a much larger allowance of their own.

The expiry date, key label and last four appear only when what was sent matches a stored key. GET /healthz answers {"status":"ok"} while the server is up.

What a key can do

The assistant sees only the tools its scopes open, plus whoami. Every connection holds read; goals:write is chosen at sign-in, or for a key at creation or under Edit access. Other calls are refused with 403 and scope_missing.

Tool Scope What it does
list_sites read Lists the sites the key reaches.
get_overview read The site home numbers for a range.
get_traffic read Web analytics for a range.
compare_periods read Web totals for two ranges, with each change.
get_breakdown read One breakdown, such as pages or referrers.
get_top_pages read Pages joined to AI reads, search clicks and visits.
get_search read Search headline numbers and trend.
get_search_queries read The search queries (or pages) that brought clicks.
get_search_opportunities read Queries close to the top and pages losing clicks.
get_search_checks read Index and speed results for every checked page.
get_page_checks read Index and speed results for one page.
get_bing_search read Bing's clicks, impressions, queries and pages.
get_ai_bots read AI crawler and agent traffic.
get_goal_conversions read Every goal with its conversion rate.
get_findings read Up to three findings for the last whole week.
get_recommendations read The week's recommendations for store, AI or search.
list_annotations read The dated notes on the site's charts.
list_goals read The site's goals.
create_goal goals:write Adds a goal.
update_goal goals:write Changes a goal, overwriting what it had.
whoami any Says which workspace the connection reaches, as which key or app, and what it may do.

Compare, page and ask

  • Compare. get_overview, get_traffic, get_breakdown, get_top_pages, get_ai_bots and get_goal_conversions take compareFrom and compareTo: give both or neither. compare_periods compares with the same number of days just before when you give neither.
  • Page. get_breakdown and get_search_queries take limit and offset, and answer pagination.has_more when more rows follow. A breakdown pages through its top 500 rows.
  • Ask. The prompt What changed this week (what_changed_this_week) has the assistant review a site's last whole week. Assistants that support prompts offer it in their prompt list.

When a tool fails

A failed call is marked as an error. After the sentence comes the same failure as JSON, such as {"error":{"code":"rate_limited","message":"...","retryable":true,"retry_after_seconds":42}}. The codes are unauthorized, rate_limited, upstream_unavailable, invalid_query and internal. retryable says whether sending the same call again may work. Input that does not match a tool's schema is refused with a sentence only.

Every tool call is an API request with the same limits, including 300 requests a minute per key. See API errors and limits.

Text from visitors

Page paths and addresses, referrers, campaign tags, event names, search queries, goal names, findings, recommendations and chart notes hold text written by others. Lundot wraps them in BEGIN_UNTRUSTED_CONTENT and END_UNTRUSTED_CONTENT markers and tells the assistant they are data, never instructions.

What is recorded

Every change is recorded in the audit log under the key, or under the assistant for the member who connected it. Revoking the key or disconnecting stops it on its next request.

  • DocsAPI keys

    Create Lundot API keys for scripts, servers and assistants that cannot sign in: choose scopes, sites and expiry, then edit, rotate, replace or revoke a key.

  • DocsAPI reference

    The 47 requests an API key can make, each with its scope and parameters, a request you can run and the shape of the answer.