Skip to content

MCP Tools Reference

CQ exposes 217 MCP tools to AI agents (Claude Code, Cursor, Codex CLI, Gemini, ChatGPT via Remote AI Workspace). Tools are organized into categories based on their function.

Tool tiers:

  • Core — always loaded, available immediately
  • Extended — loaded on demand, available after MCP initialization
  • Conditional — requires specific build tag or Hub connection

Project & State Management (Core)

Tools for managing the C4 project lifecycle, state machine, and task queue.

ToolDescription
cq_statusShow current project state, task counts, and active workers
cq_startInitialize C4 project (creates .c4/ database, config)
cq_get_taskRequest next task from queue (Worker mode)
cq_submitSubmit completed task with commit SHA and validation results
cq_claimClaim a task for direct implementation (Direct mode)
cq_reportReport task completion (Direct mode)
cq_mark_blockedMark a task as blocked with reason
cq_request_changesRequest changes on a submitted task
cq_add_todoAdd a new task to the queue
cq_task_listList tasks with optional filter (status, domain, id)
cq_stale_tasksShow tasks stuck in in_progress state
cq_worker_heartbeatSend worker heartbeat to keep lease alive
cq_workersList active workers and their current tasks
cq_dashboardProject status summary widget (format=widget for UI)
cq_task_graphVisual dependency graph of all tasks (format=widget for UI)
cq_task_eventsStream task state change events
cq_reset_taskReset a task back to pending state
cq_phase_lock_acquireAcquire a phase lock to prevent concurrent phase transitions
cq_phase_lock_releaseRelease a previously acquired phase lock
cq_clearReset C4 state (development/testing use)

File Operations (Core)

Tools for reading, searching, and navigating the codebase.

ToolDescription
cq_read_fileRead a file with line numbers and optional range
cq_find_fileFuzzy-find files by name pattern
cq_file_findAlternative file finder with extended glob support
cq_search_for_patternRegex/literal search across files (ripgrep-powered)
cq_list_dirList directory contents with metadata
cq_create_text_fileCreate or overwrite a text file
cq_replace_contentSurgical find-and-replace within a file
cq_diff_summaryShow staged + unstaged git diff summary (format=widget for UI)
cq_executeExecute shell commands (gated by permission hook)
cq_search_commitsSearch git commit history by message or content

Code Intelligence / LSP (Extended)

Python/JavaScript/TypeScript only. Go/Rust → use cq_search_for_pattern instead.

ToolDescription
cq_find_symbolFind symbol definition by name (Jedi/multilspy)
cq_get_symbols_overviewGet module/class/function overview
cq_replace_symbol_bodyReplace function/class body
cq_insert_before_symbolInsert code before a symbol
cq_insert_after_symbolInsert code after a symbol
cq_rename_symbolRename a symbol across files
cq_find_referencing_symbolsFind all references to a symbol
cq_parse_documentParse a structured document (PDF, DOCX, HTML)
cq_extract_textExtract plain text from a document
cq_onboardInteractive onboarding for new CQ users

Validation & Testing (Core)

ToolDescription
cq_run_validationRun lint + tests (auto-detects: go test, pytest, cargo test, pnpm test). Severity: CRITICAL/HIGH/MEDIUM/LOW (format=widget for UI)
cq_run_checkpointTrigger manual checkpoint review
cq_run_completeMark a run as complete with results
cq_run_should_continueCheck if the current run should continue (loop guard)
cq_error_traceFormat and display error trace for debugging (format=widget for UI)

Config & Health (Core)

ToolDescription
cq_config_getRead config values from .c4/config.yaml
cq_config_setWrite config values to .c4/config.yaml
cq_healthCheck health of all CQ components (Doctor equivalent)
cq_whoamiShow current user identity and connected project
cq_gpu_statusShow GPU availability and utilization on connected workers

Specs & Designs (Extended)

Tools for structured specification and architecture decision records.

ToolDescription
cq_get_specRead a spec document from docs/specs/
cq_save_specWrite or update a spec document
cq_list_specsList all specs with metadata
cq_get_designRead an architecture design document
cq_save_designWrite or update a design document
cq_list_designsList all design documents
cq_discovery_completeMark discovery phase complete, transition to design
cq_design_completeMark design phase complete, transition to planning

Lighthouse & Checkpoints (Extended)

