MODEL CONTEXT PROTOCOL
MCP Server & AI Agent Integration
Owlly ships with a built-in Model Context Protocol (MCP) server so AI coding and writing agents—Claude Code, Cursor, Antigravity, and Claude Desktop—can query live AI visibility metrics, inspect citations and brand facts, diagnose pages, and save drafts directly back to Owlly.
Supported Transports
Owlly implements MCP protocol versions 2025-06-18, 2025-03-26, and 2024-11-05 over two transports:
- Streamable HTTP (
POST https://app.getowlly.jp/api/mcp) — Recommended for Claude Code, Cursor, and Antigravity. Authenticates using workspace-scopedAuthorization: Bearer owlly_sk_...headers. - Local Stdio Bridge (
owlly mcp --url https://app.getowlly.jp) — For stdio-only clients such as Claude Desktop. Reads newline-delimited JSON-RPC fromstdin, forwards requests toPOST /api/mcpusingOWLLY_API_KEY, and writes diagnostics exclusively tostderr.
Creating & Managing Workspace Tokens
While browser and REST endpoints use owlly_session cookies, POST /api/mcp uses workspace-scoped Bearer tokens managed by workspace owners and admins.
- Open API & MCP Settings — Navigate to https://app.getowlly.jp/app#mcp (or Settings → API & MCP).
- Choose Scopes & Expiration — Every token requires
read; optionally grantwriteor opt-incollect, and set expiration from0(never) to365days. - Configure Project Access Scope — Restrict the token to specific selected projects or allow access across all projects in the workspace.
- Copy Secret Once — Tokens follow the format
owlly_sk_plus 48 hex characters. Owlly stores only the 15-character display prefix and SHA-256 hash; the full secret is returned only at creation. - Pause, Resume, Revoke & Audit — Pause/resume tokens (
PATCH /api/workspace/tokens/{id}), revoke compromised tokens immediately (DELETE), and inspect MCP Access Logs (MCPアクセス履歴/GET /api/workspace/mcp-logs).
Client Configuration Snippets
Replace <OWLLY_TOKEN> with your owlly_sk_... workspace token.
{
"mcpServers": {
"owlly": {
"type": "http",
"url": "https://app.getowlly.jp/api/mcp",
"headers": {
"Authorization": "Bearer <OWLLY_TOKEN>"
}
}
}
}
claude mcp add --transport http owlly "https://app.getowlly.jp/api/mcp" \
--header "Authorization: Bearer <OWLLY_TOKEN>"
{
"mcpServers": {
"owlly": {
"command": "owlly",
"args": ["mcp", "--url", "https://app.getowlly.jp"],
"env": {
"OWLLY_API_KEY": "<OWLLY_TOKEN>"
}
}
}
}
Plan Entitlements, Dynamic Clamping & Safety Guardrails
Every request to POST /api/mcp re-evaluates the token against current database subscription state and creator membership role.
- Plan Clamping (
plan_clamped) — Downgrading to Starter or expiring a trial automatically clamps existing tokenwriteandcollectscopes down toread. - Role Clamping (
role_clamped) — Demoting the token creator toviewerclamps effective scopes toread. Revoked/expired tokens or removed/unverified creators fail with401 unauthorized. - Human-in-the-Loop Safety —
owlly_save_page_draftalways saves withstatus="draft"andreviewed=false; marking content ready or publishing remains a human review step. Prompts added viaowlly_manage_prompts_and_factsalways start paused (enabled=false) to prevent unreviewed scheduled spend. - SSRF & Auditability —
owlly_diagnose_htmlrestricts public fetches to standard ports, rejects private/reserved IPs at dial time and on redirects, and caps HTML at 2 MiB. Allwriteandcollectcalls log audit events as<creator_email> (mcp:<token_prefix>)with actionmcp.<tool_name>.
| Scope | Trial & Starter | Growth & Agency | Self-hosted |
|---|---|---|---|
| read (metrics, gaps, runs, facts) | Included | Included | Included |
| write (diagnose, drafts, tasks, prompts) | Blocked | Included | Included |
| collect (trigger live prompt sampling) | Blocked | Included (opt-in) | Included (opt-in) |
Complete MCP Tools Reference (12 Tools)
Owlly exposes 7 read tools, 4 write tools, and 1 collect tool.
read Scope Tools (7)
| Tool Name | Parameters | Behavior |
|---|---|---|
| owlly_workspace_overview | none ({}) | Returns authenticated workspace (id, name, plan, status), effective_scopes, plan_clamped/role_clamped flags, collection_enabled, quota usage, and accessible projects. |
| owlly_get_visibility_report | project_id*, from, to, provider, tag, country, language, source, prompt_id | Computes coverage, share of voice, citation coverage, 6-quadrant citation categories, top domains/sources, daily trends, provider metrics, and recommendations. |
| owlly_find_competitive_gaps | project_id*, gaps_only, status, q, category, from, to, provider, language, limit | Finds prompt cohorts where competitors appear without the primary brand, including recommended_track (onsite_content / offsite_authority), co-occurring citations, and gap_run_ids. |
| owlly_inspect_runs | project_id*, run_ids, prompt_id, provider, status, limit | Inspects full AI response text, citations, and brand mentions for specific run IDs (max 20) or filtered runs. |
| owlly_get_brand_facts | project_id* | Retrieves approved brand truth cards, active hallucination alerts across up to 200 recent succeeded runs (last 30 days), and prompt stability metrics. |
| owlly_list_prompts | project_id* | Lists all monitored prompts configured in a project. |
| owlly_get_optimization_status | project_id*, task_id, page_id | Inspects optimization tasks (7-day baseline vs follow-up effect and reminder state) and content page revisions/assessments. |
write Scope Tools (4)
| Tool Name | Parameters | Behavior & Guardrails |
|---|---|---|
| owlly_diagnose_html | project_id*, url*, question*, html, locale, opportunity_id, save_page | Diagnoses supplied or publicly fetched page HTML for AEO readiness and optionally saves a draft ContentPage (local demo requires explicit html). |
| owlly_save_page_draft | project_id*, page_id*, title, description, heading, body | Updates draft fields on an existing ContentPage. Always forces status="draft" and reviewed=false. |
| owlly_create_optimization_task | project_id*, opportunity_id*, action_code*, title*, description, target_url, due_date | Creates an optimization task (answer_page, comparison, or evidence) linked to an opportunity and freezes its 7-day baseline. |
| owlly_manage_prompts_and_facts | project_id*, operation*, prompts | brand_fact | Runs add_prompts (1–25 items, always created paused with enabled=false) or add_brand_fact. |
collect Scope Tool (1)
| Tool Name | Parameters | Behavior & Guardrails |
|---|---|---|
| owlly_run_prompt_sampling | project_id*, prompt_id* | Queues immediate sampling when OWLLY_COLLECTION_ENABLED=true. Reserves observation quota atomically in PostgreSQL and refuses duplicates or exhausted quota. |
MCP Resources (2) & Workflow Prompts (2)
Alongside tools, Owlly exposes two URI resource templates and two guided workflow prompts.
| Kind | URI / Name | Arguments / MIME Type | Purpose |
|---|---|---|---|
| Resource | owlly://projects/{project_id}/brand-facts | application/json | Approved brand truth cards and 30-day hallucination alerts for the project. |
| Resource | owlly://projects/{project_id}/optimization-report | text/markdown | Localized Markdown optimization outcome report for the project. |
| Prompt | /weekly-aeo-brief | project_id*, locale | Gathers live visibility, competitive gaps, brand fact alerts, and task statuses into an executive brief without inventing numbers. |
| Prompt | /rewrite-for-citation-gap | project_id*, opportunity_id*, target_url | Guides the agent to check brand facts first, inspect gap runs, diagnose the page, and save a human-reviewable draft. |