Skip to main content

MCP Server

ado-sync ships a built-in MCP (Model Context Protocol) server that exposes its sync operations as structured tools for AI agents — Claude Code, GitHub Copilot, Visual Studio Agent Application, Codex, Cursor, and any other MCP-compatible host.

Using the MCP server instead of spawning the CLI gives agents:

  • Typed JSON responses (no output parsing)
  • Structured error objects with status codes
  • Fine-grained tool calls (get one test case, push a subset, etc.)

Installation

No separate install needed. ado-sync-mcp ships inside the ado-sync npm package.

Option A — Global install (recommended, fastest startup)

npm install -g ado-sync

Option B — npx (no install, always latest)

Use npx --yes --package=ado-sync ado-sync-mcp as the command in all configs below. npx downloads and runs the package automatically on first use.


Host compatibility matrix

Use this table when wiring ado-sync-mcp into a new AI host.

HostConfig shapeServer commandRequired envVerify step
Claude Code / Claude DesktopmcpServersnpx --yes --package=ado-sync ado-sync-mcpAZURE_DEVOPS_TOKEN, absolute ADO_SYNC_CONFIGRun /mcp, then call validate_config
VS Code (GitHub Copilot agent mode)servers + type: "stdio"npx --yes --package=ado-sync ado-sync-mcpAZURE_DEVOPS_TOKEN, ADO_SYNC_CONFIGConfirm server in MCP list, then call validate_config
Visual Studio Agent Applicationhost MCP settings for a stdio servernpx --yes --package=ado-sync ado-sync-mcpAZURE_DEVOPS_TOKEN, ADO_SYNC_CONFIGConfirm server loads, then call validate_config
Codex CLI / Codex Agentshost MCP settings for a stdio servernpx --yes --package=ado-sync ado-sync-mcpAZURE_DEVOPS_TOKEN, absolute ADO_SYNC_CONFIGConfirm server appears in MCP tools, then call validate_config
CursormcpServersnpx --yes --package=ado-sync ado-sync-mcpAZURE_DEVOPS_TOKEN, absolute ADO_SYNC_CONFIGConfirm MCP server is active, then call validate_config

Standard post-registration flow for all hosts:

  1. Call validate_config.
  2. Call status (safe read-only drift check).
  3. Run push_specs with dryRun: true before any write operation.

Claude Code — one-liner registration

# With global install
claude mcp add ado-sync \
--env AZURE_DEVOPS_TOKEN="$AZURE_DEVOPS_TOKEN" \
--env ADO_SYNC_CONFIG="$(pwd)/ado-sync.json" \
-- ado-sync-mcp

# With npx (no global install required)
claude mcp add ado-sync \
--env AZURE_DEVOPS_TOKEN="$AZURE_DEVOPS_TOKEN" \
--env ADO_SYNC_CONFIG="$(pwd)/ado-sync.json" \
-- npx --yes --package=ado-sync ado-sync-mcp

Verify it registered: run /mcp in Claude Code — ado-sync should appear in the list.

Manual config~/.claude/claude_desktop_config.json:

{
"mcpServers": {
"ado-sync": {
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "<your-pat>",
"ADO_SYNC_CONFIG": "/absolute/path/to/ado-sync.json"
}
}
}
}

Claude Desktop

Config file location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"ado-sync": {
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "<your-pat>",
"ADO_SYNC_CONFIG": "/absolute/path/to/ado-sync.json"
}
}
}
}

Restart Claude Desktop after saving.


VS Code (GitHub Copilot agent mode)

Create .vscode/mcp.json in your workspace root:

{
"servers": {
"ado-sync": {
"type": "stdio",
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "${env:AZURE_DEVOPS_TOKEN}",
"ADO_SYNC_CONFIG": "${workspaceFolder}/ado-sync.json"
}
}
}
}

${env:AZURE_DEVOPS_TOKEN} reads the variable from your shell environment — no hardcoded secrets.


Visual Studio Agent Application (Preview)

If your Visual Studio Agent Application build exposes MCP registration, add ado-sync-mcp as a stdio server. The exact config surface may change while the product is in preview, so treat the block below as a template and adapt field names to the host UI/schema:

{
"servers": {
"ado-sync": {
"type": "stdio",
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "${env:AZURE_DEVOPS_TOKEN}",
"ADO_SYNC_CONFIG": "${workspaceFolder}/ado-sync.json"
}
}
}
}

Use an absolute path for ADO_SYNC_CONFIG if the host does not support ${workspaceFolder}-style substitution.


Codex CLI / Codex Agents

If your Codex host exposes MCP settings, add ado-sync as a stdio server using a config block like this:

{
"mcpServers": {
"ado-sync": {
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "<your-pat>",
"ADO_SYNC_CONFIG": "/absolute/path/to/ado-sync.json"
}
}
}
}

The exact settings file path and top-level key are host-dependent; use this as a template for the Codex MCP configuration surface your environment provides.


Cursor

~/.cursor/mcp.json:

{
"mcpServers": {
"ado-sync": {
"command": "npx",
"args": ["--yes", "--package=ado-sync", "ado-sync-mcp"],
"env": {
"AZURE_DEVOPS_TOKEN": "<your-pat>",
"ADO_SYNC_CONFIG": "/absolute/path/to/ado-sync.json"
}
}
}
}

