Docs / MCP Server

MCP Server

Give AI agents durable task execution through the Model Context Protocol.

Overview

The Model Context Protocol (MCP) is a standard for connecting AI agents to external tools. Tasked implements MCP over stdio using JSON-RPC 2.0 with Content-Length framing (LSP-style).

This lets agents submit long-running DAG workflows, continue working on other tasks, and check back for results later. The agent never blocks waiting for a shell command to finish — Tasked handles execution, retries, and dependency resolution in the background.

Starting the MCP Server

tasked-server mcp --data-dir tasked-data

The server reads JSON-RPC messages from stdin and writes responses to stdout. Logs go to stderr so they don't interfere with the protocol.

Claude Desktop

Add this to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "tasked": {
      "command": "tasked-server",
      "args": ["mcp", "--data-dir", "tasked-data"]
    }
  }
}

Claude Code

Add to your project's .mcp.json:

{
  "mcpServers": {
    "tasked": {
      "command": "tasked-server",
      "args": ["mcp", "--data-dir", "tasked-data"]
    }
  }
}

Tools Reference

Tasked exposes eight MCP tools. Each tool auto-creates queues as needed, so agents can submit workflows without any setup.

tasked_submit_flow

Submit a DAG workflow for execution. Tasks run concurrently where dependencies allow. Auto-creates the queue if it doesn't exist.

ParameterTypeRequiredDescription
queuestringyesQueue name (created automatically if it doesn't exist)
tasksarrayyesArray of task definitions forming the DAG
webhooksobjectnoOptional { on_complete, on_failure } URLs for flow-level webhook notifications
queue_configobjectnoQueue configuration (only used when creating a new queue)

Each task in the tasks array accepts:

FieldTypeRequiredDescription
idstringyesUnique task identifier within the flow
executorstringyesExecutor type: shell, http, or noop
configobjectnoExecutor-specific configuration
inputanynoOptional input data for the task
depends_onstring[]noTask IDs this task depends on
timeout_secsintegernoTimeout in seconds (default: queue default)
retriesintegernoMax retry count (default: queue default)

The optional queue_config object accepts:

FieldTypeDefaultDescription
concurrencyinteger10Max concurrent tasks
max_retriesinteger3Default max retries
timeout_secsinteger300Default task timeout in seconds

Returns the flow ID, queue, state, and task count.

tasked_flow_status

Check the status of a submitted flow, including per-task state and outputs.

ParameterTypeRequiredDescription
flow_idstringyesThe flow ID returned by tasked_submit_flow

Returns the flow state, task counts, and an array of per-task statuses with their outputs and errors.

tasked_task_output

Get the output or error of a specific task within a flow.

ParameterTypeRequiredDescription
flow_idstringyesThe flow ID
task_idstringyesThe task ID within the flow

Returns the task state, output JSON, and error message (if any).

tasked_list_flows

List active and recent flows, optionally filtered by state.

ParameterTypeRequiredDescription
queuestringyesFilter by queue name
statestringnoFilter by state: running, succeeded, failed, cancelled

Returns the queue name, count, and an array of flow summaries.

tasked_cancel_flow

Cancel a running flow and all its non-terminal tasks.

ParameterTypeRequiredDescription
flow_idstringyesThe flow ID to cancel

Returns a confirmation message on success.

tasked_create_schedule

Create a cron schedule that automatically submits a flow to a queue on a recurring basis.

ParameterTypeRequiredDescription
queuestringyesQueue to submit flows to
cronstringyesCron expression (5-field or 7-field with seconds)
flowobjectyesFlowDef to submit on each trigger (same schema as tasked_submit_flow)

Returns the schedule ID, queue, cron expression, and creation timestamp.

tasked_list_schedules

List all schedules for a queue.

ParameterTypeRequiredDescription
queuestringyesQueue to list schedules for

Returns an array of schedule summaries including ID, cron expression, and last/next fire times.

tasked_delete_schedule

Delete a schedule by ID.

ParameterTypeRequiredDescription
schedule_idstringyesThe schedule ID to delete

Returns a confirmation message on success.

Integration Examples

Agent workflow

A typical agent interaction with Tasked follows this pattern: submit a flow, continue working, then check back for results.

// 1. Agent submits a workflow
tasked_submit_flow({
  "queue": "agent-tasks",
  "tasks": [
    {
      "id": "fetch-data",
      "executor": "http",
      "config": {
        "url": "https://api.example.com/data",
        "method": "GET"
      }
    },
    {
      "id": "process",
      "executor": "shell",
      "config": { "command": "python3 process.py" },
      "depends_on": ["fetch-data"]
    }
  ]
})
// Returns: { "flow_id": "f_abc123", "state": "running", ... }

// 2. Agent checks status later
tasked_flow_status({ "flow_id": "f_abc123" })
// Returns: { "state": "succeeded", "tasks": [...] }

// 3. Agent retrieves specific task output
tasked_task_output({
  "flow_id": "f_abc123",
  "task_id": "process"
})
// Returns: { "state": "succeeded", "output": {...} }
On this page