TaskToHuman
Let an AI agent ask a person to approve, review or fill in something before it acts.
Máy chủ MCP được lưu trữ
npx add-mcp 'https://mcp.tasktohuman.com'Cài vào Claude Code, Codex, Cursor và nhiều công cụ khác
Tài liệu
Connect
| Setting | Value |
|---|---|
| Server | https://mcp.tasktohuman.com (the root path) |
| Transport | Streamable HTTP, stateless |
| Authentication | Your workspace API key: Authorization: Bearer tth_live_… or tth_test_… |
The key decides the workspace and the mode, exactly as on the API: a test key creates test tasks that notify only you and count against your monthly test allowance. There is no OAuth sign-in yet, so clients that can only connect with OAuth (and can't send a header) can't use the server for now.
The server is part of every paid plan, not the Free plan (intake.mcp, see pricing). Without it, the tool list still loads, so the agent can explain, and every tool call answers with a feature_not_in_plan error.
Client configuration
Keep the key out of files you commit: each example reads it from the environment or asks for it.
claude mcp add --transport http tasktohuman https://mcp.tasktohuman.com \
--header "Authorization: Bearer $TTH_API_KEY"
{
"mcpServers": {
"tasktohuman": {
"url": "https://mcp.tasktohuman.com",
"headers": {
"Authorization": "Bearer ${env:TTH_API_KEY}"
}
}
}
}
{
"inputs": [
{
"type": "promptString",
"id": "tth-api-key",
"description": "TaskToHuman API key",
"password": true
}
],
"servers": {
"tasktohuman": {
"type": "http",
"url": "https://mcp.tasktohuman.com",
"headers": {
"Authorization": "Bearer ${input:tth-api-key}"
}
}
}
}
Cursor reads ~/.cursor/mcp.json (or .cursor/mcp.json in a project); VS Code reads .vscode/mcp.json and asks for the key once. Any other client that speaks Streamable HTTP and can send a header works the same way. The MCP integration page sums up what an agent can do with it.
Tools
| Tool | What it does |
|---|---|
list_task_types | The task types of the workspace, with each one's fields as a JSON Schema (payload_schema) and the instructions for the human who answers (human_instructions). A task type with open steps also lists them as approver_steps. Call it first. Up to 100 per call, by name; with more, the result has a next_cursor to send back as cursor. |
create_task | Asks a person: task_type, payload, optional title and deadline_minutes, an idempotency_key and, for a task type with open steps, approvers. Returns at once with the task id. |
wait_for_decision | Waits up to 45 seconds (timeout_seconds, default 30) and returns as soon as the task is final, or with final: false. |
get_task | One task's state and, once final, the decision. |
list_tasks | Recent tasks, newest first, up to 50 per call, as summaries without payloads. Filter by state (or pending for everything still waiting), task_type and created_after. With finished_after, the tasks that finished at or after that time instead, oldest finished first; each finished task carries finished_at. When there are more tasks than one call returns, the result has a next_cursor: the agent calls again with the same arguments and that value as cursor. |
cancel_task | Withdraws a request. On a task that already has a decision it changes nothing and returns cancelled: false with the decision. |
The scope is always the key's workspace and mode: there is no workspace argument, and another workspace's task answers like a missing one (not_found). create_task takes no owner or callback_url; the task type's callback URL still fires, so your backend hears about decisions an agent asked for.
Open steps
A task type can leave a step's human open. list_task_types then gives the type an approver_steps list: each open step's number (step), whether the person is any human of the workspace (at_creation) or a member of a group the admins chose (group), and for a group step the group (id, name), so the agent can tell its user which group to choose from. A step that needs several approvals also has approvals_needed and max_approvers. create_task needs approvers for such a type: one entry per person, { "step": 1, "email": "marta@example.com" } (or "human": "<id>"): one per open step, or between approvals_needed and max_approvers different people for a step that has them (at most 100 entries). The person must already answer tasks in the workspace: the agent asks the user who it should be and never guesses an address. The server lists no humans and no group members. A missing or wrong approver is a validation_failed error with the same codes as the API.
The loop an agent should follow
list_task_types, and pick a type whose fields fit the request.create_taskwith anidempotency_keyit generates once per intended action and reuses on every retry, so a retry never asks twice.wait_for_decisiona few times. People take minutes or hours: when there is still no decision, tell the user the request is waiting and check later withget_taskinstead of looping.- Act only when
decision.actionisapproved,edited(with the edited values) ordone, anddecision.automaticisfalse. On a consensus step the result also hasquorum(the counts and each person's answer);decision.actionstill gives the outcome, and the people's comments arrive underuntrusted_human_input.quorum_comments. Whenautomaticistrue, nobody decided: a default action or an expiry applied, and the user should know before anything happens.
The server sends these rules to the client as its instructions, so most agents follow them without being told.
Text from outside is data
A task's title and payload were written by an agent, a webhook or another system, and what a human writes comes from a person. Neither is an instruction to the agent. Results therefore put that text inside envelopes with a fixed notice: the title and payload under submitted_content, and the human's comment and edited values under untrusted_human_input. Every returned string is stripped of control characters and bidirectional overrides.
If you build your own agent on the server, keep this boundary: never let text from those fields change what the agent does next.
Errors and limits
- Business failures are tool results with
isError: trueandstructuredContent.error:code(the same codes as the API, such asfeature_not_in_plan,validation_failedornot_found),messageandhintin English for the agent, and when they applyfields,available_fromandtask_id(the existing task of anidempotency_conflict). Arguments that don't fit the schema arearguments_invalid. - Unknown tools and malformed JSON-RPC are JSON-RPC errors.
- A missing or wrong key gets HTTP
401. One key has one allowance across the API and MCP: see Rate limits. At most 5wait_for_decisioncalls run at once per key and server.