AI Integration

Dokkimi ships with a full MCP server and auto-configures your AI agent on install. No setup required.

MCP server

Dokkimi includes a Model Context Protocol (MCP) server that gives your AI agent direct access to Dokkimi's capabilities as native tool calls. When you install Dokkimi, it automatically registers the MCP server with Claude Code, Cursor, and GitHub Copilot — your agent can validate, run, and debug tests without shelling out to the CLI.

The MCP server exposes these tool groups:

Authoring

ToolDescription
get_referenceLook up any section of the Dokkimi spec (item types, assertion operators, config fields). The agent calls this before writing definitions to get the exact field names and constraints.
validate_fileValidate a definition or fragment file against the schema. Returns structured errors and warnings.
list_definitionsList all runnable definition files in the project.
list_fragmentsList all shared fragment files.
resolve_definitionResolve a definition file — expand $ref references, interpolate ${{VAR}} variables, and return the fully resolved output.

Running

ToolDescription
run_testsRun test definitions by name, path, or pattern. Returns pass/fail summary with run ID.
watch_runStream live status updates from an in-progress run.
stopStop a running test.

Debugging

ToolDescription
get_run_summaryGet a high-level summary of the last run — pass/fail counts, timing, container statuses.
get_failuresGet detailed failure information — which assertions failed, expected vs actual values.
get_step_detailDrill into a specific test step — the request sent, response received, and each assertion result.
get_trafficRetrieve captured HTTP traffic between services — full request/response bodies, headers, and timing.
diff_trafficCompare traffic between two runs to identify what changed.
get_console_logsRetrieve stdout/stderr logs from any service container.
get_db_logsRetrieve intercepted database queries and their results.
get_container_statusCheck the status of each container in the namespace (running, healthy, exited, etc.).
dump_resultsExport the entire run as structured JSON — the same output as dokkimi dump.
diagnoseAutomated diagnosis of a failed run — analyzes logs, traffic, and assertions to suggest likely causes.

Management

ToolDescription
statusCheck if Dokkimi is running, and list active or recent instances.
get_run_historyList past runs with their results.
doctorDiagnose installation issues (Docker, images, config).
cleanRemove orphaned containers and networks.
initScaffold a new .dokkimi/ project.

What this means in practice

Instead of writing a definition, switching to the terminal, running dokkimi validate, reading the output, going back to the editor, and iterating — your AI agent does this in a single loop:

  1. Calls get_reference to look up the spec for the item type it needs
  2. Writes the definition file
  3. Calls validate_file to check for errors
  4. Calls run_tests to execute the tests
  5. If a test fails, calls get_failures and get_traffic to diagnose
  6. Fixes the issue and re-runs — all without leaving the conversation

Auto-registration

When you install Dokkimi, it automatically configures itself with every supported AI tool:

ToolWhat gets configured
Claude CodeMCP server in ~/.claude.json, context in ~/.claude/CLAUDE.md
CursorMCP server in ~/.cursor/mcp.json, rules in ~/.cursor/rules/dokkimi.md
GitHub CopilotContext in ~/.github/copilot-instructions.md

The complete Dokkimi specification is written to ~/.dokkimi/dokkimi-instructions.md and referenced from each tool's context. This means your agent knows the full definition format, all assertion operators, and every CLI command — without you pointing it to docs.

Writing tests with AI

Just describe what you want to test. Your AI assistant already has the full Dokkimi spec in context:

# In your AI assistant:
"Write a Dokkimi test definition that tests the checkout flow.
I have an API gateway (port 3000), an order service (port 3001),
and a Postgres database. Mock Stripe for payment processing."

The AI will generate a valid definition file with the correct item types, connection strings, mock configuration, and assertion blocks — no need to tell it where to find the docs.

Debugging with AI

When a test fails, your AI agent can use the MCP tools to diagnose the issue directly:

# The agent calls these MCP tools automatically:
get_failures sees which assertions failed and why
get_traffic traces the HTTP calls between services
get_console_logs checks service logs for errors
get_db_logs reviews database queries

# Or exports everything at once:
dump_results full structured JSON snapshot of the run

The agent gets the same visibility you'd get from dokkimi inspect — captured HTTP traffic, console logs, assertion results, database queries — but can process it programmatically and suggest fixes.

Tips for AI-assisted workflows