MCP Tools Reference

Domscribe exposes 12 tools and 4 prompts via the Model Context Protocol. Any MCP-compatible coding agent can use these tools to query runtime context, resolve source locations, and process annotations.

The MCP server communicates over stdio and connects to the Domscribe relay daemon running on localhost. The relay must be running (it starts automatically with your dev server) for the tools to function.

Configuration

Add the MCP server to your agent configuration:

{
  "mcpServers": {
    "domscribe": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@domscribe/mcp"]
    }
  }
}

Source Query Tools

These tools let the agent query source locations and retrieve live runtime context from the running browser.

domscribe.query.bySource

Query a source file and line number to get live runtime context from the browser (props, state, DOM snapshot).

Input:

ParameterTypeRequiredDescription
filestringYesAbsolute file path as stored in the manifest
linenumberYesLine number (1-indexed)
columnnumberNoColumn number (0-indexed)
tolerancenumberNoMax line distance to consider (default: 0)
includeRuntimebooleanNoQuery live runtime context via WebSocket (default: true)

Response:

{
  "sourceLocation": {
    "file": "src/components/Button.tsx",
    "line": 12,
    "column": 4,
    "componentName": "Button",
    "tagName": "button"
  },
  "runtime": {
    "componentProps": { "variant": "secondary", "onClick": "[Function]" },
    "componentState": { "hook_0": false, "hook_1": "idle" },
    "domSnapshot": {
      "tagName": "button",
      "attributes": { "class": "btn-secondary", "type": "submit" },
      "innerText": "Save changes"
    }
  },
  "browserConnected": true
}

The runtime field is only present when a browser client is connected via WebSocket and includeRuntime is true.

domscribe.manifest.query

Find manifest entries by file path, component name, or element ID.

Input:

ParameterTypeRequiredDescription
filestringNoFilter by file path
componentNamestringNoFilter by component name
idstringNoFilter by specific element ID

At least one parameter must be provided.

domscribe.manifest.stats

Returns manifest coverage statistics.

Response fields:

FieldTypeDescription
entryCountnumberTotal manifest entries
fileCountnumberNumber of unique source files
componentCountnumberNumber of unique component names
cacheHitRatenumberIDStabilizer cache hit rate (0-1)

Element Resolution Tools

Resolve data-ds element IDs (injected at build time) back to their source locations.

domscribe.resolve

Resolve a single data-ds element ID to its ManifestEntry.

Input:

ParameterTypeRequiredDescription
idstringYesThe data-ds element ID

Response:

{
  "found": true,
  "entry": {
    "id": "A1B2C3D4",
    "file": "src/components/Button.tsx",
    "start": { "line": 12, "column": 4 },
    "end": { "line": 12, "column": 42 },
    "tagName": "button",
    "componentName": "Button"
  }
}

domscribe.resolve.batch

Resolve multiple element IDs in one call.

Input:

ParameterTypeRequiredDescription
idsstring[]YesArray of data-ds element IDs

Returns an array of resolved entries.


Annotation Workflow Tools

Annotations are created when a developer clicks an element in the overlay and describes a change. These tools drive the agent-side processing loop.

domscribe.annotation.process

Atomically claim the next queued annotation. This prevents concurrent agent conflicts by transitioning the annotation from QUEUED to PROCESSING in a single operation.

Input: No parameters required.

Response:

{
  "found": true,
  "annotationId": "ann_A1B2C3D4_1710500000",
  "userIntent": "Make this button use the primary color from the design system",
  "element": {
    "tagName": "button",
    "dataDs": "A1B2C3D4",
    "selector": "main > div > button",
    "attributes": { "class": "btn-secondary", "type": "submit" },
    "innerText": "Save changes"
  },
  "sourceLocation": {
    "file": "src/components/Button.tsx",
    "line": 12,
    "column": 4,
    "componentName": "Button",
    "tagName": "button"
  },
  "runtimeContext": {
    "componentProps": { "variant": "secondary", "onClick": "[Function]" },
    "componentState": { "hook_0": false, "hook_1": "idle" }
  }
}

Returns { "found": false } when no queued annotations are available.

domscribe.annotation.respond

Attach the agent's response to an annotation and transition it to PROCESSED.

Input:

ParameterTypeRequiredDescription
idstringYesAnnotation ID (ann_*)
responsestringYesAgent's response text

domscribe.annotation.updateStatus

Manually transition an annotation's status.

Input:

ParameterTypeRequiredDescription
idstringYesAnnotation ID
statusstringYesTarget status: QUEUED, PROCESSING, PROCESSED, FAILED, or ARCHIVED

domscribe.annotation.get

Retrieve a single annotation by ID.

Input:

ParameterTypeRequiredDescription
idstringYesAnnotation ID

domscribe.annotation.list

List annotations with optional status filtering.

Input:

ParameterTypeRequiredDescription
statusstringNoFilter by status (e.g. QUEUED)

domscribe.annotation.search

Full-text search across annotation content.

Input:

ParameterTypeRequiredDescription
querystringYesSearch query text

System Tools

domscribe.status

Returns relay daemon health, manifest stats, and annotation queue counts.

Response fields:

FieldTypeDescription
relayRunningbooleanWhether the relay daemon is healthy
browserConnectedbooleanWhether a browser client is connected
manifestStatsobjectEntry count, file count, component count
queueCountsobjectAnnotation counts by status

MCP Prompts

Pre-built prompts that guide agents through common Domscribe workflows. These are exposed as MCP prompt resources that agents can invoke.

process_next

Guides the agent through the complete annotation processing workflow: claim the next queued annotation, navigate to the source file, implement the change, and respond with a summary.

check_status

Checks the relay daemon status, manifest statistics, and queue counts. Useful for verifying the system is healthy before starting work.

explore_component

Deep-dive into a specific component's metadata. Queries the manifest and runtime context to build a complete picture of a component's props, state, and DOM output.

find_annotations

Searches for annotations matching specific criteria. Useful for discovering pending work or finding annotations related to a particular component or file.