Skip to content
Documentation menu: MCP tools

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.

Protocol 2026-07-28Stateless POST /mcpBearer header only

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.

HeaderRequiredPurpose
AuthorizationOn tools/list and tools/callBearer hlk_<key> (or OAuth hlt_ token). Browser session JWTs are refused with HTTP 401.
MCP-Protocol-VersionEvery POSTMust equal 2026-07-28 and match params._meta["io.modelcontextprotocol/protocolVersion"].
Mcp-MethodEvery POSTMust match JSON-RPC method (server/discover, tools/list or tools/call).
Mcp-NameOn tools/callMust match params.name. Mismatched headers fail with HTTP 400 and JSON-RPC code -32020.
X-Honeloop-OrgOptionalAsserts the key's organisation UUIDv7 (never selects one). A mismatch returns org_mismatch.
X-Agent-Session-IdOptionalRecorded 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/discover requires no credentials and returnssupportedVersions: ["2026-07-28"], capabilities.tools,instructions, ttlMs: 3600000 andcacheScope: "public".
  • tools/list requires a valid Bearer credential and returns only tools whose underlying capability scope is in the caller's effective scopes, withttlMs: 60000 and cacheScope: "private".
  • tools/call returns bare entity JSON instructuredContent, a one-line summary in content[0].text, andcom.honeloop/correlation_id plus com.honeloop/activity_event_idin result _meta. An approval_required diversion 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.

ToolCapabilityScopeArgumentsOutput and notes
list_channelschannels.listchannels:readcursor?, limit?, status?, provider_id?Lists connected workspace channels with IDs, provider IDs, handles and connection status. Skip channels marked needs_reauth.
get_platform_rulesproviders.capabilitiesNone (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_draftposts.createposts:writechannel_ids, parts, overrides?, idempotency_key?Returns bare Post with id and version. Never publishes or violates autonomy policy.
schedule_postposts.scheduleposts:publishpost_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_nowposts.publish_nowposts:publishpost_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_statusposts.statusposts:readpost_idReturns PostStatus with lifecycle state, approval request id/version and per-channel renditions. If an error carries recreate: false, never publish again.
poll_eventsevents.listevents:readcursor?, 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_mediamedia.listmedia:readcursor?, 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_urlmedia.upload_from_urlmedia:writeurl, 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_analyticsanalytics.queryanalytics:readfrom, 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_seriesseries.createposts:publishname, 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_composeagent.assist_composeagent:writeaction, 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_toolproviders.invoke_toolchannels: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_postsposts.listposts:readcursor?, 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_draftposts.updateposts:writepost_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_postposts.cancelposts:publishpost_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_slotsslots.suggestposts:readchannel_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 atGET /.well-known/oauth-protected-resource/mcp (and /v2), pointing clients at GET /.well-known/oauth-authorization-server andGET /.well-known/openid-configuration.
  • Client registration: Honeloop supports both Client ID Metadata Documents (CIMD, SEP-991 with HTTPS client_id URLs) and Dynamic Client Registration (DCR, RFC 7591 at POST /oauth/register). Public clients require PKCE (S256), carry zero standing power until a user consents at/oauth/consent and are bounded to 13 scopes (excludingapprovals:decide, billing:manage andpolicies:manage).
  • Audience binding and challenges: OAuth tokens bind to their RFC 8707resource indicator (tokens minted for /mcp are refused on/v2 and vice versa). Unauthenticated or audience-mismatched requests answer HTTP 401 with a WWW-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.