Skip to main content

How it works

ClaudeInteractiveClaude DesktopInteractiveChatGPTInteractiveCursorInteractiveVS CodeInteractiveGitHub CopilotInteractiveGooseInteractivePostmanInteractiveMCPJamInteractiveArchestra.AIInteractiveWindsurfZedClineContinueJetBrainsReplitLibreChatGeminiMicrosoft Copilot
Any MCP client that supports remote OAuth and Streamable HTTP can use the same endpoint. Clients tagged Interactive render CortexHub’s in-chat Connect, Consent, and Operator Review prompts inline (per the official MCP Apps support matrix).

End-to-end flow​

01

Connect

OAuth sign-in from your app or SDK session.

02

Search

Agent finds tools via cortexhub_search_tools.

03

Policy

Group rules run before any downstream call.

04

Invoke

Permitted calls reach Slack, Jira, and others.

05

Audit

Spans and receipts recorded in CortexHub Cloud.

This flow covers external AI clients and SDKs connecting through the gateway. A member's hosted co-worker runs the same governed discovery and invoke internally, under the same rules. See Agents.

1. Connect​

Your AI app or SDK authenticates to https://mcp.cortexhub.ai/v1/mcp with the credential that matches its runtime: interactive clients use Member OAuth Authorization Code + PKCE; server-side processes use a programmatic Member Credential or an organisation gateway key. See Choose your authentication model.

CortexHub creates a gateway identity (agent) for your user and app at connect time.

2. Discover tools (meta-tools)​

The gateway exposes five agent meta-tools for discovery, invoke, task poll, and consent. When a call needs approval, CortexHub creates an MCP Task and returns mcp_task.task_id on the parked invoke result. Agents poll with cortexhub_get_task until terminal is true.

Meta-toolPurpose
cortexhub_search_toolsFind tools by intent (tool_name, summary, description per hit)
cortexhub_get_tool_schemasLoad parameters_schema for chosen tool_name values
cortexhub_invoke_toolsRun one to ten governed calls (returns an MCP Task when parked)
cortexhub_get_taskPoll a parked MCP Task until terminal is true
cortexhub_request_consentOptional explicit consent card when task inputRequests are not enough

When a call parks for end-user approval, the per-call result includes mcp_task.task_id. Interactive clients show consent via task inputRequests; others may call cortexhub_request_consent with mcp_task.approval_id.

When a call needs a toolkit connection, the per-call result carries connect_required.portal_url. Share that link with the user; after they connect in CortexHub, retry search and invoke.

When a call needs operator review, poll the MCP Task until it completes. Operators decide in the configured Slack channel or webhook.

The agent loop is:

  1. Search: cortexhub_search_tools returns results[].tool_name, results[].summary, and results[].description, plus next_step.
  2. Schemas: cortexhub_get_tool_schemas with those tool_name values.
  3. Invoke: cortexhub_invoke_tools with calls[].tool_name, calls[].arguments, calls[].rationale, and calls[].presentation.
  4. Parked calls: call cortexhub_get_task with mcp_task.task_id until terminal is true. Optionally call cortexhub_request_consent for an explicit consent card or browser link.
  5. Toolkit connect: share connect_required.portal_url, then retry from step 2.

Each meta-tool response includes a next_step string when the agent should continue.

See Meta-tools for full request and response shapes.

3. Invoke with governance​

Each cortexhub_invoke_tools call is resolved against the layered policy that applies to it (the organisation floor, your groups, and any member rules) and the tool's safety profile (read, write, or destructive). The result is a single base decision (permit, require approval, or deny), with optional obligations on top: the call may also store a redacted record and require re-authentication first. The strictest gate wins. Outcomes include:

StatusMeaning
okTool ran successfully
awaiting_user_consentEnd user must approve. Client polls the MCP Task; optionally cortexhub_request_consent.
awaiting_operator_approvalOperator must approve outside the chat. Poll the MCP Task until complete. No in-chat consent UI.
agent_toolkit_requiredToolkit not connected. Share connect_required.portal_url, then retry.
autonomous_consent_requiredAutonomous run blocked until the member approves on a configured personal channel
policy_deniedAccess rules blocked the call
step_upAdditional verification is required
tool_errorThe tool or upstream provider failed

Treat policy_denied, awaiting_user_consent, and awaiting_operator_approval as normal states, not opaque errors.

4. Audit and observability​

Permitted and denied calls produce spans, audit events, and receipts admins can review. Optional telemetry webhooks export events to your SIEM or data warehouse.

See also​