How external AI clients (MCP clients, scripts, other tools) integrate with AITM via its MCP servers and REST/GraphQL API.

AITM MCP & API

MCP servers

AITM exposes two MCP servers:

  • aitm-core (35 tools) — projects (onboarding, list_projects, get_project_status), task CRUD (create_task, list_tasks, get_task, update_task, delete_task, search_tasks), lifecycle (run_task, stop_task, stop_project_tasks, stop_all_tasks, resume_task, skip_step, requeue_task — destructive, archive_task, restore_task, reorder_task), task data (get_task_result, get_task_console, get_task_logs, get_pipeline_status), prompt optimization (optimize_prompt, apply_optimization), archive search (search_archive), settings (get_settings, update_settings), license (license_status, license_activate, license_deactivate, license_upload_offline_token, license_remove_offline_token), and server_restart/server_stop.
  • aitm-extended (43 tools) — test environment (test_env_status, test_app_build, test_app_start, test_app_stop, test_project_pull, get_test_history), screenshots (get_screenshot_manifest, get_screenshot, get_screenshot_history), contracts (search_contracts, get_contract_detail, get_module_summary, find_precedent_tasks, get_danger_zones, investigate_variable, blast_radius, context_for, contracts_health, contracts_resync), docs & variables (search_docs, get_docs_for_variable, get_behavior_chain, search_variables, get_variable_tree, get_dom_page, search_dom), self-check (run_selfcheck) and backup (create_backup), conversations (list_conversations, get_conversation, delete_conversation), chat/brainstorm messaging (send_chat_message, send_brainstorm_message), skills (list_skills, skill_create, skill_list, skill_search, skill_get, skill_update, skill_delete), merge queue (get_merge_queue), resolve_conflict, and service health (get_service_health).

Transports: stdio (local, default for both servers) and Streamable HTTP on port 3335 (default, overridable with --mcp-port) with a mandatory bearer token (AITM_MCP_TOKEN or config.mcp.httpAuthToken, fail-closed — the server refuses to start in HTTP mode without it) and optional TLS (--tls-cert/--tls-key). Only aitm-core is registered in this repo's default .mcp.json (stdio); aitm-extended is launched separately (optionally with --http).

Example: connect an MCP client (stdio)

{
  "mcpServers": {
    "aitm-core": {
      "command": "npx",
      "args": ["tsx", "src/mcp/AitmCoreMcpServer.ts", "--rest-url", "http://localhost:3333"]
    }
  }
}

Example: remote MCP client (HTTP)

{
  "mcpServers": {
    "aitm-core-remote": {
      "url": "https://your-host:3335",
      "headers": { "Authorization": "Bearer <AITM_MCP_TOKEN>" }
    }
  }
}

REST API

Base http://localhost:3333, JSON. Ports: 3333 REST/GraphQL/UI, 3334 HTTPS, 3335 MCP Streamable HTTP.

EndpointPurpose
GET /api/onboardingAgent self-init
GET /api/tasksList tasks (projectId?, limit?)
GET /api/tasks/allPaginated/filterable task list
POST /api/tasksCreate a task
POST /api/tasks/chainCreate a chain of dependent tasks
GET /api/tasks/:idTask detail
PATCH /api/tasks/:idPartially update a task
DELETE /api/tasks/:idPermanently delete a task
POST /api/tasks/:id/runStart a pending task
POST /api/tasks/:id/stopStop a single task
POST /api/tasks/stop-allGlobal stop (optional tabId/projectId filter)
POST /api/projects/:projectId/tasks/stop-allStop all tasks for one project
POST /api/tasks/:id/resumeResume a failed/stopped/conflict task
POST /api/tasks/:id/skipSkip a specific pipeline step
POST /api/tasks/:id/archiveArchive a finished task
POST /api/tasks/:id/restoreRestore an archived task (rejected if the branch is already merged/gone)
POST /api/tasks/:id/requeue, /reorderRequeue / change queue order
GET /api/tasks/:id/result|console|logs|pipelineTask result, console output, logs, and pipeline state
GET /api/archiveSearch archived tasks
GET /api/statusTab/project status (stale-while-revalidate cache)
GET /api/projectsList tabs/projects
GET/PUT/PATCH /api/settingsRead and update settings
POST /api/backup/createCreate a backup
GET /api/merge/queueMerge queue state
GET /api/service-healthMonitored service health
GET /api/versionServer version (semver, build date, release mode)
GET /api/license/statusLicense status
POST /api/license/activateActivate a license (licenseKey, instanceLabel, email)
POST /api/server/restart|stopRestart or stop the server
POST /graphqlKnowledge endpoint — contracts, variables, docs

This is a curated set of the most-used endpoints, not the full list — the REST API has over 100 endpoints across src/rest/RestApi.ts and dedicated routers (skills, contracts, DOM tags, i18n, screenshots, test infrastructure, releases, and more).

Parameter reference — most-used operations

