Developers
Your agents report in. You decide in one tap.
Cortana puts every agent you run on one screen: what it is doing, what it has spent, and what it is waiting on you for. An agent asks a question, the TV shows it, you answer on your phone or computer (or with the TV remote, if the household owner allows it), and the agent gets your answer back. Connecting one takes a single HTTP request.
Quickstart
You need a Cortana household and two minutes.
-
Create an agent key. In Cortana, open Settings → Agent keys → Create a key. Keep the default scopes. The key starts with
csk_and is shown once, so copy it now.Terminal export CORTANA_API_KEY="csk_..." -
Send a heartbeat. The agent id in the path can be anything you like; the first heartbeat registers it.
Send a heartbeat curl https://cortanatv.com/api/v1/agents/research-bot/heartbeat \ -H "Authorization: Bearer $CORTANA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "status": "running", "task": "Reading 40 papers on battery chemistry", "progress": 35, "cost_usd": 0.42, "tokens_in": 18200, "tokens_out": 2100, "model": "claude-sonnet-4-5" }'Response { "ok": true, "agent": { "id": "research-bot", "state": "live" }, "decisions": [] }Look at your TV or phone. The agent is there, live, with its task, progress and spend.
-
Ask for an approval.
Ask a question curl https://cortanatv.com/api/v1/approvals \ -H "Authorization: Bearer $CORTANA_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "agent": "research-bot", "title": "Buy the full dataset for $49?", "detail": "The free sample covers 2019 only. The paid set runs to 2025.", "options": ["Buy", "Skip"] }'Response (shortened) { "id": "apr_Qm3x8L2pVw1k", "status": "pending", "options": [{ "id": "Buy", "label": "Buy", "style": "primary" }, { "id": "Skip", "label": "Skip", "style": "danger" }] }The question appears on every screen in the household with Buy and Skip as buttons.
-
Get the answer. Hold a request open until someone decides (up to 25 seconds per call), then act on the choice.
Wait for the answer curl "https://cortanatv.com/api/v1/approvals/apr_Qm3x8L2pVw1k?wait=25" \ -H "Authorization: Bearer $CORTANA_API_KEY"Response (shortened) { "id": "apr_Qm3x8L2pVw1k", "status": "decided", "choice": "Buy", "note": "", "decided_at": "2026-11-22T14:03:11.000Z" }
That is the whole loop. The rest of this page is detail: exact setup for the tools you already use, the MCP server, and webhooks.
Keys and scopes
Every request to /api/v1 and /mcp carries a key in the Authorization header. Keys belong to a household, never to the whole product, and one household can never read another's data.
Authorization: Bearer csk_...- Shown once. Cortana stores only a hash of the key. If you lose it, revoke it and make another.
- Scoped. A key can do only what its scopes allow. A request outside them gets
403. - One key per agent. When you create a key you can tie it to an agent id. That key can then only report as that agent, so a leaked or misplaced key cannot impersonate your other agents. With a tied key, the
agentfield becomes optional everywhere. - Header only. A key in a URL ends up in logs and browser history, so Cortana never reads one from a query string.
- Not a person. A key cannot answer approvals, manage keys or webhooks, or change the account. Agents cannot approve their own requests.
| Scope | Allows |
|---|---|
agents:write | Register agents, send heartbeats, report cost, post notifications and digests |
approvals:rw | Ask for approvals, read and cancel them |
read | Read agents, costs, notifications, digests and the household's open action items: upcoming events, reminders, packages and mail to act on. Grant it only to agents that need that view. |
items:write | Add an item to the household list |
reminders:write | Replace the reminders list (used by the iOS Shortcut) |
A new key gets agents:write and approvals:rw: it can report and ask, and read nothing. Add other scopes when you create it. Check any key with:
curl https://cortanatv.com/api/v1/me -H "Authorization: Bearer $CORTANA_API_KEY"{
"household": { "name": "Home", "plan": "pro" },
"key": { "id": "key_8sK2mQ", "name": "Research bot", "scopes": ["agents:write", "approvals:rw"], "agent": "research-bot" },
"limits": { "max_agents": null, "cost_history_days": 365, "mcp": true, "push": true },
"agents": 3
}Signing in instead of pasting a key
MCP clients that support OAuth (Claude.ai, Claude Code, Cursor) can connect without a key. Point them at https://cortanatv.com/mcp; they discover the sign-in page, you choose what the app may do and approve the connection in your browser, and it receives a token with exactly those scopes. Connections are listed under Settings → Connected apps, where you can end one at any time. The flow is OAuth 2.1 with PKCE and dynamic client registration.
Setup presets
Exact steps for the tools people run agents in. Each one ends with a check you can see on your screen. Replace csk_... with your key; the address shown is this site's.
Claude Code MCP · terminal
Create a key tied to the agent id
claude-codeand export it in your shell profile.~/.zshrc or ~/.bashrc export CORTANA_API_KEY="csk_..."Add the server.
--scope usermakes it available in every project.Terminal claude mcp add --transport http --scope user cortana https://cortanatv.com/mcp \ --header "Authorization: Bearer $CORTANA_API_KEY"Prefer to sign in? Leave out
--header, start Claude Code, run/mcp, pick cortana and authenticate in the browser.Tell Claude Code when to use it. Add this to
~/.claude/CLAUDE.md(all projects) or a project'sCLAUDE.md.CLAUDE.md ## Cortana - When you start a task that will take more than a minute, call the cortana `report_status` tool with status "running" and a one-line task. Update it when the task changes, and send status "idle" when you finish. - Before anything irreversible (pushing to main, deleting files outside the repo, running a migration, spending money), call `request_approval` with wait_seconds 120 and act only on a decided answer. - When a long task ends, call `notify` with a one-line result. - Never put secrets or file contents in these calls: they are shown on a shared screen.Check. In Claude Code, type:
Report to Cortana that you are connected.An agent named Claude Code appears on your screen within a second.
Claude.ai and the Claude apps MCP · custom connector
In Claude, open Customize → Connectors and click Add custom connector. (On Team and Enterprise plans an Owner does this under Organization settings → Connectors → Add → Custom.)
Enter the server address and click Add.
MCP server URL https://cortanatv.com/mcpIf the dialog asks about authentication, choose Sign in now, and for OAuth client choose Register automatically. Leave the client ID and secret empty.
Click Connect. A Cortana page opens: sign in if asked, tick what Claude may do (reporting and asking are on; reading your items is off until you tick it), choose the name it should have on your screens, and click Allow.
In a chat, click +, open Connectors and turn Cortana on. To make it a habit, add this to a Project's instructions or your profile preferences:
Instructions for Claude When you work on a long or multi-step task for me, use the Cortana connector: call report_status when you start and when you finish, and call request_approval before doing anything on my behalf that I cannot undo. Keep task lines under 60 characters and never include private details: they appear on a shared screen.Check. Ask Claude:
Use Cortana to ask me whether you should say hello.The question appears on your TV and phone; tap an answer and Claude carries on.
If your organization's connector dialog has a Request headers section, you can use an API key instead: choose No sign-in, add the header authorization with the value Bearer csk_... (include the word Bearer and the space).
Cursor MCP · mcp.json
Create a key tied to the agent id
cursor.Add the server to
~/.cursor/mcp.json(all projects) or.cursor/mcp.jsonin one project. Create the file if it does not exist.~/.cursor/mcp.json { "mcpServers": { "cortana": { "url": "https://cortanatv.com/mcp", "headers": { "Authorization": "Bearer csk_..." } } } }Do not commit a key. For a project file, leave
headersout: Cursor then shows a Needs login button for the server and signs in through your browser.Open Cursor Settings → MCP (labelled Tools & MCP in recent versions) and confirm cortana is on with eight tools.
Add a rule so the agent uses it: Cursor Settings → Rules → User Rules.
User rule When running a multi-step agent task, call the cortana report_status tool at the start (status "running", a one-line task) and at the end (status "idle"). Before any destructive or irreversible action, call request_approval with wait_seconds 120 and proceed only on a decided answer. Never include secrets or code in these calls.Check. In Agent mode, type:
Report to Cortana that Cursor is connected.
Codex MCP · config.toml
Create a key tied to the agent id
codexand export it.~/.zshrc or ~/.bashrc export CORTANA_API_KEY="csk_..."Add the server to
~/.codex/config.toml. Codex reads the key from the environment variable you name, so the key never sits in the file.~/.codex/config.toml [mcp_servers.cortana] url = "https://cortanatv.com/mcp" bearer_token_env_var = "CORTANA_API_KEY"Tell Codex when to use it, in
~/.codex/AGENTS.mdor a repository'sAGENTS.md.AGENTS.md ## Cortana - At the start of a task call the cortana `report_status` tool (status "running", one-line task); call it again with status "idle" when done, or "error" with what broke. - Before an irreversible action call `request_approval` with wait_seconds 120 and act only on a decided answer. - Never include secrets or file contents in these calls.Check. Start
codex, run/mcpto see cortana listed, then type:Report to Cortana that Codex is connected.
Grok Bot REST · agent brief
A Grok Bot reports over plain HTTPS, guided by the agent brief. Give each bot its own key.
Choose the bot's agent id: lower-case letters, digits and dashes, for example
deal-hunter. Create a key tied to that id.Store the key in the bot's secrets under the name
CORTANA_API_KEY. Do not paste the key into the bot's instructions or a chat.Copy the agent brief. Replace
{{AGENT_ID}}with the bot's id and{{API_KEY}}with the wordsthe secret CORTANA_API_KEY. Paste the result at the end of the bot's instructions and save.Check. Message the bot:
Send a test heartbeat to Cortana now and tell me the HTTP status.It should answer 200, and the bot appears on your screen.
Still on the older single-token route? An agent that posts to /api/agents/<id>/heartbeat with a household token keeps working unchanged. To move it, change the path to /api/v1/agents/<id>/heartbeat and the token to the agent's own key. The same body is accepted, including headline, metrics and items.
OpenClaw MCP or agent brief
Create a key tied to the agent id
openclaw.Add Cortana as an MCP server.
Terminal openclaw mcp add cortana \ --url https://cortanatv.com/mcp \ --transport streamable-httpGive the server its key. In your OpenClaw config the server lives under
mcp.servers.cortana; add anAuthorizationheader with the valueBearer csk_..., stored through OpenClaw's secret mechanism rather than typed into the file. The header option differs between OpenClaw versions:openclaw mcp add --helpshows the one yours has.Probe it.
Terminal openclaw mcp doctor cortana --probeCheck. Tell your agent:
Report to Cortana that you are connected.
No MCP? Use the agent brief instead: save it as a skill or append it to the agent's instructions, with the key in an environment variable the agent can read.
n8n REST · HTTP Request and Webhook nodes
Create a key tied to the agent id
n8n. In n8n, create a credential: Credentials → Add credential → Header Auth. Name:Authorization. Value:Bearer csk_....Report status. Add an HTTP Request node where the workflow starts work.
Field Value Method POSTURL https://cortanatv.com/api/v1/agents/n8n/heartbeatAuthentication Generic Credential Type → Header Auth → the credential from step 1 Send Body On, Body Content Type JSON, Specify Body: Using JSON JSON { "status": "running", "task": "{{ $workflow.name }}" }Add a second copy at the end of the workflow with
"status": "idle", and one on the error branch with"status": "error".Ask, then continue when answered. Add an HTTP Request node that posts to
/api/v1/approvalswith a JSON body such as{ "title": "Send the weekly report to 240 people?", "options": ["Send", "Hold"] }. Follow it with an HTTP Request node set toGETon/api/v1/approvals/{{ $json.id }}?wait=25, then an If node on{{ $json.status }}: when it equalspending, loop back to the GET node; when it equalsdecided, branch on{{ $json.choice }}.Or start a workflow from a decision. Create a workflow with a Webhook trigger (HTTP Method POST). Copy its Production URL, add it in Cortana under Settings → Agent keys → Webhooks with the event
approval.decided, and activate the workflow. Each decision arrives as{{ $json.body.data.approval }}.Check. Run the workflow once. An agent named N8n appears on your screen.
Zapier REST · Webhooks by Zapier
Create a key tied to the agent id
zapier.Report or ask from a Zap. Add the action Webhooks by Zapier → Custom Request.
Field Value Method POSTURL https://cortanatv.com/api/v1/notificationsData {"title": "New lead: Acme Corp", "body": "Form submitted on the pricing page", "level": "info"}Headers Authorization=Bearer csk_...andContent-Type=application/jsonUse
/api/v1/approvalswith{"title": "...", "options": ["Yes", "No"]}to ask a question, or/api/v1/agents/zapier/heartbeatto report status.Run a Zap when you decide. Create a Zap with the trigger Webhooks by Zapier → Catch Hook. Copy the webhook URL Zapier gives you into Cortana under Settings → Agent keys → Webhooks with the event
approval.decided. In later steps usedata approval choiceto branch with Paths or Filter. To verify the signature in a Code step, use Catch Raw Hook instead, which keeps the headers and the raw body.Check. Click Test step on the Custom Request action. The notice appears on your screen.
Webhooks by Zapier is available on Zapier's paid plans.
Anything else curl, Python, TypeScript
import json, os, urllib.request
BASE = "https://cortanatv.com/api/v1"
KEY = os.environ["CORTANA_API_KEY"]
def cortana(method, path, body=None):
req = urllib.request.Request(BASE + path, method=method,
data=json.dumps(body).encode() if body is not None else None,
headers={"Authorization": f"Bearer {KEY}", "Content-Type": "application/json"})
try:
with urllib.request.urlopen(req, timeout=30) as r:
return json.load(r)
except Exception as e: # reporting must never stop real work
return {"error": {"code": "unreachable", "message": str(e)}}
cortana("POST", "/agents/my-agent/heartbeat", {"status": "running", "task": "Nightly export"})
ask = cortana("POST", "/approvals", {"agent": "my-agent", "title": "Delete 1,204 stale rows?", "options": ["Delete", "Keep"]})
answer = ask
while answer.get("status") == "pending":
answer = cortana("GET", f"/approvals/{ask['id']}?wait=25")
if answer.get("status") == "decided" and answer["choice"] == "Delete":
... # do it
cortana("POST", "/agents/my-agent/heartbeat", {"status": "idle", "task": "Done", "cost_usd": 0.08})const BASE = "https://cortanatv.com/api/v1";
const headers = { Authorization: `Bearer ${process.env.CORTANA_API_KEY}`, "Content-Type": "application/json" };
async function cortana(method: string, path: string, body?: unknown) {
try {
const r = await fetch(BASE + path, { method, headers, body: body ? JSON.stringify(body) : undefined, signal: AbortSignal.timeout(30_000) });
return await r.json();
} catch (e) { return { error: { code: "unreachable", message: String(e) } }; } // never let reporting stop real work
}
await cortana("POST", "/agents/my-agent/heartbeat", { status: "running", task: "Nightly export" });
const ask = await cortana("POST", "/approvals", { agent: "my-agent", title: "Delete 1,204 stale rows?", options: ["Delete", "Keep"] });
let answer = ask;
while (answer.status === "pending") answer = await cortana("GET", `/approvals/${ask.id}?wait=25`);
if (answer.status === "decided" && answer.choice === "Delete") { /* do it */ }The agent brief
One page that teaches any chat agent to report in over HTTPS: when to send a heartbeat, how to ask before acting, how to read your answer, and what never to put on a shared screen. Paste it into the agent's instructions.
- Replace
{{AGENT_ID}}with the agent's id, for exampleresearch-bot. - Replace
{{API_KEY}}with a reference to wherever the agent keeps secrets (for example "the secret CORTANA_API_KEY"). Paste the key itself only if the tool has no secret store. - The address is already filled in with this site's.
Loading the brief…
Agents connected through the MCP server do not need the brief: the tools describe themselves.
Status and heartbeat
A heartbeat says what an agent is doing right now. Send one when work starts, when the task or progress changes, when work ends, and every few minutes in between.
{id} is the agent's id: 1 to 40 characters, lower-case letters, digits, - and _. Anything else is normalised (Research Bot becomes research-bot). The first heartbeat registers the agent.
| Field | Type | Meaning |
|---|---|---|
status | string | One of running, idle, error or stuck (an agent that knows it is blocked may say so itself). Defaults to running on the first heartbeat, otherwise unchanged. Any other value is refused with 400 bad_request, and the error lists the allowed values. A few synonyms are accepted and stored as the status they mean: live, working, busy, active (running); done, waiting, sleeping, paused (idle); failed, blocked (error). |
task | string, ≤ 200 | One line shown on the screen. Aim for under 60 characters. On error, say what broke. |
progress | number 0–100 | Percent complete. A value between 0 and 1 (such as 0.4) is read as a fraction and shown as 40%. Send null to clear it. |
cost_usd | number ≥ 0 | US dollars spent since the previous report. |
tokens_in, tokens_out | integer ≥ 0 | Tokens used since the previous report. |
model | string, ≤ 80 | The model in use. Remembered until you send another. |
name, role | string | Display name (≤ 60) and a one-line description (≤ 200). Optional; send once. |
stuck_after | integer, seconds | How long the agent may stay silent while running before it is shown as stuck. 30 to 604800. Default 1200 (20 minutes). |
Every field is optional. An empty body {} is a valid "still here".
{
"ok": true,
"agent": { "id": "research-bot", "state": "live" },
"decisions": [
{ "type": "approval", "id": "apr_Qm3x8L2pVw1k", "title": "Buy the full dataset for $49?", "status": "decided",
"choice": "Buy", "choice_label": "Buy", "note": "use the team card", "decided_at": "2026-11-22T14:03:11.000Z" }
]
}decisions lists every answer to this agent's approval requests that a heartbeat has not delivered yet. Each appears in one heartbeat response, whether or not the agent also read it by polling; use the id to ignore a repeat. An approval that ran out of time arrives with "status": "expired" and "choice": null.
States
| State | When |
|---|---|
live | Last status was running, and the last heartbeat is within stuck_after. |
idle | Last status was idle. An idle agent may stay silent for as long as it likes. |
stuck | Last status was running, then nothing for longer than stuck_after. Fires the agent.stuck webhook once; the next heartbeat fires agent.recovered. |
error | Last status was error. |
offline | Registered, never reported. |
Finish with idle. An agent that runs on a schedule should send "status": "idle" as its last heartbeat of each run. Otherwise it looks stuck while it sleeps.
Approvals
An approval is a question with buttons. It appears on every screen in the household, and on phones as a push notification for households that turned that on. One person answers; the agent gets the choice.
| Field | Type | Meaning |
|---|---|---|
title | string, ≤ 140, required | The question. Readable from across a room: aim for under 80 characters. |
agent | string | The asking agent's id. Optional with a key tied to an agent. |
detail | string, ≤ 2000 | What the person needs to know to decide. Shown on screen, never in the push notification. |
options | array, 1–6 | Button labels (≤ 40 characters each), or objects { "id", "label", "style" } with style primary, danger or default. Default: Approve and Reject. |
expires_in | integer, seconds | 1 to 2592000 (30 days). Default 86400 (one day). |
confirm | boolean | Default false. When a household lets its TV answer (off by default), the primary and danger options always need OK held for a moment, so one stray press never decides. Set true to require that hold on every option. |
phone_only | boolean | Default false. Set true for sensitive requests: only a signed-in household member can answer, on their phone or computer. The shared TV shows the request but its remote cannot decide it, even in a household that lets the TV answer other requests. |
dedupe_key | string, ≤ 80 | Any stable string. A repeat within 24 hours returns the original request with "duplicate": true instead of asking again. |
choice comes back as the label exactly as you sent it ("Buy at $310"). If you would rather compare against a fixed value, give the option an id: { "id": "buy", "label": "Buy at $310" } comes back as "buy".
Returns the approval. With wait (up to 25), the request stays open until someone answers or the time runs out, then returns the current state. Loop while status is pending.
| status | Meaning | What the agent does |
|---|---|---|
pending | Nobody has answered. | Wait. Do not act. |
decided | Answered. choice, choice_label, note, decided_at are set. | Act on choice only. Read note. |
expired | expires_in passed with no answer. | Treat as no. |
cancelled | The agent withdrew it, or the agent was deleted. | Nothing. |
Lists approvals, newest first. status is pending (default), decided, expired, cancelled or all; limit up to 100.
Withdraws a pending question, for example when it no longer matters.
Three ways to get the answer
- Wait for it with
?wait=25in a loop. Simplest for scripts. - Pick it up later from the
decisionslist of the next heartbeat. Best for agents that already report on a schedule. - Be told with the
approval.decidedwebhook. Best for servers and automation tools.
A household can have 40 questions waiting at once. Beyond that, new requests get 429 too_many_pending.
Notifications and digests
A notification is a short notice on the screens. A digest is a longer report in Markdown. Neither is pushed to phones: push is reserved for approvals.
{ "agent": "backup-bot", "title": "Nightly backup complete", "body": "3 sources, no differences.", "level": "success" }title is required (≤ 140). body is optional (≤ 1000). level is info (default), success, warning or error. The household keeps the latest 200.
{ "agent": "research-bot", "title": "Battery chemistry: week 47", "markdown": "## Findings\n\n- **Sodium-ion** costs fell 18%\n- See [the paper](https://example.org/paper)\n\n> Recommendation: wait one quarter." }markdown is required (≤ 20,000 characters). title defaults to the first line. Headings, paragraphs, bold, italic, strikethrough, inline and fenced code, lists, block quotes, rules and http(s) links are rendered. Raw HTML is shown as text, never run.
Cost and usage
Agents report their own spend. Cortana adds it up per agent and per model, by day, week and month, in the household's time zone.
Report deltas. cost_usd, tokens_in and tokens_out are what was used since the agent's previous report, not running totals. Reporting a total twice counts it twice. To make a retry safe, send an optional report_id (any string up to 100 characters, such as a run id plus step) with the heartbeat or with POST /api/v1/costs: the same id from the same agent is counted once, and the repeat answers "duplicate": true.
The usual way is to include the three fields in each heartbeat. To record spend on its own:
{ "agent": "research-bot", "cost_usd": 1.5, "tokens_in": 40000, "tokens_out": 6000, "model": "claude-sonnet-4-5", "note": "literature pass" }period is day (today), week (today and the six days before, the default) or month (30 days). agent narrows it to one agent.
{
"period": "week", "days": 7, "from": "2026-11-16T05:00:00.000Z", "to": "2026-11-22T19:20:00.000Z", "tz": "America/New_York", "currency": "USD",
"total": { "cost_usd": 43.62, "tokens_in": 9161229, "tokens_out": 1395996, "reports": 175 },
"agents": [ { "agent": "research-bot", "name": "Research Bot", "cost_usd": 15.0, "tokens_in": 3150000, "tokens_out": 480000, "reports": 28 } ],
"models": [ { "model": "grok-4-fast", "cost_usd": 21.4, "tokens_in": 4494000, "tokens_out": 684800, "reports": 84 } ],
"daily": [ { "day": "2026-11-16", "cost_usd": 7.0, "tokens_in": 1470798, "tokens_out": 224122, "reports": 28 } ]
}On the Free plan history covers seven days: a month request returns seven days with "limited_to_days": 7.
Items and reminders
The household's open action items, most urgent first: upcoming calendar events, reminders, packages, notes that read like tasks, things agents are waiting on. Each has key, kind, title, detail, due, tag, priority and late. limit up to 100, default 30.
{ "text": "Call the landlord about the lease" }Adds a note to the household's list (≤ 240 characters). Notes that start with a verb or mention a deadline also join the action items.
{ "reminders": [ { "title": "Renew passport", "due": "2026-12-01T17:00:00Z", "list": "Admin" } ] }Replaces the whole reminders list. Built for the iOS Shortcut that mirrors Apple Reminders; up to 200 entries.
Managing agents
Heartbeats register agents by themselves, so these are for tidying up.
| Request | Scope | Does |
|---|---|---|
GET /api/v1/agents | read | Lists agents with state, task, progress, model, last_seen. |
GET /api/v1/agents/{id} | read | One agent. |
POST /api/v1/agents | agents:write | Registers an agent before its first heartbeat: { "id", "name", "role", "stuck_after" }. 409 if the id exists. |
PUT /api/v1/agents/{id} | agents:write | Changes name, role, model or stuck_after. |
DELETE /api/v1/agents/{id} | agents:write | Removes the agent, cancels its pending approvals and deletes its notices and digests. Cost history is kept. |
MCP server
Cortana is a Model Context Protocol server. An MCP client connects once and its model gets eight tools, each with a description that tells the model when to use it.
| Endpoint | https://cortanatv.com/mcp |
| Transport | Streamable HTTP. POST one JSON-RPC 2.0 message; the answer is application/json, or a short text/event-stream when a tool call waits for a person. |
| Protocol versions | 2026-07-28 (stateless, current), and 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05 with the initialize handshake. |
| Authentication | Authorization: Bearer with an API key, or OAuth 2.1 sign-in (see above). |
| State | None. No session id; every request stands alone. GET and DELETE return 405. |
{
"mcpServers": {
"cortana": {
"type": "http",
"url": "https://cortanatv.com/mcp",
"headers": { "Authorization": "Bearer csk_..." }
}
}
}Tools
| Tool | Scope | Does |
|---|---|---|
report_status | agents:write | Heartbeat: status, task, progress, cost and tokens, model. Returns pending decisions. |
request_approval | approvals:rw | Asks a question with options. With wait_seconds (up to 300) the call stays open until someone answers. |
check_approval | approvals:rw | Reads an approval's state. Also takes wait_seconds. |
notify | agents:write | Posts a short notice. |
post_digest | agents:write | Posts a Markdown report. |
log_cost | agents:write | Records spend outside a status report. |
list_items | read | Reads the household's open action items. |
add_item | items:write | Adds an item to the household list. |
tools/list returns only the tools the key's scopes allow. Tool results carry the same JSON in structuredContent and as a text block. A tool's own failure (a missing field, a plan limit) comes back as a result with isError: true and a message the model can act on.
A session by hand
The current revision has no handshake: each request names its protocol version in the body and in headers.
curl https://cortanatv.com/mcp \
-H "Authorization: Bearer $CORTANA_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: tools/call" \
-H "Mcp-Name: request_approval" \
-d '{
"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {
"name": "request_approval",
"arguments": { "agent": "research-bot", "title": "Email the summary to the team?", "options": ["Send", "Hold"], "wait_seconds": 120 },
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": { "name": "curl", "version": "1.0.0" },
"io.modelcontextprotocol/clientCapabilities": {}
}
}
}': stream open
event: message
data: {"jsonrpc":"2.0","id":1,"result":{"resultType":"complete","content":[{"type":"text","text":"{\"id\":\"apr_...\",\"status\":\"decided\",\"choice\":\"Send\", ...}"}],"structuredContent":{"id":"apr_...","status":"decided","choice":"Send","choice_label":"Send","note":"","next":"Answered: \"Send\". Act on that choice only."},"isError":false}}Clients on earlier revisions start with initialize and are answered in the version they ask for:
curl https://cortanatv.com/mcp \
-H "Authorization: Bearer $CORTANA_API_KEY" -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"curl","version":"1.0.0"}}}'server/discover lists the supported versions. A version Cortana does not speak gets 400 with error -32022 and the supported list; headers that disagree with the body get 400 with -32020.
Webhooks
Cortana can call your server when something happens. Add an HTTPS endpoint under Settings → Agent keys → Webhooks and choose events. The signing secret (whsec_...) is shown once.
| Event | When | data |
|---|---|---|
approval.created | An agent asked a question | { approval } |
approval.decided | A person answered | { approval } with choice, note, decided_by |
approval.expired | Time ran out | { approval } |
agent.stuck | A running agent went silent past stuck_after | { agent, silent_for_s } |
agent.recovered | A stuck agent reported again | { agent } |
notification.created | An agent posted a notice | { notification } |
digest.posted | An agent posted a digest | { digest } (title and excerpt) |
POST /your/endpoint
Content-Type: application/json
webhook-id: msg_2Hq8sLw0PzXk
webhook-timestamp: 1795363391
webhook-signature: v1,K5oZfzN95Z9UVu1EsfQmfVNQhnkZ2pj9o9NDN/H/pI4=
{
"id": "msg_2Hq8sLw0PzXk",
"type": "approval.decided",
"created_at": "2026-11-22T14:03:11.000Z",
"data": {
"approval": {
"id": "apr_Qm3x8L2pVw1k", "agent": "research-bot", "agent_name": "Research Bot",
"title": "Buy the full dataset for $49?", "status": "decided",
"choice": "Buy", "choice_label": "Buy", "note": "use the team card", "decided_by": "Sam",
"created_at": "2026-11-22T14:01:40.000Z", "decided_at": "2026-11-22T14:03:11.000Z"
}
}
}Verify the signature
Signatures follow the Standard Webhooks scheme, so its libraries work as they are. By hand: compute HMAC-SHA256 over {webhook-id}.{webhook-timestamp}.{raw body}, using the base64-decoded part of the secret after whsec_ as the key; compare the base64 result with the value after v1,. Reject timestamps more than five minutes from now. Use the raw request body, before any JSON parsing.
import crypto from "node:crypto";
export function verify(secret, headers, rawBody) {
const id = headers["webhook-id"], ts = headers["webhook-timestamp"];
if (!id || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
const key = Buffer.from(secret.replace(/^whsec_/, ""), "base64");
const want = Buffer.from("v1," + crypto.createHmac("sha256", key).update(`${id}.${ts}.${rawBody}`).digest("base64"));
return String(headers["webhook-signature"] || "").split(" ")
.some(s => s.length === want.length && crypto.timingSafeEqual(Buffer.from(s), want));
}import base64, hashlib, hmac, time
def verify(secret: str, headers: dict, raw_body: bytes) -> bool:
msg_id, ts = headers.get("webhook-id"), headers.get("webhook-timestamp")
if not msg_id or abs(time.time() - int(ts)) > 300:
return False
key = base64.b64decode(secret.removeprefix("whsec_"))
signed = f"{msg_id}.{ts}.".encode() + raw_body
want = "v1," + base64.b64encode(hmac.new(key, signed, hashlib.sha256).digest()).decode()
return any(hmac.compare_digest(s, want) for s in headers.get("webhook-signature", "").split(" "))Delivery
- Answer with any
2xxwithin 10 seconds. Anything else, including a redirect, counts as a failure. - A failed delivery is retried after 5 seconds, 30 seconds, 2 minutes, 10 minutes, 1 hour and 6 hours: seven attempts in all. Each retry has the same
webhook-id, so use it to ignore repeats. - After ten deliveries in a row use up every attempt, the webhook is switched off. Turn it back on in Settings.
- Settings shows the last 50 deliveries per webhook with status, attempts and response code, and a Send test button that delivers a signed
pingevent. - Endpoints must be public
httpsaddresses. Private, loopback and link-local addresses are refused when you add the endpoint and again on every delivery, at the moment of connecting.
Errors and limits
Every REST error has the same shape, with a stable code and a message written for people.
{ "error": { "code": "upgrade_required", "message": "Cortana Pro includes more than two agents. Upgrade in Settings, Billing.", "feature": "agents" } }| Status | Code | Meaning |
|---|---|---|
| 400 | bad_request, bad_json, bad_agent, bad_choice | The body is wrong. The message names the field. |
| 401 | unauthorized | No key, a wrong key, or a revoked key. |
| 402 | upgrade_required | The household's plan does not include this. feature says which part: agents, mcp, push, webhooks, keys. |
| 403 | forbidden, wrong_agent | The key lacks the scope, or is tied to a different agent. |
| 404 | not_found | No such agent, approval or digest in this household. |
| 409 | exists, already_decided, already_expired, already_cancelled | The thing is not in a state that allows this. |
| 413 | too_large | Body over 100 kB (120 kB for digests). |
| 429 | rate_limited, too_many_pending | Slow down. Retry-After gives the seconds to wait. |
| 500 | server_error | Our fault. Safe to retry. |
Rate limits, per key per minute
| Endpoint | Limit |
|---|---|
| Heartbeats, cost reports | 120 each |
| Approvals created, notifications | 30 each |
| Digests | 20 |
Approval reads (including wait) | 240 |
| MCP requests | 240 |
Good manners
- Never let reporting stop real work. Give each call a timeout, catch failures, carry on.
- The screen is shared. Do not put secrets, account numbers or balances in a task, a title, a notice or a digest.
- Ask once. Use
dedupe_keywhen retrying an approval request. - Act only on
decided. Pending, expired and cancelled all mean no.
Plans
| Free | Pro | |
|---|---|---|
| Agents | 2 | Unlimited |
| REST API, approvals, notifications, digests | Yes | Yes |
| Cost history | 7 days | 12 months |
| MCP server | Yes | Yes |
| Push notifications for approvals | No | Yes |
| Webhooks | 1 | 5 |
| Agent keys | 5 | 50 |
A limit returns 402 with upgrade_required, so an agent can tell you instead of failing quietly. A plan change applies at once: no new key, no restart. See pricing.