antigravity-mcp-server

antigravity-mcp-server

Let two AI agents build your app at the same time without stepping on each other by providing shared file locks, task delegation, and inter-agent communication.

Category
访问服务器

README

<div align="center">

antigravity-mcp-server

Let two AI agents build your app at the same time — without stepping on each other.

Your agent does the backend. Antigravity does the UI. Neither one breaks the other's files.

npm License: MIT Node MCP

</div>


The problem

Running two AI coding agents on one project sounds great — until they both edit the same file and quietly destroy each other's work.

They can't see each other. That's the whole issue.

The fix

One small server that both agents plug into. It gives them a shared memory: who is doing what, which files are taken, and what they need to tell each other.

   Your AI agent                                    Antigravity
   Claude Code · Cursor · Windsurf                  (agy CLI)
   VS Code · Gemini CLI · OpenCode
          │                                              │
          │  MCP                                     MCP │
          └──────────────┐                ┌──────────────┘
                         ▼                ▼
              ┌─────────────────────────────────┐
              │        antigravity-mcp-server          │
              │                                 │
              │   board.json                    │
              │    ├─ tasks .... who does what  │
              │    ├─ locks .... files taken    │
              │    ├─ notes .... messages       │
              │    └─ presence . who is online  │
              └─────────────────────────────────┘
                              │
                              └──► starts `agy` in the background

Install

npx antigravity-mcp-server init

That's it. This one command:

  • finds every AI tool on your computer
  • adds the server to each one
  • turns on the permission Antigravity needs

Now restart your AI tools so they pick it up.

Prefer it installed permanently instead of fetched each run:

npm install -g antigravity-mcp-server
antigravity-mcp-server init

Other commands:

antigravity-mcp-server doctor           # is everything working?
antigravity-mcp-server doctor --probe   # same, plus a real round trip through agy
antigravity-mcp-server init --dry-run   # show changes, write nothing
antigravity-mcp-server init --all       # also write configs for tools you haven't installed
antigravity-mcp-server init --only claude-code,cursor

You need: Node 18.17 or newer, and the Antigravity CLI (agy). Without agy you still get the shared board — you just can't hand work to Antigravity.


How you use it

You don't learn any commands. You just talk to your agent:

"Build the checkout page with Antigravity while you do the payments API."

Your agent takes it from there. Here is what actually happens:

  time ──────────────────────────────────────────────────────►

  your agent   ███ writes brief ███│████ payments API ████│ checks result
                                   │                      │
  Antigravity                      │███ checkout page ███ │
                                   │                      │
                                   └── both work at once ─┘

Your agent writes a full brief, locks its own files, starts Antigravity in the background, and keeps working. Nobody waits.


Why the shared board matters

1. File locks

Before an agent edits a file, it claims it. Locking a folder locks everything inside it.

  my-app/
  ├── api/           [locked] your agent    ← Antigravity is told "taken"
  ├── db.ts          [locked] your agent
  ├── components/    [locked] Antigravity   ← your agent stays away
  └── styles/        [locked] Antigravity

If an agent tries to take a locked file, it gets a clear conflict back. No silent overwrite.

2. Notes

The UI is being built against an API that does not exist yet. So the two agents pass the plan back and forth:

"POST /api/orders is ready. It returns { id, status }. Hook the form to it."

This is the thing that keeps both halves fitting together.

3. Presence

Each agent can check what the other is doing before it starts, so it picks work that doesn't clash.


The tools

Your agent picks these on its own. You never type them.

Group Tools
Hand off work ag_delegate · ag_task_status · ag_task_wait · ag_followup · ag_cancel
Shared board coop_status · board_post · board_update · board_list
File locks claim_paths · release_paths · check_paths
Talking notes_send · notes_read · presence_set · activity
Admin coop_reset

Two worth knowing about:

coop_status — one call answers everything: who's online, what's running, what's locked, what's unread.

ag_followup — carries on the same Antigravity conversation. So "now make it work on mobile" keeps all the context instead of starting cold.


How it works inside

Files on disk

~/.antigravity-mcp/
├── board.json                    shared state, written under a lock
└── runs/
    ├── <task_id>.json            agy's raw result
    ├── <task_id>.prompt.txt      the brief that was sent
    └── <task_id>.err             stderr, if the run failed

