Antigravity Codex MCP
Antigravity Codex MCP
一个受控的 Model Context Protocol 桥接器,让 OpenAI Codex 能够按需将工作委托给 Google Antigravity CLI。
该桥接器保持空闲状态,直到用户明确要求 Codex 使用 AGY。随后,它仅授权当前确切的项目,保持项目范围的对话,同步用户可见的对话内容,并将生成的实现更改限制在隔离副本中。
这是一个独立的社区项目。它与 Google 或 OpenAI 没有关联,也未获得其认可。
亮点
显式选择加入:除非用户要求,否则 Codex 无法启用或调用 AGY。
精确项目范围:宽泛的根目录和系统目录将被拒绝。
默认只读委托:不授予 AGY 写入、命令、URL 或 MCP 权限。
项目对话:活动对话 ID 和委托历史在 Codex 新任务中得以保留。
可见的对话记录同步:通过 AGY CLI 输入的消息将在下次同步时对 Codex 可用。
私有推理过滤器:在持久化或 MCP 返回之前,会排除思考/推理字段、系统消息和检查点。
隔离实现:经过验证的完整文件替换仅应用于一次性的项目副本。
可审计的运行:响应、更改文件清单、验证输出和经过清理的工具事件均保留在本地。
Related MCP server: Antigravity Delegate MCP
要求
Node.js 20 或更高版本
对 Antigravity CLI 进行身份验证,并验证 agy 是否可用:
agy --version
agy -p "Reply exactly: AGY_OK" --output-format json如果 agy 不在 PATH 中,请在 MCP 配置中将其可执行文件路径设置为 AGY_BIN。
安装
git clone https://github.com/ustc-fyk/antigravity-codex-mcp.git
cd antigravity-codex-mcp
npm ci
npm test将服务器添加到您的 Codex config.toml 中。将示例路径替换为您机器上的绝对克隆路径:
[mcp_servers.antigravity]
command = 'node'
args = ['C:\path\to\antigravity-codex-mcp\src\index.js']
cwd = 'C:\path\to\antigravity-codex-mcp'
enabled = true
required = false
startup_timeout_sec = 20
tool_timeout_sec = 900
default_tools_approval_mode = 'prompt'
enabled_tools = [
'antigravity_health',
'antigravity_project_status',
'antigravity_enable_project',
'antigravity_disable_project',
'antigravity_start_session',
'antigravity_get_active_session',
'antigravity_list_sessions',
'antigravity_sync_conversation',
'antigravity_get_transcript',
'antigravity_ask',
'antigravity_continue',
'antigravity_review',
'antigravity_execute',
'antigravity_list_runs',
'antigravity_get_run',
]
# Optional when agy is not available on PATH:
[mcp_servers.antigravity.env]
AGY_BIN = 'C:\path\to\agy.exe'在 macOS 或 Linux 上,使用相应的绝对 POSIX 路径,并且当 agy 在 PATH 中时,通常可以省略 AGY_BIN。
安装随附的 Codex Skill,以便 Codex 遵循选择加入工作流:
$skillRoot = Join-Path $env:USERPROFILE ".codex\skills\agy-project-assistant"
New-Item -ItemType Directory -Force $skillRoot | Out-Null
Copy-Item ".\skills\agy-project-assistant\SKILL.md" $skillRoot更改 MCP 配置或安装 Skill 后,请重启 Codex。
用法
在 Codex 中打开任意项目目录。
正常工作;AGY 桥接器保持空闲状态。
明确要求:
加载 AGY 并审查此项目。Codex 为该确切项目启用读取访问权限,并启动或重用其 AGY 对话。
Codex 根据情况委托分析、审查、继续或隔离实现。
要求
为此项目禁用 AGY以撤销确切的项目权限,同时保留本地审计历史。
要直接检查或参与同一对话:
agy --conversation=<conversation_id>通过 AGY CLI 发送消息后,要求 Codex 同步 AGY 对话。antigravity_continue 也会在每次后续操作之前和之后进行同步。同步是按需进行的,不是实时推送通道,因此请避免从 Codex 和 AGY CLI 同时发送。
MCP 工具
区域 | 工具 |
健康与生命周期 |
|
对话 |
|
可见的对话记录 |
|
隔离实现 |
|
模型调用仅通过启动、询问、继续、审查和执行工具进行。健康检查、状态、历史记录、运行检查和对话记录同步不消耗 AGY 模型轮次。
项目本地状态
每个启用的项目都会获得一个被忽略的本地状态目录:
.antigravity-mcp/
├── project.json
├── sessions.jsonl
├── transcripts/
│ └── <conversation-id>.jsonl
└── runs/
└── <run-id>/
├── metadata.json
├── events.jsonl
├── response.md
└── workspace/project.json记录选择加入状态和活动对话。sessions.jsonl记录委托调用和令牌使用情况。transcripts仅包含可见的用户/助手记录和经过清理的工具跟踪。runs包含隔离的实现工作区和审计结果。
此目录从源副本中排除,并被 Git 忽略。请勿手动提交,因为它可能包含私有项目或对话数据。
安全模型
项目启用会以原子方式仅将确切根目录添加到 Antigravity trustedWorkspaces 和 read_file(...) 允许规则中。禁用仅会删除这些确切的条目。
隔离实现拒绝:
绝对路径和父目录遍历;
文件删除;
秘密文件、依赖项、构建输出、元数据和符号链接;
超过 50 个更改的文件;
超过 2,000,000 个替换字符。
对话记录管道在写入项目镜像之前,会递归删除私有推理字段,并排除系统/检查点记录。有关报告指南和限制,请参阅 SECURITY.md。
开发
npm ci
npm test
npm run smoke:mcp实时检查需要经过身份验证的 AGY CLI,并消耗模型配额:
npm run smoke:live
npm run smoke:execute
npm run smoke:project -- "/absolute/path/to/disposable-project"
npm run smoke:continue -- "/absolute/path/to/enabled-project"
npm run smoke:transcript -- "/absolute/path/to/enabled-project"npm test 是自包含的。smoke:mcp 还会检查本地 AGY 二进制文件,而其余的冒烟测试可能会更改项目授权或消耗配额。
许可证
Available Tools
15 toolsantigravity_askDelegate a new analysis to AntigravityARead-only
Start a new read-only AGY analysis conversation for an enabled project and persist it as active.
Inputs: prompt (required), project_root (required), model, effort, +2 more.
antigravity_continueContinue a project AGY conversationBRead-only
Continue a specified conversation or the project's active AGY conversation and persist the result.
Inputs: prompt (required), project_root (required), model, effort, +3 more.
antigravity_disable_projectDisable AGY for one projectAIdempotent
Remove only one project's exact Antigravity trusted workspace and read_file rule, mark it disabled, and preserve all local session and run history.
Inputs: project_root (required).
antigravity_enable_projectEnable AGY for one projectAIdempotent
Initialize .antigravity-mcp in one exact project root and atomically add only that root to Antigravity trustedWorkspaces and read_file allow rules. Call only after the user explicitly requests AGY. Does not call a model.
Inputs: project_root (required).
antigravity_executeExecute a task in an isolated AGY workspaceA
For an enabled project, ask AGY for schema-validated file replacements, apply only validated paths to a disposable copy, optionally run one fixed verification, and never merge into source.
Inputs: task (required), project_root (required), model, effort, +4 more.
antigravity_get_active_sessionGet active project AGY sessionARead-onlyIdempotent
Return the active AGY conversation ID for a project without calling a model.
Inputs: project_root (required).
antigravity_get_runInspect an isolated AGY runARead-onlyIdempotent
Read one project's run response, token usage, verification output, changed-file manifest, and optional external events.
Inputs: run_id (required), project_root (required), max_events, include_events.
antigravity_get_transcriptRead a visible AGY transcriptAIdempotent
Refresh and return the bounded project-local user/assistant/tool transcript for a registered AGY conversation. Internal thinking, system messages, and checkpoints are never returned.
Inputs: project_root (required), refresh, max_chars, max_records, +1 more.
antigravity_healthCheck Antigravity bridgeARead-onlyIdempotent
Check the configured agy binary and bridge version without enabling a project or consuming a model turn.
Inputs: no named parameters.
antigravity_list_runsList isolated AGY runsARead-onlyIdempotent
List recent isolated execution runs for one project.
Inputs: project_root (required), limit.
antigravity_list_sessionsList project AGY session eventsARead-onlyIdempotent
List recent persisted AGY delegation and conversation events for one project without calling a model.
Inputs: project_root (required), limit.
antigravity_project_statusCheck AGY project statusARead-onlyIdempotent
Check whether one exact project root is initialized, trusted, read-authorized, and linked to an active AGY conversation. Does not call a model.
Inputs: project_root (required).
antigravity_reviewRequest an independent Antigravity reviewBRead-only
Start a read-only evidence-oriented review for an enabled project and persist the conversation.
Inputs: target (required), project_root (required), focus, model, +3 more.
antigravity_start_sessionStart a project AGY sessionBRead-only
Create a new AGY conversation for an enabled project, save it as active, and return its conversation ID. Consumes one Antigravity model turn.
Inputs: project_root (required), model, effort, prompt, +2 more.
antigravity_sync_conversationSync an AGY conversationAIdempotent
Read the official AGY transcript for a conversation registered to this project, filter internal thinking/system/checkpoint records, and update the project-local visible transcript mirror. Does not call a model.
Inputs: project_root (required), max_chars, include_all, max_records, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 15 tools
Each tool has a clearly distinct purpose: project lifecycle (enable, disable, status), session management (start, get active, sync, transcript), conversation actions (ask, continue, review), and execution (execute, get run). No two tools appear to perform the same function; even the conversation-related tools are differentiated by mode (read-only analysis, continuation, review).
All tools follow a consistent verb_noun pattern with the 'antigravity_' prefix (e.g., list_sessions, enable_project, get_transcript). The naming is uniform and predictable, making it easy for an agent to infer tool purpose from the name alone.
15 tools is well-scoped for a server that manages AGY sessions, project configuration, transcripts, and executions. Each tool covers a distinct operational need without redundancy, and the count is within the ideal range for a feature-complete MCP server.
The tool surface covers the full lifecycle: project enable/disable/status, session creation and retrieval, transcript syncing and retrieval, conversation actions (ask, continue, review), and execution management (execute and get_run). No obvious gaps exist—both administrative and interactive workflows are supported.
Maintenance
Related MCP Connectors
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
A paid remote MCP for OpenAI Codex context compressor, built to return verdicts, receipts, usage log
Share one project context across ChatGPT, Claude, Telegram and any MCP client.
A paid remote MCP for OpenAI Codex memory MCP, built to return verdicts, receipts, usage logs, and a
Related MCP Servers
- AlicenseBqualityBmaintenanceAn MCP bridge that lets Codex delegate long-running agent work to the Antigravity CLI, providing observable and resumable tool-based execution with project scoping.14249 PyPI17MIT
- AlicenseNot gradedqualityCmaintenanceA local-STDIO MCP server that lets Codex invoke the Antigravity CLI from any project, with project-owned routing guidance and enforceable policies.MIT
- AlicenseAqualityDmaintenanceEnables OpenAI Codex to delegate tasks to Google Antigravity CLI, running them headlessly and polling for results.41MIT
- AlicenseNot gradedqualityBmaintenanceEnables Codex users to delegate engineering, refactoring, auditing, and test execution tasks to Google Antigravity CLI as a persistent autonomous subagent, with tools for managing sessions and running prompts.1MIT