Connect an AI agent (MCP)
Connect an AI agent to Leadee by adding the hosted MCP URL https://leadee.ai/mcp and signing in with OAuth in your browser, or by sending an API key. This page covers install steps per agent, what each plan includes, how credits and approvals work, and how to fix common errors.
Updated
Two ways to connect
Leadee's MCP server lets an AI agent (Claude, ChatGPT, Codex, Gemini CLI, Cursor, VS Code and others) read your AI-visibility reports, check pages and draft fixes in your Leadee workspace. MCP (Model Context Protocol) is the open standard these agents use to call outside tools.
- Hosted (recommended): add the URL
https://leadee.ai/mcpto your agent. Nothing to install and no key to copy: the first time, the agent opens your browser and you sign in to Leadee. - Local package:
leadee-mcpon PyPI and the official MCP Registry, started withuvx leadee-mcpand an API key. Use it for CI, servers and agents that cannot sign in through a browser.
Both give your agent the same Leadee tools and count against the same plan allowance.
Hosted URL and OAuth sign-in
Every agent uses the same address: https://leadee.ai/mcp (streamable HTTP). When an agent calls it without credentials, Leadee answers 401 with a WWW-Authenticate header that points to its OAuth metadata, and the agent starts the sign-in by itself.
- Discovery:
https://leadee.ai/.well-known/oauth-protected-resource(also/.well-known/oauth-protected-resource/mcp) andhttps://leadee.ai/.well-known/oauth-authorization-server. - Flow: OAuth 2.1 authorization code with PKCE (
S256only) and dynamic client registration. Your agent handles this; you only see the Leadee consent page. - Consent: you choose the workspace and, if you like, one project the connection is limited to. The page shows what the agent may do: read your reports, and act with your approval.
- Disconnect: the connection appears under Settings > Your AI agent as an "AI app (OAuth)" token. Revoke it there and the agent loses access at once.
API key instead of OAuth
If your agent has no OAuth support, or runs without a browser, create an API key in Leadee under Settings > Your AI agent and send it with every request to https://leadee.ai/mcp, in either header:
X-Leadee-Key: <your-leadee-api-key>
Authorization: Bearer <your-leadee-api-key>You see a key once, when it is created, so store it in your agent's secret settings. A key can be limited to one project. Never put a key in a browser bundle or a public repository; see Authentication.
Install in your agent
The commands below follow each app's own documentation as of 30 November 2026. If your app version shows a different menu, look for "add a remote MCP server" and use the hosted URL.
| Agent | How to add Leadee | How to sign in |
|---|---|---|
| Claude Code | claude mcp add --transport http leadee https://leadee.ai/mcp | Run /mcp, choose Leadee, then Authenticate |
| Claude.ai and Claude Desktop | Settings > Connectors > Add custom connector, URL https://leadee.ai/mcp | OAuth in the browser |
| OpenAI Codex CLI | codex mcp add leadee --url https://leadee.ai/mcp | codex mcp login leadee |
| ChatGPT | Settings > Connectors (developer mode) > Create, URL https://leadee.ai/mcp | OAuth in the browser |
| Gemini CLI | gemini mcp add --transport http leadee https://leadee.ai/mcp | /mcp auth leadee |
| Cursor | In ~/.cursor/mcp.json: {"mcpServers":{"leadee":{"url":"https://leadee.ai/mcp"}}} | OAuth, detected by Cursor |
| VS Code with GitHub Copilot | code --add-mcp '{"name":"leadee","type":"http","url":"https://leadee.ai/mcp"}' | OAuth in the browser |
| Windsurf, Cline, Zed, Goose and others | The app's remote MCP server setting with the hosted URL | OAuth, or an API key header |
| CI jobs, servers, cron | The local package below, or the hosted URL with an X-Leadee-Key header | API key |
Local package (uvx leadee-mcp)
uvx comes with uv. Without uv, run pip install leadee-mcp and use leadee-mcp as the command with no arguments.
Claude Code:
claude mcp add leadee -e LEADEE_API_KEY=<your-leadee-api-key> -- uvx leadee-mcpClaude Desktop (claude_desktop_config.json) and Cursor (.cursor/mcp.json or ~/.cursor/mcp.json) use the same block. Restart the app after you save it:
{
"mcpServers": {
"leadee": {
"command": "uvx",
"args": ["leadee-mcp"],
"env": { "LEADEE_API_KEY": "<your-leadee-api-key>" }
}
}
}Without LEADEE_API_KEY the package still runs the free public checks, such as free_scan, check_entity, validate_schema and estimate_plan.
Plans, the Free tier and credits
Each tool call counts toward your plan's monthly API and MCP call allowance. The numbers below come from Leadee's live plan catalogue; Pricing always shows the current ones.
| Plan | API and MCP calls a month | URL scans a month | Projects |
|---|---|---|---|
| Free | Not included yet | 3 | 1 |
| Starter | Not included yet | 30 | 1 |
| Growth | 2,000 | 150 | 3 |
| Pro | 10,000 | 600 | 10 |
| Agency | 25,000 | 2,000 | Unlimited |
MCP access for the Free and Starter plans is rolling out. Where the table says "Not included yet", an agent call on that plan returns plan_required today, and the table updates when the plan catalogue changes.
Work that costs Leadee real money is paid in credits from your workspace wallet, on top of the plan allowance. Some of today's prices:
| Work | Credits |
|---|---|
| URL scan beyond your plan's monthly scans | 10 |
| Site audit | 5 |
| Content audit, per page | 2 |
| Fix ticket | 20 |
| Content draft | 60 |
Your agent can read the full list with get_credit_price_list and price a job before running it with quote_credits. A Free workspace can buy a credit top-up without buying a plan; see Pricing.
When credits run out: payment_required
An agent never pays on its own: buying credits is always sent to a person for approval. Today, when the wallet is too low for a costly tool, the call stops with insufficient_credits, and a call over the plan's allowance returns plan_required. Your agent should tell you which one it hit.
Leadee is moving these stops to a payment_required result. It is a normal tool result, not an error, that the agent reads back to you:
{
"status": "payment_required",
"reason": "insufficient_credits",
"task": "Scan 40 URLs of shop.example.com",
"needed_credits": 400,
"balance_credits": 120,
"options": [
{"kind": "topup", "label": "Credit top-up", "pay_url": "https://leadee.ai/pay/..."},
{"kind": "upgrade", "label": "Upgrade your plan", "pay_url": "https://leadee.ai/pay/..."},
{"kind": "reduce", "label": "Scan the URLs your plan still covers"}
],
"say_to_user": "I need 400 credits to scan all 40 pages; you have 120."
}reasonsays why: not enough credits, a plan limit, or the monthly credit budget you set for this agent.pay_urlopens a payment page for this order in your workspace. There is always a reduce option, so nobody is forced to pay.- The stopped job keeps its place and continues by itself after payment.
Approvals
Your agent can read and draft freely, but anything that changes your live site, spends money, sends something outside Leadee or cannot be undone waits for a person. Examples: publishing an article, archiving a project, creating a new API key, buying credits.
For these tools the agent gets a pending_approval result with an approval_id and an approve_url. Approve or reject it in Leadee's approval inbox; the agent checks the decision with get_approval. There is no tool that lets an agent approve its own request. An agent can also suggest a change for you to review with propose_change.
Read order: call get_context first
In a new conversation, the agent should call get_context before anything else. It returns:
- who is calling and which workspace the connection belongs to,
- the connection's access (read, write, actions) and the one project it is limited to, if any,
- the wallet balance and the API rate limit,
- how many approvals are waiting in the inbox.
Most tools then need a project argument (a project id or slug) unless the connection is limited to one project. list_projects shows which projects the agent can use.
Troubleshooting
| What you see | What to do |
|---|---|
401 and the agent does not open a browser | The app has no OAuth support. Use an API key in the X-Leadee-Key header, or the local package. |
plan_required | Your plan does not include this tool or API and MCP calls yet. Check Pricing or ask the workspace owner to upgrade. |
insufficient_credits or payment_required | The wallet is too low for this job. Top up, or ask the agent for a smaller job. |
project_forbidden or a project is missing | The connection is limited to another project. Reconnect and pick the right project, or call list_projects. |
pending_approval | The action waits for a person. Open the approve_url or the approval inbox in Leadee. |
| Tools disappeared after it worked before | The token was revoked or expired. Sign in again, or create a new key under Settings > Your AI agent. |
Local package: uvx: command not found | Install uv, or use pip install leadee-mcp and the leadee-mcp command. |
Related
- Authentication for API keys and how they are counted.
- API reference for the REST endpoints behind the MCP tools.
- Getting started for your first API call.
Connect an AI agent (MCP) questions
Do I need to install anything to use the Leadee MCP server?
No. Add https://leadee.ai/mcp to your agent and sign in through the browser. The local leadee-mcp package is only for CI jobs, servers and agents that cannot sign in through a browser.
Can my AI agent spend credits or change my site without asking?
No. Buying credits, publishing, archiving a project and creating API keys always wait in the Leadee approval inbox for a person, and no tool lets an agent approve its own request.
Which tool should an agent call first?
get_context. It returns the workspace, the access the connection has, the project it is limited to, the wallet balance and how many approvals are waiting, so the agent knows which project ids it can use.
Can GEO guarantee results?
No. AI answer engines change their output frequently, and no vendor — including Leadee — can guarantee a ranking or a mention. Leadee publishes confidence intervals on every metric so you can see how much a result can vary run to run.
How does Leadee measure AI visibility?
Leadee runs your prompt set against each AI engine on a weekly to daily schedule, depending on plan, through official vendor APIs (OpenAI, Gemini, Perplexity, Anthropic, DataForSEO) — never by scraping consumer chat interfaces — and reports mention rate, citation rate, average position, share of voice and sentiment with a 95% confidence interval.
Who do I talk to?
Email support@leadee.ai or use Talk to an expert at https://leadee.ai/contact-sales — the Netbase JSC team behind Leadee replies by email or WhatsApp — or WhatsApp the CEO directly at https://wa.me/84937869689.