Sync Skills, MCP Servers and AGENTS.md Across Claude Code, Cursor and Codex

Published Oct 30, 2026 · 6 min read

If you run Claude Code, Cursor and Codex on the same repo, you already know the annoying part: every tool wants its own copy of your skills, your MCP servers and your instructions, and the copies drift. A skill you fixed in one tool is still broken in the next. A server you added for Claude never shows up in Codex.

You don't need a sync app for this. Each tool already reads more of the others' folders than most people realize. This guide shows where each one looks (checked against the official docs in October 2026), then gets you to one source of truth with a symlink for skills and a short script for MCP servers.

Where each tool looks

Claude CodeCursorCodex
InstructionsCLAUDE.md (or AGENTS.md when there's no CLAUDE.md)AGENTS.md, .cursor/rules/*.mdcAGENTS.md
Project skills.claude/skills/.cursor/skills/, .agents/skills/, and also .claude/skills/, .codex/skills/.agents/skills/ (follows symlinks)
Personal skills~/.claude/skills/~/.cursor/skills/, ~/.agents/skills/, also ~/.claude/skills/~/.agents/skills/
Project MCP.mcp.json.cursor/mcp.json.codex/config.toml (trusted projects only)
Secret syntax${VAR}${env:VAR}env_vars, bearer_token_env_var

Two things fall out of that table. Skills are nearly shared already, because they're the same SKILL.md format everywhere and Cursor reads Claude's folder. MCP is the hard one: same idea, three file names, and three different ways to say "read this token from the environment."

Instructions: one AGENTS.md

Put everything every agent needs in AGENTS.md at the repo root. Codex and Cursor read it directly. For Claude Code, keep a two-line CLAUDE.md that starts with @AGENTS.md, which imports the file, and add Claude-only notes below it. Our AGENTS.md template has the full file and the bridge.

Skills: one folder and one symlink

Keep your skills in .claude/skills/. Claude Code reads that folder natively and Cursor reads it for compatibility. Codex only looks in .agents/skills/, but its docs say it follows symlinked skill folders, so point that folder at Claude's:

mkdir -p .agents
ln -s ../.claude/skills .agents/skills
git add .agents/skills .claude/skills

Now one edit to .claude/skills/review-diff/SKILL.md shows up in all three tools. Do the same at home for personal skills with ln -s ~/.claude/skills ~/.agents/skills. Cursor already reads ~/.claude/skills/, so it needs nothing extra.

Two cautions. Cursor reads both .claude/skills/ and .agents/skills/, so it may see each skill twice through the symlink; if your skill list shows duplicates, drop the symlink and copy the folder in your build step instead. And on Windows, Git checks symlinks out as plain text files unless symlinks are enabled, so teams on Windows should use the copy approach too. If you want a starting set of skills, our SKILL.md examples work in all three tools.

MCP servers: one file, three outputs

You can't share a single MCP file, because the moment a server needs a token, the syntax differs. Instead keep one neutral file, agent-mcp.json, written with plain ${VAR} references:

{
  "github": {
    "url": "https://api.githubcopilot.com/mcp/",
    "headers": { "Authorization": "Bearer ${GITHUB_TOKEN}" }
  },
  "context7": {
    "command": "npx",
    "args": ["-y", "@upstash/context7-mcp"],
    "env": { "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}" }
  },
  "playwright": {
    "command": "npx",
    "args": ["@playwright/mcp@latest"]
  }
}

Then generate the three real configs from it. This script uses only the Python standard library:

#!/usr/bin/env python3
"""Generate .mcp.json (Claude Code), .cursor/mcp.json (Cursor) and
.codex/config.toml (Codex) from one agent-mcp.json.
Secrets stay as ${VAR} references. Keep them in env or headers, never in args."""
import json, pathlib, re

VAR = re.compile(r"\$\{([A-Za-z_][A-Za-z0-9_]*)\}")
src = json.loads(pathlib.Path("agent-mcp.json").read_text())

def sub(v, fn):
    if isinstance(v, str): return fn(v)
    if isinstance(v, list): return [sub(x, fn) for x in v]
    if isinstance(v, dict): return {k: sub(x, fn) for k, x in v.items()}
    return v

def write(path, text):
    p = pathlib.Path(path); p.parent.mkdir(parents=True, exist_ok=True)
    p.write_text(text); print("wrote", path)

# Claude Code: ${VAR}, and every entry gets a type
claude = {n: {"type": "http" if "url" in s else "stdio", **s} for n, s in src.items()}
write(".mcp.json", json.dumps({"mcpServers": claude}, indent=2) + "\n")

# Cursor: ${env:VAR}
cursor = {}
for n, s in src.items():
    s = sub(s, lambda t: VAR.sub(r"${env:\1}", t))
    cursor[n] = s if "url" in s else {"type": "stdio", **s}
write(".cursor/mcp.json", json.dumps({"mcpServers": cursor}, indent=2) + "\n")

# Codex: TOML; forward variables by name instead of copying values
q = json.dumps
out = ["# Generated from agent-mcp.json. Codex reads this only in trusted projects.", ""]
for n, s in src.items():
    out.append(f"[mcp_servers.{n}]")
    if "url" in s:
        out.append(f"url = {q(s['url'])}")
        m = VAR.fullmatch(s.get("headers", {}).get("Authorization", "").removeprefix("Bearer "))
        if m: out.append(f"bearer_token_env_var = {q(m.group(1))}")
    else:
        out.append(f"command = {q(s['command'])}")
        if s.get("args"): out.append("args = [" + ", ".join(map(q, s["args"])) + "]")
        names = sorted(set(VAR.findall(json.dumps(s.get("env", {})))))
        if names: out.append("env_vars = [" + ", ".join(map(q, names)) + "]")
    out.append("")
write(".codex/config.toml", "\n".join(out))

Run python3 sync-mcp.py from the repo root after every change to agent-mcp.json. It writes:

Keep tokens in env or headers, never in args, so all three tools can read them from your environment. If you already have a .codex/config.toml with other settings, have the script write the MCP tables to a separate file and paste them in, since it overwrites the whole file.

Check that it worked

Keep it from drifting again

Commit agent-mcp.json, the script and all three generated files, so a teammate on any tool gets the same servers. Add a pre-commit check or a CI step that runs the script and fails if git diff --exit-code finds changes, which catches anyone who edited a generated file by hand. And since these files can start programs on someone's machine, review changes to them like changes to CI; our guide to checking a repo before an agent opens it lists every file worth watching.

Skills and configs that already work everywhere

The Claude Code Agent Starter Kit ($39) ships 4 skills, 4 subagents, 3 safety hooks and 5 MCP configs, and its skills are plain SKILL.md folders you can share with Cursor and Codex this way. The Cursor Rules Pack ($19) adds 18 .mdc rules and an AGENTS.md template. Get the Starter Kit Get the Cursor Rules Pack

FAQ

Can Claude Code, Cursor and Codex share one skills folder?

Mostly. Cursor reads .claude/skills/ and .agents/skills/ as well as its own .cursor/skills/. Codex reads .agents/skills/ and follows symlinks there. So keep skills in .claude/skills/ and add one symlink, .agents/skills pointing to ../.claude/skills, and all three tools load the same SKILL.md files.

Can I use one .mcp.json for Claude Code and Cursor?

Only if no entry uses environment variables. Both use the mcpServers key, but Claude Code expands ${VAR} while Cursor expects ${env:VAR}, and Codex uses TOML in config.toml. Keep one neutral file and generate the three configs from it.

Where does Codex read project MCP servers from?

From .codex/config.toml in the project, in [mcp_servers.NAME] tables, on top of your ~/.codex/config.toml. Codex loads project config only after you trust the project, so a fresh clone won't start its servers until you do.

Should I commit the generated MCP files?

Yes, if they contain only ${VAR} references and no real keys. Commit agent-mcp.json and the three generated files so teammates on any tool get the same servers, and keep the actual tokens in each person's environment.

The VibeKit Dispatch

One tested Claude Code / Cursor workflow every week. No hype, unsubscribe anytime.