Verify it works

After registration, ask your AI assistant:

"Call ado-sync validate_config and tell me what it returns"

Expected response includes config validity, Azure connection status, and test plan confirmation.


Available tools

ToolDescription
validate_configCheck config validity and Azure DevOps connectivity
get_test_casesList all Test Cases in a suite
get_test_caseGet a single Test Case by ID
push_specsPush local spec files to Azure DevOps
pull_specsPull Azure DevOps changes into local files
statusShow diff between local and Azure without making changes
diffShow field-level diff (richer than status)
generate_specsGenerate local spec files from ADO User Stories (AI-powered or template)
get_work_itemsFetch ADO User Stories / work items
publish_test_resultsPublish TRX / JUnit / Playwright JSON / CTRF results; optionally file issues for failures
create_issueFile a single GitHub Issue or ADO Bug for a test failure (for healer agents)
get_story_contextPlanner-agent feed: AC items, suggested tags, actors, linked TC IDs
generate_manifestWrite .ai-workflow-manifest-{id}.json for the full Planner→CI cycle
find_tagged_itemsFind work items where a tag was added in the last N hours/days (exact timestamp via revisions API)

Tool parameters

All tools accept these optional base parameters:

ParameterTypeDescription
configPathstringAbsolute path to ado-sync.json (overrides ADO_SYNC_CONFIG)
configOverridesstring[]Runtime overrides in key=value format (same as --config-override)

push_specs

{
"dryRun": false,
"tags": "@smoke and not @wip",
"aiProvider": "heuristic"
}

generate_specs

{
"storyIds": [1234, 5678],
"format": "gherkin",
"outputFolder": "specs/generated",
"dryRun": false,
"force": false,
"aiProvider": "anthropic",
"aiModel": "claude-sonnet-4-6",
"aiKey": "$ANTHROPIC_API_KEY",
"aiContext": ["src/orders/**", "tests/orders/**", "docs/orders.md"]
}

AI provider options: local, ollama, openai, anthropic, huggingface, bedrock, azureai. Falls back to sync.ai config when not supplied. When dryRun: true and an AI provider is set, the first 20 lines of generated content are included in the tool response as a preview.

aiContext is optional and accepts files, folders, or globs. Prefer a small feature-specific slice of the repo: relevant app code, existing automation, and one or two docs files. Avoid the whole workspace.

publish_test_results

{
"testResult": "results/playwright.json",
"attachmentsFolder": "test-results/",
"createIssuesOnFailure": true,
"issueProvider": "github",
"githubRepo": "myorg/myrepo",
"githubToken": "$GITHUB_TOKEN",
"bugThreshold": 20,
"maxIssues": 50
}

create_issue

{
"title": "[FAILED] Login with valid credentials",
"body": "Error: Expected 200 but got 401\n\nStack: ...",
"provider": "github",
"githubRepo": "myorg/myrepo",
"githubToken": "$GITHUB_TOKEN",
"testCaseId": 1234
}

get_story_context

{ "storyId": 1234 }

Returns: AC items as a bullet list, inferred tags (@smoke, @auth, …), extracted actors, and IDs of any Test Cases already linked via TestedBy relation.

generate_manifest

{
"storyIds": [1234, 5678],
"outputFolder": "e2e/bdd",
"format": "gherkin",
"dryRun": false
}

Writes .ai-workflow-manifest-1234.json in outputFolder. The manifest contains the ordered 8-step workflow, AC items, required documents checklist, and validation steps.

find_tagged_items

{
"tag": "regression",
"hours": 24
}
{
"tag": "sprint-42",
"days": 7,
"workItemType": "Bug"
}
ParameterTypeDescription
tagstringRequired. Tag to search for
hoursnumberTime window in hours
daysnumberTime window in days (mutually exclusive with hours)
workItemTypestringWork item type (default: "User Story")

Returns per item: id, title, state, tagAddedAt (ISO timestamp), tagAddedBy, tagAddedRevision, currentTags, url.

Uses the revisions API — finds the exact revision where the tag first appeared, not just when the item was last changed.


Example agent workflow

Once registered, an AI agent can orchestrate the full test lifecycle without any human CLI invocation:

Agent: "Set up ado-sync for this repo"
→ calls validate_config to check connectivity
→ calls push_specs({ dryRun: true }) to preview
→ calls push_specs({}) to create Test Cases

Agent: "Generate spec files for User Story 1234"
→ calls generate_specs({ storyIds: [1234], format: "gherkin" })

Agent: "Publish the latest test results and file issues for failures"
→ calls publish_test_results({ testResult: "results/playwright.json", createIssuesOnFailure: true, githubRepo: "myorg/myrepo", githubToken: "$GITHUB_TOKEN" })
→ returns issue URLs for any failures → healer agent opens fix PRs

Environment variables

VariableDescription
ADO_SYNC_CONFIGAbsolute path to config file (default: ado-sync.json in cwd)
AZURE_DEVOPS_TOKENPAT or access token (referenced by auth.token in config)

Important: ADO_SYNC_CONFIG must be an absolute path. The MCP server process does not inherit the shell's working directory the same way as a CLI call.