OperationParameters
POST /api/taskstabId, projectId, title (≤ 60 chars), prompt (≤ 50 KB), optional priority (low|medium|high, default medium), useWorktree/usePipeline/autoMergeDev (default true), skipSteps, dependsOn, overridePreFlight
POST /api/tasks/chainan array of objects with the same shape as POST /api/tasks — each subsequent item automatically gets dependsOn:[previous id]
POST /api/tasks/:id/stopreason?
POST /api/tasks/:id/resumefromStepIndex?, instructions?, skipSteps? — without fromStepIndex, the first failed/stopped step is auto-detected
POST /api/tasks/:id/skipstepIndex or stepName (one required) — the step must be pending, or failed/stopped on a non-running task
POST /api/tasks/:id/archiveforce?, reason? — only from statuses finished/stopped/failed/conflict
POST /api/tasks/:id/restoreno body — archived tasks only; 409 if the branch is already merged or branch-missing
MCP toolParameters
create_tasktitle, prompt, tabId, projectId (required), optional priority, useWorktree, usePipeline, autoMergeDev, skipSteps[], dependsOn[]
list_tasksstatus?, tabId?, projectId?
get_taskid
run_taskid
resume_taskid, optional fromStepIndex, instructions, skipSteps

Example: create a task

curl -X POST http://localhost:3333/api/tasks \
  -H 'Content-Type: application/json' \
  -d '{"title":"Fix auth bug","prompt":"READ CLAUDE.md first...","tabId":"ctm","projectId":"ctm-dashboard","priority":"high","useWorktree":true,"usePipeline":true,"autoMergeDev":true}'

Note: title max 60 chars, prompt max 50 KB; defaults useWorktree/usePipeline/autoMergeDev are true, default priority is medium.

Example: a chain of dependent tasks

curl -X POST http://localhost:3333/api/tasks/chain \
  -H 'Content-Type: application/json' \
  -d '[
    {"title":"Add DB column","prompt":"...","tabId":"ctm","projectId":"ctm-dashboard"},
    {"title":"Use column in API","prompt":"...","tabId":"ctm","projectId":"ctm-dashboard"}
  ]'

The second task waits until the first merges into dev, since each subsequent item automatically gets dependsOn:[previous id].

Example: stopping and resuming a task

curl -X POST http://localhost:3333/api/tasks/42/stop \
  -H 'Content-Type: application/json' -d '{"reason":"manual stop"}'

curl -X POST http://localhost:3333/api/tasks/42/resume \
  -H 'Content-Type: application/json' -d '{}'

Give your AI one URL

Instead of explaining AITM to an external AI by hand, give it one address. AITM serves a public, read-only text guide that tells the AI what AITM is and how to talk to it.

URLWhat it returns
http://<your-aitm-host>:3333/aiEntry point and dispatcher (also /AI, case-insensitive)
http://<your-aitm-host>:3333/ai/claudeGuide tuned for Claude
http://<your-aitm-host>:3333/ai/geminiGuide tuned for Gemini
http://<your-aitm-host>:3333/ai/deepseekGuide tuned for DeepSeek
http://<your-aitm-host>:3333/ai/openaiGuide tuned for OpenAI
http://<your-aitm-host>:3333/ai/genericGuide for any other AI
http://<your-aitm-host>:3333/ai/topic/<topic>One topic only: tasks, chat, pipeline-status, data-api, mcp, connect-and-auth or rules

The guide pages are public read-only text. Every /api/* and /graphql call still needs the AITM token or LAN trust.

What an external AI does with it

Create a task

Queues work in the pipeline. Quote the heredoc delimiter so no shell escaping can corrupt the JSON.

curl -X POST http://<your-aitm-host>:3333/api/tasks \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'AITM_JSON'
{"title":"Fix auth bug","prompt":"READ CLAUDE.md first...","tabId":"ctm","projectId":"ctm-dashboard"}
AITM_JSON

Send a chat message

Talks to the AITM chat agent without opening the UI. Use the MCP tool; the exact argument names are in its schema.

# MCP tool (aitm-extended): send_chat_message
# pass the arguments exactly as listed in the tool's own schema

Read pipeline status

Shows what is running right now so the AI knows when to wait or report back.

curl -s http://<your-aitm-host>:3333/api/status

Query data over GraphQL

Reads contracts, variables and other project data directly, again via a quoted heredoc.

curl -s http://<your-aitm-host>:3333/graphql \
  -H 'Content-Type: application/json' \
  --data-binary @- <<'AITM_JSON'
{"query":"{ contracts(projectId: \"ctm-dashboard\") { id } }"}
AITM_JSON

Tips

  • For local integration (same machine), use the stdio transport — it's simpler and doesn't require a token.
  • For remote access, always set AITM_MCP_TOKEN — the server is fail-closed without it and refuses to start in HTTP mode.
  • Prefer the aitm-extended tools over calling /graphql by hand for contract and variable discovery.
  • GET /api/status responds instantly from cache and refreshes in the background — don't assume it always reflects the very latest state.