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), andserver_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.
| Endpoint | Purpose |
|---|---|
GET /api/onboarding | Agent self-init |
GET /api/tasks | List tasks (projectId?, limit?) |
GET /api/tasks/all | Paginated/filterable task list |
POST /api/tasks | Create a task |
POST /api/tasks/chain | Create a chain of dependent tasks |
GET /api/tasks/:id | Task detail |
PATCH /api/tasks/:id | Partially update a task |
DELETE /api/tasks/:id | Permanently delete a task |
POST /api/tasks/:id/run | Start a pending task |
POST /api/tasks/:id/stop | Stop a single task |
POST /api/tasks/stop-all | Global stop (optional tabId/projectId filter) |
POST /api/projects/:projectId/tasks/stop-all | Stop all tasks for one project |
POST /api/tasks/:id/resume | Resume a failed/stopped/conflict task |
POST /api/tasks/:id/skip | Skip a specific pipeline step |
POST /api/tasks/:id/archive | Archive a finished task |
POST /api/tasks/:id/restore | Restore an archived task (rejected if the branch is already merged/gone) |
POST /api/tasks/:id/requeue, /reorder | Requeue / change queue order |
GET /api/tasks/:id/result|console|logs|pipeline | Task result, console output, logs, and pipeline state |
GET /api/archive | Search archived tasks |
GET /api/status | Tab/project status (stale-while-revalidate cache) |
GET /api/projects | List tabs/projects |
GET/PUT/PATCH /api/settings | Read and update settings |
POST /api/backup/create | Create a backup |
GET /api/merge/queue | Merge queue state |
GET /api/service-health | Monitored service health |
GET /api/version | Server version (semver, build date, release mode) |
GET /api/license/status | License status |
POST /api/license/activate | Activate a license (licenseKey, instanceLabel, email) |
POST /api/server/restart|stop | Restart or stop the server |
POST /graphql | Knowledge 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
| Operation | Parameters |
|---|---|
POST /api/tasks | tabId, 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/chain | an array of objects with the same shape as POST /api/tasks — each subsequent item automatically gets dependsOn:[previous id] |
POST /api/tasks/:id/stop | reason? |
POST /api/tasks/:id/resume | fromStepIndex?, instructions?, skipSteps? — without fromStepIndex, the first failed/stopped step is auto-detected |
POST /api/tasks/:id/skip | stepIndex or stepName (one required) — the step must be pending, or failed/stopped on a non-running task |
POST /api/tasks/:id/archive | force?, reason? — only from statuses finished/stopped/failed/conflict |
POST /api/tasks/:id/restore | no body — archived tasks only; 409 if the branch is already merged or branch-missing |
| MCP tool | Parameters |
|---|---|
create_task | title, prompt, tabId, projectId (required), optional priority, useWorktree, usePipeline, autoMergeDev, skipSteps[], dependsOn[] |
list_tasks | status?, tabId?, projectId? |
get_task | id |
run_task | id |
resume_task | id, 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 '{}'
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-extendedtools over calling/graphqlby hand for contract and variable discovery. GET /api/statusresponds instantly from cache and refreshes in the background — don't assume it always reflects the very latest state.