board.json holds tasks, locks, notes, events, and presence. Every write takes an exclusive lock (an atomically created directory — the one primitive that behaves the same on Windows and POSIX), then lands via write-temp-and-rename, so a crash can't leave a half-written board. Stale locks older than 20s are broken automatically.

There's no SQLite. A native build would break npx on machines without a compiler, and node:sqlite is still experimental and Node 22+. The board takes a handful of small writes per minute, so a JSON file is the right size of tool.

Delegation

ag_delegate shells out to:

agy --print <brief> --output-format json --print-timeout <n>s \
    --add-dir <cwd> --mode accept-edits --dangerously-skip-permissions

The child is spawned detached, with stdout redirected straight to runs/<task_id>.json. That means a long job survives the MCP server being restarted — status is recovered by reading the run file and checking the PID, not by holding a child handle.

ag_followup reuses the conversation_id from agy's JSON output via --conversation, so context carries across calls.

Path locks

Paths are normalised with path.resolve and case-folded on Windows, so C:\Proj and c:\proj can't defeat the same lock. Overlap is checked in both directions — claiming api/routes.ts conflicts with a held api/, and claiming api/ conflicts with a held api/routes.ts.

Agent identity

Each side runs the same binary with a different --agent <id>. That id is what every board entry is attributed to. Two clients sharing one id makes their locks invisible to each other, which defeats the whole point.


Where configs get written

init only touches tools it finds, and backs up any file it edits to <file>.bak-antigravity-mcp.

Tool Config path Key
Claude Code ~/.claude.json mcpServers
Cursor ~/.cursor/mcp.json mcpServers
Windsurf ~/.codeium/windsurf/mcp_config.json mcpServers
Gemini CLI ~/.gemini/settings.json mcpServers
Claude Desktop %APPDATA%/Claude/claude_desktop_config.json<br>~/Library/Application Support/Claude/… mcpServers
VS Code (Copilot) %APPDATA%/Code/User/mcp.json servers
OpenCode ~/.config/opencode/opencode.json mcp
Antigravity CLI ~/.gemini/config/mcp_config.json mcpServers
Antigravity IDE ~/.gemini/antigravity-ide/mcp_config.json mcpServers

Good to know

Long jobs are safe. Antigravity runs detached. If your editor or the server restarts, the job keeps going.

Antigravity edits without asking. ag_delegate passes --dangerously-skip-permissions so it can work unattended. Pass auto_approve: false to make it stop at prompts instead.

One trap init handles for you. In headless mode agy auto-denies every MCP call unless allow-listed in ~/.gemini/antigravity-cli/settings.json. If that rule is missing, delegation still runs but coordination silently does nothing — the worst kind of failure, because it looks like it works. init adds mcp(coop/*); doctor checks for it.

Antigravity works in its own scratch project unless the target directory is in its workspace. Every hand-off passes --add-dir <cwd> and states the project root in the brief.


Settings

AGY_BIN Path to the agy binary
ANTIGRAVITY_MCP_HOME Board location (default ~/.antigravity-mcp)
--agent <id> The name this instance uses on the board

Setting it up by hand

Add this to your tool's MCP config:

{
  "mcpServers": {
    "antigravity": {
      "command": "npx",
      "args": ["-y", "antigravity-mcp-server", "--agent", "claude-code"]
    }
  }
}

On the Antigravity side, name the server coop, use --agent antigravity, and add this to ~/.gemini/antigravity-cli/settings.json:

{ "permissions": { "allow": ["mcp(coop/*)"] } }

The server key must match the allow-rule — coop here, mcp(coop/*) there.


Working on the code

git clone https://github.com/adeelali4/antigravity-mcp
cd antigravity-mcp
npm install

npm test                    # 16 checks, two live stdio clients, no agy credits used
node test/delegation.js     # real end-to-end run (uses agy credits)
node src/cli.js init --local --dry-run

npm test spawns two real MCP clients as separate processes against one board, so cross-process locking and messaging are covered for real rather than mocked.


<div align="center">

MIT · built by adeelali4

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选