MCP server
@lokrix/mcp-server exposes the same GEO engine as Model Context Protocol tools — 200+ of them — so an agent can list projects, start a scan, read calibrated scores, and simulate optimization moves. It ships the lokrix-mcp CLI with two transports.
Two transports
- stdio (the default) runs
lokrix-mcpas a subprocess of an MCP client such as Claude Desktop — best for a single local agent. - Streamable HTTP (
--httporMCP_HTTP_PORT) exposes the same tools over HTTP at/mcp— best for shared or remote agents.
Both read LOKRIX_API_URL and LOKRIX_API_KEY from the environment. The key’s scopes bound what the agent can do — exactly as they bound the REST API.
Connect an agent
Point any MCP client at the package over stdio:
{
"mcpServers": {
"lokrix": {
"command": "npx",
"args": ["-y", "@lokrix/mcp-server"],
"env": {
"LOKRIX_API_KEY": "sk_live_...",
"LOKRIX_API_URL": "https://api.lokrix.de"
}
}
}
}Or run the HTTP transport for shared agents:
MCP_HTTP_PORT=3001 npx @lokrix/mcp-server --http
# → POST MCP requests to http://host:3001/mcpTool domains
Tools are grouped by resource — the same shape as the REST resources:
- Projects — lokrix.list_projects · lokrix.create_project · lokrix.get_project · lokrix.update_project · lokrix.delete_project
- Scans & engine-runs — lokrix.analyze_url · lokrix.start_scan · lokrix.get_scan · lokrix.list_scans · lokrix.cancel_scan · lokrix.estimate_scan_cost · lokrix.get_scan_advice
- Scores & analytics — lokrix.score_prompt · lokrix.get_visibility · lokrix.get_history · lokrix.get_engine_breakdown · lokrix.get_analytics_overview
- Prompts — lokrix.get_prompt_set · lokrix.generate_prompts · lokrix.activate_prompt_set · lokrix.lock_prompt_set · lokrix.add_prompt · lokrix.add_prompts_bulk
- Recommendations & optimize — lokrix.list_recommendations · lokrix.generate_recommendations · lokrix.get_optimization_plan · lokrix.simulate_change
- Competitors — lokrix.list_competitors · lokrix.compare_competitors · lokrix.compare_head_to_head · lokrix.get_competitor_trends
- Reports — lokrix.create_report · lokrix.list_reports · lokrix.get_report · lokrix.share_report
- Goals · alerts · schedules — lokrix.list_goals · lokrix.create_goal · lokrix.list_alerts · lokrix.create_alert · lokrix.get_schedule · lokrix.set_schedule
- Integrations · billing · usage — lokrix.list_integrations · lokrix.get_usage · lokrix.get_subscription · lokrix.get_credit_balance · lokrix.list_api_keys · lokrix.list_webhooks
Tool metadata keeps agents safe
Every tool declares a scope, readOnly, destructive, and provenance, so a client can gate destructive or credit-spending calls behind confirmation. A typical read-only flow — lokrix.list_projects → lokrix.get_visibility — spends nothing.
Which tools spend credits
Only live engine runs (lokrix.start_scan / lokrix.analyze_url against real engines) meter credits. Predictive tools — lokrix.simulate_change and lokrix.get_optimization_plan — run on the calibrated model and cost 0 credits. Use lokrix.estimate_scan_cost to preview a run against your credit balance first.