MCP tools
Honeloop exposes a small, eval-gated MCP toolset over a single stateless POST /mcp endpoint. Every call runs through the same policy gate and audit trail as REST v2.
Endpoint, protocol and headers#
The MCP endpoint is POST /mcp implementing specification revision2026-07-28. It is strictly stateless: there is no GET SSE stream, no DELETE, no initialize handshake and noMcp-Session-Id header.
| Header | Required | Purpose |
|---|---|---|
Authorization | On tools/list and tools/call | Bearer hlk_<key> (or OAuth hlt_ token). Browser session JWTs are refused with HTTP 401. |
MCP-Protocol-Version | Every POST | Must equal 2026-07-28 and match params._meta["io.modelcontextprotocol/protocolVersion"]. |
Mcp-Method | Every POST | Must match JSON-RPC method (server/discover, tools/list or tools/call). |
Mcp-Name | On tools/call | Must match params.name. Mismatched headers fail with HTTP 400 and JSON-RPC code -32020. |
X-Honeloop-Org | Optional | Asserts the key's organisation UUIDv7 (never selects one). A mismatch returns org_mismatch. |
X-Agent-Session-Id | Optional | Recorded as session_id on the audit event (takes precedence over _meta["com.honeloop/agent_session_id"]). |
Never pass a credential in a URL
Honeloop has no /mcp/:apiKey route and no ?api_key= parameter. A Fastify pre-handler scans every path segment and query string for credential patterns and refuses matches with HTTP 400credential_in_url, records a security alert without logging the token and notifies the workspace owner to rotate it.
MCP client configuration
{
"mcpServers": {
"honeloop": {
"url": "https://api.honeloop.example/mcp",
"headers": {
"Authorization": "Bearer hlk_EXAMPLE_AGENT_KEY",
"X-Honeloop-Org": "0197e3a0-0000-7000-8000-0000000000a1"
}
}
}
}Discovery and scope-filtered listing#
server/discoverrequires no credentials and returnssupportedVersions: ["2026-07-28"],capabilities.tools,instructions,ttlMs: 3600000andcacheScope: "public".tools/listrequires a valid Bearer credential and returns only tools whose underlying capability scope is in the caller's effective scopes, withttlMs: 60000andcacheScope: "private".tools/callreturns bare entity JSON instructuredContent, a one-line summary incontent[0].text, andcom.honeloop/correlation_idpluscom.honeloop/activity_event_idin result_meta. Anapproval_requireddiversion returnsisError: false.
Discover server capabilities
curl -sS -X POST "https://api.honeloop.example/mcp" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: server/discover" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "server/discover",
"params": {
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}'Shipped MCP tools#
Honeloop ships seventeen hand-written, eval-gated MCP tools, each with strictadditionalProperties: false validation inside the kernel gate and an explicit output schema.
| Tool | Capability | Scope | Arguments | Output and notes |
|---|---|---|---|---|
list_channels | channels.list | channels:read | cursor?, limit?, status?, provider_id? | Lists connected workspace channels with IDs, provider IDs, handles and connection status. Skip channels marked needs_reauth. |
get_platform_rules | providers.capabilities | None (authenticated) | channel_id or provider_id (mutually exclusive) | Returns manifest constraints, character limits, media rules, guardrails and settings schema so agents check limits before drafting. |
create_draft | posts.create | posts:write | channel_ids, parts, overrides?, idempotency_key? | Returns bare Post with id and version. Never publishes or violates autonomy policy. |
schedule_post | posts.schedule | posts:publish | post_id, version, when, idempotency_key? | Maps when (ISO 8601 with timezone) to scheduled_at; rejects when: "now" with validation_failed. Returns Post or ApprovalDiversion (isError: false). |
publish_now | posts.publish_now | posts:publish | post_id, version, idempotency_key? | Irreversible commit step that publishes an existing draft or approved post immediately. Subject to the same autonomy policy gate (returns ApprovalDiversion with isError: false under in_the_loop) and the recreate: false never-publish-again rule. |
get_post_status | posts.status | posts:read | post_id | Returns PostStatus with lifecycle state, approval request id/version and per-channel renditions. If an error carries recreate: false, never publish again. |
poll_events | events.list | events:read | cursor?, since?, types?, post_id?, channel_id?, correlation_id?, principal_id?, session_id?, limit? | Returns ascending events with items, next_cursor and poll_after_ms over the 90-day event window. Persist next_cursor between polls. |
list_media | media.list | media:read | cursor?, limit?, kind?, status?, q? | Lists images, GIFs, videos and PDF documents in the organisation library, newest first, returning media_id values for draft parts. |
upload_media_from_url | media.upload_from_url | media:write | url, alt?, filename?, idempotency_key? | Imports an image or GIF (up to 10 MiB), PDF (up to 50 MiB) or MP4/MOV/WebM video (up to 512 MiB) from a public HTTPS URL with SSRF protections. |
query_analytics | analytics.query | analytics:read | from, until, channel_ids?, post_id?, publication_id?, granularity?, metrics? | Returns normalised aggregate totals and bucketed time series (day, week or month) per channel, post (across all published renditions) or publication. |
create_series | series.create | posts:publish | name, source_post_id, rrule, timezone, materialize_horizon_days?, idempotency_key? | Creates a recurring post series backed by an RFC 5545 RRULE and IANA timezone that materialises scheduled occurrences from a source post. |
assist_compose | agent.assist_compose | agent:write | action, text, provider_id?, channel_id?, tone?, target_language?, instructions?, use_brand_voice?, idempotency_key? | Rewrites, shortens, expands, hooks, threadifies, shifts tone or translates copy inline with the brand voice. Returns suggested parts only and never saves or publishes. |
invoke_provider_tool | providers.invoke_tool | channels:read (manifest-driven) | channel_id, tool, arguments?, idempotency_key? | Executes a provider manifest helper tool on a connected channel (for example mention or category lookups declared in get_platform_rules). |
list_posts | posts.list | posts:read | cursor?, limit?, states?, channel_id?, ids?, created_after?, scheduled_after?, scheduled_before?, tags? | Lists organisation posts newest first with cursor pagination so agents can inspect drafts, scheduled posts or posts awaiting approval and recover post_id and current version. Read-only (never diverts). |
update_draft | posts.update | posts:write | post_id, version, channel_ids?, parts?, overrides?, scheduled_at?, tags?, idempotency_key? | Revises an existing draft or editable post using optimistic concurrency (replaces supplied fields wholesale; rebase on conflict_stale_version). Editing a draft never diverts; editing a scheduled post passes the autonomy gate and may return ApprovalDiversion (isError: false). |
cancel_post | posts.cancel | posts:publish | post_id, version, idempotency_key? | Cancels a pending-approval, approved or scheduled post before publication starts (or archives a failed post), moving it to terminal state cancelled while preserving history for get_post_status. Never diverts or deletes an already-published post on a platform. |
suggest_slots | slots.suggest | posts:read | channel_ids, count?, from?, until? | Suggests conflict-free quarter-hour publishing timestamps respecting channel posting windows, spacing gaps, quiet hours and daily caps. Read-only (never reserves a slot or diverts). |
All 132 registered capabilities across 27 domains — including auto-engagement plugs, internal team post comments, auto-shorten preferences, stock photo search and import, AI studio generation and copilot threads — are available immediately over REST v2, @honeloop/sdk and thehl CLI (69 generated verbs plus universal hl call).
Invoke schedule_post over POST /mcp
curl -sS -X POST "https://api.honeloop.example/mcp" \
-H "Authorization: Bearer $HONELOOP_AGENT_KEY" \
-H "X-Honeloop-Org: 0197e3a0-0000-7000-8000-0000000000a1" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: tools/call" \
-H "Mcp-Name: schedule_post" \
-d '{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "schedule_post",
"arguments": {
"post_id": "0197e3b4-6f1a-7c2e-9d41-5b8e0a3c7f10",
"version": 1,
"when": "2026-11-26T09:30:00Z"
},
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}'OAuth 2.1 resource server#
POST /mcp acts as an OAuth 2.1 resource server alongside hlk_ API keys so third-party MCP clients can connect with delegated, revocable hlt_tokens:
- Discovery metadata: RFC 9728 protected resource metadata is served at
GET /.well-known/oauth-protected-resource/mcp(and/v2), pointing clients atGET /.well-known/oauth-authorization-serverandGET /.well-known/openid-configuration. - Client registration: Honeloop supports both Client ID Metadata Documents (CIMD, SEP-991 with HTTPS
client_idURLs) and Dynamic Client Registration (DCR, RFC 7591 atPOST /oauth/register). Public clients require PKCE (S256), carry zero standing power until a user consents at/oauth/consentand are bounded to 13 scopes (excludingapprovals:decide,billing:manageandpolicies:manage). - Audience binding and challenges: OAuth tokens bind to their RFC 8707
resourceindicator (tokens minted for/mcpare refused on/v2and vice versa). Unauthenticated or audience-mismatched requests answer HTTP 401 with aWWW-Authenticate: Bearer resource_metadata="..."challenge.
Automatic idempotency at the MCP boundary#
Because MCP clients do not send HTTP Idempotency-Key headers, mutating tools accept an optional idempotency_key argument. When omitted, the MCP adapter derives a deterministic replay key:mcpd_ + hex sha256(principal_id || tool_name || canonical_json(arguments)). Retrying an identical tool call within 24 hours replays the original response instead of creating duplicate drafts or schedules. Pass a distinct idempotency_key if you intentionally want two identical drafts within 24 hours.
What is deliberately excluded from MCP#
approvals.decide, policies.set and channel connection or disconnection never appear as MCP tools. Separating the surface that drafts and schedules work from the surface that approves work guarantees that a single over-scoped agent token cannot approve its own posts or weaken its own guardrails. Reviewer automation usesREST v2 orhl approvals decide with a dedicated reviewer credential.