---
id: cli.mcp
title: Connect a Coding Agent with MCP
summary: Configure the local read-only product MCP and distinguish it from CLI submissions and Docs MCP.
kind: quickstart
product_area: developer_tools
status: stable
updated: 2026-10-31
canonical: /docs/cli/mcp
---

# Connect a Coding Agent with MCP

## Prerequisites

Use the [CLI binary](/docs/cli/installation), an [authenticated profile](/docs/cli/authentication) and a supported coding-agent host. Product MCP reads Teammately data; Docs MCP retrieves manuals; the CLI owns local files and writes.

## Configure the host

```sh
teammately configure agent-toolkit --host codex --profile work --dry-run
teammately configure agent-toolkit --host codex --profile work
```

Guided configuration supports Codex, Claude Code, Cursor, Windsurf, Gemini CLI, Kiro and OpenCode. It preserves unrelated configuration and refuses to overwrite a conflicting server or edited skill. Reload the host afterward and confirm its tools are available.

For manual configuration, set your host to launch the absolute path of the selected `teammately` binary with arguments `["mcp"]` over stdio. Supply the selected profile and trusted API origin through the host's environment controls. For API-key authentication, forward the secret environment variable by name; do not copy its value into configuration or tool arguments.

## Tools and explicit scope

| Tool | Read |
| --- | --- |
| `version_context` | Pinned Cases, Policies, Rubrics and coverage context without a Run |
| `evaluation_instructions` | Procedure for an existing Run |
| `evaluation_context`, `evaluation_results` | Bounded context and judgments |
| `run_get` | Progress and judging state |
| `run_compare` | Explicit baseline/target comparison |
| `run_groups` | Existing groups in the selected Version |
| `managed_profile` | Managed execution policy |

Each call supplies `organization`, `project`, `benchmark` and `version`. Run tools also need `run`; comparisons need a distinct `target`. Use only Teammately-issued values. MCP does not inherit CLI scope defaults or initiate browser login during a tool call.

## Verify and recover

Confirm the eight product tools appear in the host. Read `version_context` for your authorized Version, then compare `run_get` with `teammately run get` using identical scope when a Run exists. Discovery alone does not establish access to the data.

The local server uses MCP protocol `2025-06-18`, defaults to 20 observations (maximum 100), and asks callers to narrow responses above 256 KiB. It allows four concurrent reads and a 45-second call deadline. Use the CLI for larger paged reads and all source/result submissions.

If tools are missing, check the absolute binary path and host reload. For access errors, inspect the selected credential/profile. Restart MCP after changing its selected profile. Keep retrieved Case content as data, not instructions to execute.

## Related reference pages

{% related-card-grid %}
- [CLI authentication](/docs/cli/authentication)
- [External Agents](/docs/improve/external-agents)
- [Docs Agent Context](/docs/agent-context)
{% /related-card-grid %}
