---
title: "MCP servers for coordinating coding agents: what they are and how to use one · Cork"
description: "What an MCP server for coordinating coding agents does, how it differs from hooks, and how to connect one to Claude Code, Codex, Cursor and Gemini CLI."
canonical: "https://corkcli.com/blog/mcp-servers-coordinating-coding-agents"
last_updated: "2026-10-03"
published: "2026-10-03"
author: "Kevin Vera"
---

# MCP servers for coordinating coding agents: what they are and how to use one

What an MCP server for coordinating coding agents does, how it differs from hooks, and how to connect one to Claude Code, Codex, Cursor and Gemini CLI.

By Kevin Vera · October 3, 2026 · [Guides](https://corkcli.com/blog/c/guides) · 6 min read

An MCP server for coordinating coding agents is a shared service that several agents (Claude Code, Codex, Cursor, Gemini CLI or any other MCP client) connect to at the same time, so they can see what the others are doing: who is editing which files or functions, what changed recently, and messages addressed to them. You use one by adding the same server URL to each agent's MCP configuration, then telling the agents in their instruction file when to call its tools. The catch is that MCP tools only run when an agent decides to call them, so the strongest setups pair the server with hooks that run automatically.

## What MCP is, in one paragraph

The Model Context Protocol is, in its own docs' words, "an open-source standard for connecting AI applications to external systems." An AI application (the host, such as Claude Code) creates one MCP client per server it connects to. Servers expose three core primitives: **tools** (functions the model can call), **resources** (data that provides context) and **prompts** (reusable templates). Local servers usually use the stdio transport and serve one client; remote servers use Streamable HTTP and typically serve many clients. That last property is what makes coordination possible: many agents, one server, one shared view.

## What a coordination server does

A single agent does not need coordination. Several agents on one repo do, because each has its own context window and cannot see the others. A coordination server gives them a shared place to read and write that state. Common capabilities:

- **Presence and intent**: an agent records what it is working on; others can see it.
- **Reservations or claims**: an agent marks files or symbols it is about to change so others avoid them.
- **Messaging**: agents send messages to each other or to whoever owns a piece of code.
- **Shared knowledge**: notes, decisions and facts about the code that any agent can look up.
- **Code facts**: symbol signatures, callers and the [blast radius](https://corkcli.com/blog/blast-radius) of a change, so agents do not have to read files to learn them.

Examples as of October 2026 include MCP Agent Mail, an open source project that describes itself as "a mail-like [coordination layer](https://corkcli.com/blog/coordination-layer-ai-coding-agents) for coding agents, exposed as an HTTP-only FastMCP server", with agent identities, inboxes and advisory file reservations (leases); and Cork, covered below. We compare them in detail at https://corkcli.com/blog/cork-vs-mcp-agent-mail.

## The limit of MCP alone: agents have to remember to call it

An MCP tool is something the model may choose to call. If an agent forgets to check its inbox or skips claiming a file before editing, the server never hears about it, and coordination quietly fails. Instructions in `AGENTS.md` help, but agents under pressure skip steps.

Hooks close that gap. Claude Code, Codex and Cursor all run hooks at fixed points (session start, each prompt, before and after each tool call) whether or not the model thinks to. A coordination setup that uses hooks for the always-required steps (report this edit, check this write, inject this context) and MCP tools for questions the agent chooses to ask is more reliable than either alone. Claude Code's hooks can even call an MCP tool directly with a hook handler of `"type": "mcp_tool"`.

## How to connect one coordination server to every agent

Use the same URL everywhere. With a placeholder server at `https://coord.example.com/mcp`:

**Claude Code** (shared with the team through `.mcp.json`):

```bash
claude mcp add --transport http --scope project coord https://coord.example.com/mcp
```

**Codex**:

```bash
codex mcp add coord --url https://coord.example.com/mcp
```

**Cursor**, in `.cursor/mcp.json`:

```json
{
  "mcpServers": {
    "coord": { "url": "https://coord.example.com/mcp" }
  }
}
```

**Gemini CLI**:

```bash
gemini mcp add --transport http coord https://coord.example.com/mcp
```

If the server uses OAuth, sign in with `/mcp` in Claude Code, `codex mcp login coord` in Codex, or `/mcp auth` in Gemini CLI. Our guide to adding a remote MCP server covers headers and scopes for each tool.

## Tell agents when to use it

Add a short section to `AGENTS.md`, which Codex, Cursor and Claude Code all read:

```markdown
## Coordination
- Before editing a shared module, check who else is working on it.
- After changing a public function's signature, leave a note on it.
- If you need a change in code another agent owns, message that agent instead of editing.
```

Keep it to the steps that matter. Each line costs context in every session.

## Watch the token cost

Every connected server adds to context. Claude Code defers MCP tool definitions by default, so only tool names and server instructions load until a tool is used. Other clients may load full definitions. Prefer one coordination server with a few well-described tools over several overlapping ones, and check with `/context` (Claude Code) or `/mcp` in each tool.

## How Cork helps

Cork is built on this pattern: hooks for what must always happen, an MCP server for what agents ask. Cork is the coordination layer for [multiplayer coding agents](https://corkcli.com/blog/multiplayer-coding-agents): it keeps Claude Code, Codex and Cursor agents, on one machine or across a team's machines, from overwriting each other on one codebase, and hands each agent what the others already learned.

- **Hooks** in Claude Code, Codex and Cursor deliver briefings (exact signatures, callers and recent changes of the code an agent is about to touch), live awareness of teammates' renames, a write gate that holds edits against code another agent is changing right now, and [semantic lint](https://corkcli.com/blog/semantic-lint), with no extra model calls.
- **The MCP server** at `https://mcp.corkcli.com` works with any MCP client and exposes `get_symbol`, `blast_radius`, `recap` (what happened and what it cost), and `remember` and `recall` (durable notes anchored to code).
- **Agent messaging**: any agent can message the others in the repo, one agent, or whoever is working on a given function.

To add just the MCP server to Claude Code:

```bash
claude mcp add --transport http cork https://mcp.corkcli.com
```

To install the hooks for every repo on the machine:

```bash
curl -fsSL https://corkcli.com/install.sh | sh
```

## Frequently asked questions

### Can multiple AI agents connect to the same MCP server?

Yes. Remote MCP servers using Streamable HTTP typically serve many clients, which is what lets several agents share state through one server.

### What is the difference between MCP and hooks for agent coordination?

MCP tools run when the agent chooses to call them. Hooks run at fixed points in every session regardless. Reliable coordination uses hooks for required steps and MCP for questions.

### Do I need an MCP server to run multiple coding agents?

No. Worktrees and a shared `AGENTS.md` work without one. A coordination server adds what those cannot: awareness of what the other agents are doing right now.

### Does a coordination MCP server work with Codex and Cursor too?

Yes, if it is a standard MCP server. Codex, Cursor, Claude Code and Gemini CLI all support remote MCP servers.

## Sources

- <https://modelcontextprotocol.io/docs/getting-started/intro>
- <https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture>
- <https://code.claude.com/docs/en/mcp>
- <https://code.claude.com/docs/en/hooks>
- <https://code.claude.com/docs/en/costs>
- <https://learn.chatgpt.com/docs/extend/mcp?surface=cli>
- <https://cursor.com/docs/context/mcp>
- <https://geminicli.com/docs/tools/mcp-server/>
- <https://github.com/Dicklesworthstone/mcp_agent_mail>

## Related reading

- [How to add a remote MCP server to Claude Code, Codex, Cursor and Gemini CLI](https://corkcli.com/blog/add-remote-mcp-server-claude-code-codex-cursor-gemini-cli): Exact, verified commands and config to add a remote HTTP MCP server to Claude Code, Codex, Cursor and Gemini CLI, with scopes, auth headers and OAuth sign-in.
- [How to run Codex and Claude Code side by side on one project](https://corkcli.com/blog/run-codex-and-claude-code-side-by-side): Run OpenAI Codex CLI and Claude Code on one repo: one AGENTS.md for both, a worktree each, shared MCP servers, matching hooks, and live coordination.
- [How to coordinate Cursor and Claude Code on the same codebase](https://corkcli.com/blog/coordinate-cursor-and-claude-code-same-codebase): Run Cursor and Claude Code on one repo without clobbered edits: shared AGENTS.md instructions, worktrees, shared MCP servers, hooks, and a coordination layer.
- [Pre-commit checks for code written by AI agents](https://corkcli.com/blog/pre-commit-checks-ai-generated-code): Pre-commit checks for AI-written code: git hooks, the pre-commit framework, secret scanning, and agent hooks in Claude Code, Codex and Cursor.

[All articles](https://corkcli.com/blog.md) · [Cork in Markdown](https://corkcli.com/index.md) · [llms.txt](https://corkcli.com/llms.txt)

This page in HTML: https://corkcli.com/blog/mcp-servers-coordinating-coding-agents
