Connect an agent over MCP
Add LopeBase to Claude, Cursor, or any MCP client at one address. Sign in, pick a workspace, and read health, metrics, and search data.
LopeBase runs an MCP server at app.lopebase.com/api/mcp. Point Claude, Cursor, or any other MCP client at it and the agent can see how your products are doing, read your search and analytics data, and help set up new connections, all while it works in your code.
Connect an agent
Most agents, including Claude.ai, Claude Code, and Cursor, can sign in to a remote MCP server on their own. Add the address and they open a LopeBase page to approve it.
Using Claude? LopeBase is listed in Claude's connector directory. Find it there and connect in a couple of clicks, no address to copy.
-
Add the address
For Claude Code, run this in a terminal:
claude mcp add --transport http lopebase https://app.lopebase.com/api/mcpFor Claude.ai, Cursor, or another client with a remote MCP setting, add this as an HTTP server:
https://app.lopebase.com/api/mcp -
Approve the sign-in
The agent opens an "Allow access" page in your browser. Sign in if you are not already, and press Approve. Only a workspace admin can approve. If you belong to more than one workspace, LopeBase asks which one before it opens the approval; if you were partway through creating an account, it picks up this step once you finish.
-
Start working
The agent now has its own token for this workspace, good for 30 days. Ask it something like "what needs attention across my products" to try it.
Already run npx lopebase in a product's folder? It adds the MCP server to your agent and signs it in for you, no separate setup needed. See Set up from your terminal.
For agents that only take a token
Some agents cannot open a browser to sign in. For those, create an agent token instead.
-
Open Agent access
SettingsAgent access Open Agent access -
Name it, set how long it lasts, and what it can do
Give it a label like "Claude Code", an expiry of 1, 7, 30, or 90 days, and the scopes it needs (see below). Press Create agent access.
-
Copy the command or the token
LopeBase shows a ready-to-run command for Claude Code, and the raw token for anything else: add it as an HTTP MCP server with the header
Authorization: Bearer <token>. The token is shown once; copy it before you close the dialog.
Every call acts as the admin who created the token, and LopeBase checks again each time that they are still an admin of the workspace. If that person loses admin rights, the token stops working. Revoke a token from the same screen at any time.
What a token can do
A token carries one or more scopes, and only sees the tools its scopes allow.
| Scope | Lets the agent |
|---|---|
| Setup | Add products, connect sources and the adapter, run onboarding, write and submit content drafts. |
| Read | Read health, metrics, the weekly digest, and search and analytics data. Never changes anything. |
| Manage | Disconnect a source. The most sensitive scope; grant it only if the agent needs to remove connections. |
list_products works on any scope, since knowing what exists is harmless on its own.
What an agent can do
Setup tools act for you: adding a product, connecting a source, or handing you a step only you can do.
| Tool | What it does |
|---|---|
| list_products, get_product | List your products and what each has connected. |
| add_product | Add a product by name and site address. |
| connect_source | Connect an SEO, analytics, revenue, or uptime source to a product, tested live before it is saved. |
| connect_adapter | Connect the product's own LopeBase Adapter once it has been added. |
| detect_stack, get_onboarding_status | Work out what a project uses, and what to set up next for it. |
| get_setup_guide | The full setup guide for one product, including which services deserve an uptime check. |
| get_pageview_snippet, get_pageviews | Turn on LopeBase's own cookieless pageview counter, and confirm it is working. |
| get_content_profile, next_article_topic, submit_draft | Write an article in a product's voice and send it through the same checks and review as LopeBase's own drafts. |
| request_human_action, list_human_actions, resolve_human_action | Hand you a step it cannot do itself, like a sign-in or a payment, and track it until it is done. |
| disconnect_source | Remove a product's connection to a source. Needs the manage scope. |
Read tools only ever return numbers, never a stored key or personal data.
| Tool | What it does |
|---|---|
| get_health | What needs attention right now across every product: failing checks, missing connections, open handoffs. |
| list_metrics, query_metric | The same numbers your dashboards show, like MRR, pageviews, and signups, for one connection at a time. |
| get_digest | This week's numbers against last week, workspace-wide. |
| list_sources, read_source | Search Console, Bing, GA4, Plausible, PostHog, and Cloudflare Web Analytics data: queries, pages, traffic sources, and funnels, as totals, never visitor or customer records. |
An example setup
For an MCP client that takes raw JSON configuration (used by some clients instead of a sign-in flow):
{
"mcpServers": {
"lopebase": {
"url": "https://app.lopebase.com/api/mcp",
"headers": { "Authorization": "Bearer lb_agent_..." }
}
}
}
Replace the token with one from Agent access. Clients that support the OAuth sign-in flow do not need this; adding the bare URL is enough.
Where to go next
- Set up from your terminal wires up the MCP server, the CLI, and the adapter in one step.
- AI reviews and credits covers what an agent's content tools cost.
- Fix a connection that needs reconnecting if a source an agent connected stops working.
If something goes wrong
Something else? Contact us.
My agent can't find the approval page
Some terminals cannot open a browser automatically. Copy the link your agent prints and open it yourself, or run npx lopebase mcp, which forwards to the same server using your saved sign-in.
The agent says the token needs a scope it does not have
Create a new agent token with the scope the tool needs, from SettingsAgent access, and point the agent at that one instead.
A tool call fails with "Invalid or expired agent token"
The token was revoked, passed its expiry, or the admin who created it is no longer an admin of the workspace. Issue a new one from Agent access.
I approved the wrong workspace
Revoke that token from Agent access, then reconnect the agent and pick the right workspace when it asks.
Can my agent see stored connection keys?
No. No MCP tool returns a stored secret, including the ones that connect a new source. The agent sends the value in; it never reads one back out.