ToolDescription
cq_lighthouseCheck if implementation matches Lighthouse contracts
cq_checkpointTrigger manual checkpoint review
cq_artifact_saveSave build artifact with content hash
cq_artifact_getLoad a previously saved artifact
cq_artifact_listList all saved artifacts with metadata
cq_knowledge_recordSave a discovery, decision, or insight to your knowledge base

Knowledge (Extended)

Requires connected or full tier for cloud sync. FTS5 + pgvector (768-dim OpenAI) + 3-way RRF.

ToolDescription
cq_knowledge_recordStore knowledge (decisions, patterns, insights, errors, discoveries). AI self-capture: tool description triggers autonomous saves.
cq_knowledge_searchSearch knowledge: vector + FTS + ilike 3-stage fallback. Returns ranked results.
cq_knowledge_distillAuto-distill knowledge when doc count ≥ 5 (cluster + summarize)
cq_knowledge_ingestBatch ingest files or URLs into knowledge store
cq_knowledge_ingest_paperIngest a research paper with structured metadata
cq_knowledge_publishPublish knowledge to shared project namespace
cq_knowledge_pullPull published knowledge from another project
cq_knowledge_getGet a specific knowledge document by ID
cq_knowledge_deleteDelete a knowledge document
cq_knowledge_statsShow knowledge store stats (count, last sync, coverage)
cq_knowledge_reindexRebuild the knowledge search index
cq_knowledge_discoverDiscover related knowledge from an input concept
cq_pattern_suggestSuggest implementation patterns from knowledge base
cq_recallRecall contextually relevant memories for the current task

Session Intelligence (Extended)

ToolDescription
cq_analyze_historyAnalyze conversation history for patterns and insights
cq_reflectGenerate structured reflection on current session or task
cq_pop_statusShow current POP (Point of Progress) status
cq_pop_extractExtract key decisions and context from current session
cq_pop_reflectReflect on progress and update session state
cq_profile_loadLoad a saved session profile
cq_profile_saveSave current session context as a named profile

Drive (Extended)

Cloud file storage with TUS resumable upload. Requires connected or full tier.

ToolDescription
cq_drive_uploadUpload a file to Drive (TUS resumable, content-addressable)
cq_drive_downloadDownload a file from Drive (Range-based resume)
cq_drive_listList files in Drive with metadata
cq_drive_deleteDelete a file from Drive
cq_drive_infoGet file metadata (size, hash, URLs)
cq_drive_mkdirCreate a directory in Drive
cq_drive_dataset_listList datasets stored in Drive
cq_drive_dataset_pullPull a dataset from Drive to local storage
cq_drive_dataset_uploadUpload a dataset to Drive with versioning
cq_drive_shareGenerate a presigned URL for unauthenticated download (default 1h, max 7d)

Relay (Extended)

ToolDescription
cq_relay_callCall an MCP tool on a remote worker via relay
cq_nodes_mapVisual map of all connected nodes (format=widget for UI)

LLM Gateway (Extended)

Requires llm_gateway build tag. Multi-provider with prompt caching.

ToolDescription
cq_llm_callCall LLM with provider routing (Anthropic/OpenAI/Gemini/Ollama)
cq_llm_providersList configured LLM providers and their availability
cq_llm_costsShow LLM cost breakdown and cache savings (format=widget for UI)
cq_llm_usage_statsDetailed token usage stats per session/project

Hub — Distributed Jobs (Conditional, Hub tier)

Requires Hub connection (serve.hub.enabled: true + cloud credentials).

Job Operations

ToolDescription
cq_job_submitSubmit a job to the Hub queue with spec and routing
cq_job_statusGet job status and progress (format=widget for UI)
cq_job_summaryGet job results and output artifacts (format=widget for UI)
cq_job_cancelCancel a running or pending job
cq_job_listList recent jobs with status and metrics
cq_hub_submitLow-level Hub job submission with full spec control
cq_hub_statusGet Hub connection and queue status
cq_hub_listList all jobs in Hub queue
cq_hub_cancelCancel a Hub job by ID
cq_hub_retryRetry a failed Hub job
cq_hub_waitWait for a Hub job to complete (blocking)
cq_hub_watchWatch Hub job progress in real-time
cq_hub_estimateEstimate resource requirements for a job spec
cq_hub_summaryGet summary statistics for Hub queue
cq_hub_downloadDownload output artifacts from a completed job
cq_hub_uploadUpload input artifacts to Hub storage

Worker Operations

