Antigravity MCP Bridge
⚡ Antigravity MCP Bridge
开源桥梁,通过模型上下文协议将 Google Cloud AI 连接到您的本地机器
已验证的概念验证:一条 Gemini Spark 提示 — "创建一个带单元测试的计算器" — 在不到 3 秒内生成了可运行的 Python 代码,运行并提交到了 GitHub。零人工复制粘贴。
架构 • 工具 API • 快速入门 • Google 生态系统 • 开发者文档 • 资源与链接 • 受益人群
🧩 这个项目是什么?
Antigravity MCP Bridge 打破了云端 AI 与本地机器之间的壁垒。它运行一个本地**模型上下文协议(MCP)**服务器,通过安全的 HTTPS 隧道将您的整个操作系统 — 终端、文件、编译器和 Git — 暴露给任何兼容 MCP 的 AI 编排器。
将其连接到 Google Gemini Spark,您就拥有了一位完全自主的 AI 软件工程师,可以直接在您的磁盘上规划、编码、测试、修复和交付软件。
Related MCP server: simple_mcp_demo
🏗️ 系统架构
┌────────────────────────────────────────────────────────────────────┐
│ 🌐 GOOGLE CLOUD ECOSYSTEM │
│ │
│ ┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐ │
│ │ Gemini Spark │ │ Google Workspace │ │ Vertex AI / │ │
│ │ (Orchestrator) │ │ Docs/Drive/Gmail │ │ Cloud Run │ │
│ └────────┬────────┘ └──────────────────┘ └─────────────────┘ │
└───────────┼────────────────────────────────────────────────────────┘
│ JSON-RPC 2.0 (Streamable HTTP / SSE)
│ HTTPS via ngrok / Cloudflare Tunnel
┌───────────▼────────────────────────────────────────────────────────┐
│ ⚡ ANTIGRAVITY MCP BRIDGE (Your Machine) │
│ │
│ /mcp (Streamable HTTP) /sse (Server-Sent Events) │
│ CORS · Authentication · 7 Registered MCP Tools │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ File System │ │ Terminal │ │ Antigravity Subagents │ │
│ │ Read/Write │ │ Shell/CMD │ │ (Autonomous Tasks) │ │
│ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Python │ │ Node.js/npm │ │ Git / Docker / CI │ │
│ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
└────────────────────────────────────────────────────────────────────┘传输协议
端点 | 协议 | 最佳用途 |
| 流式 HTTP(MCP 2.0) | Google Gemini Spark、Vertex AI、所有现代 MCP 客户端 |
| 服务器发送事件(SSE) | 旧版 MCP 客户端、自定义集成 |
| HTTP POST | 在 SSE 会话中发布消息 |
🧰 完整工具参考
🔧 工具 1:run_system_command
执行任何 shell、PowerShell 或 Bash 命令。捕获退出代码、stdout、stderr。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 要执行的完整 shell 命令 |
| string | ❌ | 工作目录路径(默认为当前工作目录) |
// Example: Run Python unit tests
{
"name": "run_system_command",
"arguments": {
"command": "python -m pytest tests/ -v",
"working_dir": "C:/Users/dev/myproject"
}
}用途: 运行 Python/Node/Java/Rust、pip install、npm install、Git 操作、测试运行器、Docker、CI 流水线。
📝 工具 2:write_file
创建或覆盖磁盘上的任何文件,内容由 AI 生成。自动创建目录。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 绝对或相对文件路径 |
| string | ✅ | 要写入的完整内容 |
// Example: Write a FastAPI route
{
"name": "write_file",
"arguments": {
"file_path": "src/api/routes.py",
"content": "from fastapi import APIRouter\nrouter = APIRouter()\n\n@router.get('/health')\ndef health(): return {'status': 'ok'}"
}
}用途: 编写源代码、配置文件、Dockerfile、GitHub Actions YAML、Markdown 文档、.env 文件。
📖 工具 3:read_file
读取并返回任何本地文件的完整内容。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 文件路径 |
{
"name": "read_file",
"arguments": { "file_path": "src/main.py" }
}用途: 重构前检查代码、读取日志、审计配置、读取数据集。
📂 工具 4:list_directory
枚举文件和目录,显示类型和大小。
参数 | 类型 | 必填 | 描述 |
| string | ❌ | 要列出的目录(默认为当前工作目录) |
{
"name": "list_directory",
"arguments": { "directory_path": "C:/Users/dev/myproject" }
}用途: 发现项目结构、验证文件是否已创建、审计仓库。
🤖 工具 5:run_agent_task
为复杂的多步骤目标生成一个自主运行的Antigravity AI 子代理。立即返回一个 task_id。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 高层级的自然语言目标 |
| string | ❌ | 代理操作的目录 |
{
"name": "run_agent_task",
"arguments": {
"prompt": "Refactor all Python files to use async/await. Run tests after each file.",
"workspace_dir": "C:/Users/dev/myproject"
}
}用途: 大规模重构、完整功能开发、自主 TDD、安全审计。
📊 工具 6:get_agent_status
轮询后台子代理任务的实时进度、输出和错误。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 来自 |
{
"name": "get_agent_status",
"arguments": { "task_id": "a1b2c3d4" }
}
// Returns: { "status": "completed", "output": "...", "error": null }🛑 工具 7:terminate_task
安全取消任何正在运行的后台子代理任务。
参数 | 类型 | 必填 | 描述 |
| string | ✅ | 要取消的任务 ID |
🔗 Google 生态系统集成
Gemini Spark
通过自定义连接应用将您的桥接器连接到 Gemini。
Google Cloud
将桥接器部署到云端或与 Cloud AI 集成。
Vertex AI
企业级 AI 编排,支持本地执行。
Google Workspace
将 Docs、Drive、Gmail 用作 AI 上下文来源。
📚 官方文档与外部资源
🔵 模型上下文协议(MCP)
资源 | 链接 |
🏠 MCP 官方网站 | |
📖 MCP 介绍 | |
📖 MCP 快速入门指南 | |
📖 MCP 规范 | |
🐍 Python MCP SDK(官方) | |
📦 PyPI 上的 MCP | |
🐙 MCP GitHub 组织 | |
📖 MCP 传输参考 | |
📖 MCP 工具参考 |
🟣 Google Antigravity(AGY)
资源 | 链接 |
🏠 Antigravity 主页 | |
📖 Antigravity 文档 | |
📖 MCP 集成指南 | |
📖 技能系统 | |
📖 Python SDK | |
📖 钩子与插件 | |
📖 代理权限 | |
📖 更新日志 |
🔵 Google Gemini 与 AI API
资源 | 链接 |
🏠 Google Gemini 应用 | |
📖 Gemini API 文档 | |
📖 Gemini API 快速入门 | |
📖 Google Workspace 版 Gemini | |
📖 Google AI Studio | |
📖 已连接应用 (MCP) 帮助 | |
🐙 Google Generative AI GitHub |
☁️ Google Cloud Platform
资源 | 链接 |
🏠 Google Cloud 控制台 | |
📖 Vertex AI 文档 | |
📖 Cloud Run 文档 | |
📖 Cloud Build 文档 | |
📖 Google Cloud APIs 浏览器 | |
📖 AI 与机器学习产品 |
🐍 Python 与核心库
资源 | 链接 |
🏠 Python 官方网站 | |
📖 Python 文档 | |
📦 PyPI 包索引 | |
📖 pip 文档 | |
📖 asyncio 文档 | |
📖 subprocess 文档 |
🌐 Web 与 ASGI 框架
资源 | 链接 |
🏠 Uvicorn (ASGI 服务器) | |
📖 Uvicorn 文档 | |
🏠 Starlette 框架 | |
📖 Starlette 文档 | |
📖 Starlette 路由 | |
📖 CORS 中间件 | |
🏠 FastAPI | |
📖 FastAPI 文档 |
🔒 隧道与安全暴露
资源 | 链接 |
🏠 ngrok 官方网站 | |
📖 ngrok 文档 | |
📖 ngrok HTTP 隧道 | |
📦 pyngrok (Python SDK) | |
📖 pyngrok 文档 | |
🏠 Cloudflare 隧道 | |
📖 Cloudflare 隧道文档 | developers.cloudflare.com/cloudflare-one/connections/connect-networks |
📡 JSON-RPC 与 SSE 规范
资源 | 链接 |
📖 JSON-RPC 2.0 规范 | |
📖 服务器发送事件 (SSE) — MDN | |
📖 HTTP 状态码 — MDN |
🔧 开发工具
资源 | 链接 |
🏠 Git | |
📖 Git 文档 | |
🏠 GitHub | |
📖 GitHub CLI (gh) | |
🏠 Python IDLE | |
📖 pytest 测试框架 | |
📖 unittest (内置) |
🚀 快速入门
先决条件
步骤 1 — 克隆与安装
git clone https://github.com/nandhakumar-murugan/antigravity-mcp-bridge.git
cd antigravity-mcp-bridge
pip install -r requirements.txt步骤 2 — 添加你的 ngrok 令牌
在 dashboard.ngrok.com/get-started/your-authtoken 获取你的令牌
编辑 run_with_tunnel.py:
AUTHTOKEN = "your_ngrok_authtoken_here"步骤 3 — 启动
# Windows (Double-click or run):
start_server.bat
# macOS / Linux:
python run_with_tunnel.py输出:
[INFO] NGROK MCP TUNNEL IS LIVE!
[LINK] PASTE THIS IN GEMINI SPARK: https://xxxx.ngrok-free.dev/mcp步骤 4 — 连接到 Gemini Spark
前往 设置 → 自定义已连接应用
粘贴:
https://xxxx.ngrok-free.dev/mcp接受权限 → 点击 保存
在任何聊天中输入
@Antigravity System Bridge即可激活!
💻 开发者集成指南
Python (官方 MCP SDK)
import asyncio
from mcp.client.session import ClientSession
from mcp.client.streamable_http import streamable_http_client
async def main():
url = "https://xxxx.ngrok-free.dev/mcp"
async with streamable_http_client(url) as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
print([t.name for t in tools.tools])
# Run a command
result = await session.call_tool("run_system_command", {
"command": "python --version"
})
print(result.content[0].text)
asyncio.run(main())cURL (任何语言)
curl -X POST https://xxxx.ngrok-free.dev/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"my-app","version":"1.0"}}}'Claude Desktop 配置
{
"mcpServers": {
"antigravity-bridge": {
"command": "python",
"args": ["run_with_tunnel.py"],
"env": { "NGROK_AUTHTOKEN": "your_token" }
}
}
}👥 谁将受益
🎓 学生
查看真实代码在你的磁盘上编写和运行 — 而非在虚假的沙盒中
AI 为你处理
pip install、虚拟环境和 PATH 设置通过观看 AI 实时修复真实的终端错误来学习调试
💻 工程师
完全自主的 TDD:AI 编写代码 → 运行测试 → 修复失败 → 重复
委派整个功能:"构建带认证的 REST API" → 几分钟内完成
不再需要在聊天和编辑器之间复制粘贴
🔬 研究人员
运行本地 Python 流水线,无需将敏感数据上传到云端
通过对话方式自动化实验脚本、基准测试和数据分析
通过终端命令使用本地 GPU 计算
📁 项目结构
antigravity-mcp-bridge/
├── server.py # Core MCP server with all 7 tool definitions
├── run_with_tunnel.py # One-click launcher (server + ngrok tunnel)
├── start_server.bat # Windows double-click starter
├── test_client.py # MCP connection verification script
├── calculator.py # Example: AI-generated code via Gemini Spark
├── test_calculator.py # Example: AI-generated tests (all 6 passed)
├── requirements.txt # Python dependencies
├── .gitignore
├── LICENSE # MIT
└── README.md📦 requirements.txt
mcp>=2.0.0
uvicorn
fastapi
pyngrok
python-dotenv🛡️ 安全
所有流量均通过 ngrok HTTPS 进行 TLS 加密
ngrok Authtoken 可防止未经授权的访问
所有终端执行均有 180 秒的 命令超时
terminate_task立即终止 任何正在运行的子代理所有操作在你的本地终端中 完全可见
📄 许可证
MIT 许可证 — 详情请参阅 LICENSE。
基于 Google 生态系统构建。由开放标准驱动。
⭐ 为这个仓库点赞 如果它帮助了你! | 🍴 Fork 为你的团队定制
This server cannot be installed
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Private-by-default, local-first memory/context/task orchestrator for MCP apps and agents.
Real-time planetary signal engine and Model Context Protocol (MCP) server for autonomous AI agents.
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceA comprehensive Model Context Protocol toolkit that transforms AI assistants into autonomous agents capable of executing real-world tasks across filesystems, web requests, Git workflows, databases, system commands, and AI integrations.MIT
- AlicenseNot gradedqualityCmaintenanceA secure, local communication runtime bridge that interfaces a cloud-based Large Language Model (Claude Desktop) with a local machine execution environment using the Model Context Protocol (MCP).Eclipse Public 2.0
- FlicenseNot gradedqualityBmaintenanceAn AI-powered development assistant that enables LLMs to securely interact with local development tools including Git, filesystem, Docker, PostgreSQL, and GitHub via the Model Context Protocol.
- AlicenseDqualityDmaintenanceEnables AI assistants to interact with local Docker containers, Kubernetes clusters, and system logs using the Model Context Protocol.922ISC
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/nandhakumar-murugan/gemini-antigravity-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server