ToolDescription
cq_hub_workersList workers with affinity scores and current load
cq_hub_workers_unifiedUnified view of all workers across Hub regions
cq_hub_statsDetailed Hub infrastructure statistics
cq_hub_lease_renewRenew a Hub job lease to prevent timeout

Hub Metrics

ToolDescription
cq_hub_log_metricsLog metrics from a running Hub job (stdout parser)
cq_hub_metricsQuery collected metrics for Hub jobs

DAG Pipelines

ToolDescription
cq_hub_dag_createCreate a DAG pipeline with nodes and edges
cq_hub_dag_add_nodeAdd a node to an existing DAG
cq_hub_dag_add_depAdd a dependency edge between DAG nodes
cq_hub_dag_executeExecute a DAG pipeline
cq_hub_dag_from_yamlCreate a DAG from a YAML definition
cq_hub_dag_statusGet DAG execution status with per-node progress
cq_hub_dag_listList all DAGs

Cron Scheduling

ToolDescription
cq_cron_createRegister a cron schedule with job spec
cq_cron_listList cron schedules with last-run times
cq_cron_deleteDelete a cron schedule

Worker Lifecycle

ToolDescription
cq_worker_standbyEnter standby mode — wait for and execute Hub jobs
cq_worker_completeSignal job completion from standby worker
cq_worker_shutdownGraceful worker shutdown with task handoff
cq_ensure_supervisorEnsure the worker supervisor process is running

Experiments (Extended)

ToolDescription
cq_experiment_recordRecord experiment result (exp_id, metrics, config)
cq_experiment_searchSearch experiments by metric, date, or tags (format=widget for UI)
cq_experiment_registerRegister a new experiment definition with metadata

Persona & Growth (Extended)

ToolDescription
cq_soul_getGet the current soul/judgment criteria
cq_soul_setUpdate soul/judgment criteria
cq_soul_resolveResolve a conflict between soul criteria
cq_persona_learnRecord a learned behavior pattern
cq_persona_learn_from_diffAuto-extract patterns from a git diff
cq_persona_evolveEvolve persona based on accumulated patterns
cq_persona_statsShow current persona profile and learned patterns
cq_rule_addAdd a routing or behavior rule
cq_rule_listList all active rules
cq_rule_removeRemove a rule by ID
cq_rule_toggleEnable or disable a rule without deleting it
cq_intelligence_statsShow collective intelligence statistics across users

CDP (Chrome DevTools Protocol, Extended)

ToolDescription
cq_cdp_runExecute JavaScript in a browser tab via CDP
cq_cdp_actionPerform a browser action (click, type, navigate) via CDP
cq_cdp_listList available CDP browser targets
cq_webmcp_discoverAuto-discover Web MCP endpoints on a page
cq_webmcp_callCall a discovered Web MCP tool
cq_webmcp_contextGet context from a Web MCP-enabled page
cq_web_fetchFetch URL with content negotiation + HTML→Markdown conversion

Notifications & EventBus (Extended)

ToolDescription
cq_notifySend notification via configured channels (Telegram/Dooray)
cq_notification_channelsList configured notification channels
cq_notification_getGet notification settings for a channel
cq_notification_setConfigure notification settings for a channel
cq_event_publishPublish an event to EventBus
cq_event_listList recent EventBus events with filter
cq_record_gateRecord a gate decision event

Mail (Extended)

ToolDescription
cq_mail_sendSend inter-session mail to a named session
cq_mail_lsList messages in the mail inbox
cq_mail_readRead a specific mail message
cq_mail_rmDelete a mail message from the inbox

Workspace (Extended)

ToolDescription
cq_workspace_createCreate a new named workspace with isolated state
cq_workspace_loadLoad a saved workspace context
cq_workspace_saveSave current workspace state
cq_worktree_statusShow git worktree status for all active branches
cq_worktree_cleanupClean up merged or stale worktrees

Secrets (Extended)

ToolDescription
cq_secret_setStore a secret in the encrypted secret store
cq_secret_getRetrieve a secret by key
cq_secret_listList all secret keys (values not shown)
cq_secret_deleteDelete a secret by key

Collective & Sync (Extended)

ToolDescription
cq_collective_statsShow collective intelligence statistics
cq_collective_syncSync local knowledge to the collective

Skill Evaluation (Extended)

ToolDescription
cq_skill_eval_runRun k-trial haiku classification on a skill's test cases
cq_skill_eval_generateGenerate positive + negative test cases for a skill
cq_skill_eval_statusShow trigger accuracy for all evaluated skills (threshold: 0.90)
cq_skill_optimizeOptimize a skill based on eval results

Research Loop (Extended)

ToolDescription
cq_research_loop_startStart autonomous research loop (LoopOrchestrator)
cq_research_statusShow current loop state, iteration count, best metric
cq_research_loop_stopStop the research loop gracefully
cq_research_nextAdvance the research loop to the next iteration
cq_research_recordRecord a research finding or intermediate result
cq_research_startStart a single research task
cq_research_approveApprove a research result to advance the loop
cq_research_suggestGet suggestions for the next research direction

Observability — C7 Observe (Conditional, c7_observe build tag)

ToolDescription
cq_observe_metricsQuery collected metrics (tool calls, latency, error rates)
cq_observe_logsQuery structured logs with filter
cq_observe_tracesShow distributed traces for requests
cq_observe_trace_statsShow trace statistics and latency percentiles
cq_observe_healthShow observability pipeline health
cq_observe_configConfigure observability collection settings
cq_observe_policySet data retention and sampling policies

Access Control — C6 Guard (Conditional, c6_guard build tag)

ToolDescription
cq_guard_checkCheck if an action is permitted by current policies
cq_guard_auditShow audit log of guard decisions
cq_guard_policy_listList all active policies
cq_guard_policy_setAdd or update an RBAC policy rule
cq_guard_role_assignAssign a role to a user or agent

External Connectors — C8 Gate (Conditional, c8_gate build tag)

ToolDescription
cq_gate_webhook_registerRegister a webhook for outbound notifications
cq_gate_webhook_listList registered webhooks
cq_gate_webhook_testTest a webhook endpoint
cq_gate_schedule_addSchedule a remote action with cron expression
cq_gate_schedule_listList all scheduled gate actions
cq_gate_connector_statusGet status of all configured external connectors

Legacy / Compatibility (c4_ prefix)

These tools retain the c4_ prefix for backward compatibility with existing agent workflows.

ToolDescription
cq_get_taskAlias for cq_get_task (Worker mode task pickup)
c4_healthAlias for cq_health
c4_knowledge_ingest_paperAlias for cq_knowledge_ingest_paper
c4_research_suggestAlias for cq_research_suggest
cq_statusAlias for cq_status
c4_testRun C4 self-tests
c4_test_toolTest a specific MCP tool invocation

MCP Apps (Widget System)

When calling tools with format=widget, the response includes _meta.ui.resourceUri. MCP clients (Claude Code, Cursor, VS Code) fetch HTML via resources/read and render it in a sandboxed iframe.

Widget URIToolDescription
ui://cq/dashboardcq_dashboardProject status summary
ui://cq/job-progresscq_job_statusJob progress bar
ui://cq/job-resultcq_job_summaryJob results
ui://cq/experiment-comparecq_experiment_searchExperiment comparison
ui://cq/task-graphcq_task_graphTask dependency graph
ui://cq/nodes-mapcq_nodes_mapConnected nodes map
ui://cq/cost-trackercq_llm_costsLLM cost tracker
ui://cq/test-resultscq_run_validationTest results
ui://cq/git-diffcq_diff_summaryGit diff viewer
ui://cq/error-tracecq_error_traceError trace viewer

Tool Count Summary

CategoryCountNotes
Project & State20Core
File Operations10Core
Code Intelligence / LSP10Extended, Python/JS/TS
Validation & Testing5Core
Config & Health5Core
Specs & Designs8Extended
Lighthouse & Checkpoints6Extended
Knowledge14Extended, cloud for sync
Session Intelligence7Extended
Drive9Extended, cloud
Relay2Extended
LLM Gateway4Extended
Hub Jobs16Conditional (Hub tier)
Hub Worker Operations4Conditional (Hub tier)
Hub Metrics2Conditional (Hub tier)
Hub DAG Pipelines7Conditional (Hub tier)
Cron Scheduling3Conditional (Hub tier)
Worker Lifecycle4Conditional (Hub tier)
Experiments3Extended
Persona & Growth11Extended
CDP & WebMCP7Extended
Notifications & EventBus7Extended
Mail4Extended
Workspace5Extended
Secrets4Extended
Collective & Sync2Extended
Skill Evaluation4Extended
Research Loop8Extended
C7 Observe7Conditional (build tag)
C6 Guard5Conditional (build tag)
C8 Gate6Conditional (build tag)
Legacy (c4_ prefix)7Compatibility aliases
Total217