Skip to main content
Glama

⚡ Antigravity MCP Bridge

开源桥梁,通过模型上下文协议将 Google Cloud AI 连接到您的本地机器

Model Context Protocol Gemini Spark Google Cloud Python ngrok MIT License GitHub Stars


已验证的概念验证:一条 Gemini Spark 提示 — "创建一个带单元测试的计算器" — 在不到 3 秒内生成了可运行的 Python 代码,运行并提交到了 GitHub。零人工复制粘贴。

架构工具 API快速入门Google 生态系统开发者文档资源与链接受益人群


🧩 这个项目是什么?

Antigravity MCP Bridge 打破了云端 AI 与本地机器之间的壁垒。它运行一个本地**模型上下文协议(MCP)**服务器,通过安全的 HTTPS 隧道将您的整个操作系统 — 终端、文件、编译器和 Git — 暴露给任何兼容 MCP 的 AI 编排器。

将其连接到 Google Gemini Spark,您就拥有了一位完全自主的 AI 软件工程师,可以直接在您的磁盘上规划、编码、测试、修复和交付软件。


Related MCP server: Nexus-MCP

🏗️ 系统架构

┌────────────────────────────────────────────────────────────────────┐
│                🌐  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      │ │
│  └──────────────┘  └──────────────┘  └──────────────────────────┘ │
└────────────────────────────────────────────────────────────────────┘

传输协议

端点

协议

最佳用途

/mcp

流式 HTTP(MCP 2.0)

Google Gemini Spark、Vertex AI、所有现代 MCP 客户端

/sse

服务器发送事件(SSE)

旧版 MCP 客户端、自定义集成

/messages

HTTP POST

在 SSE 会话中发布消息


🧰 完整工具参考

🔧 工具 1:run_system_command

执行任何 shell、PowerShell 或 Bash 命令。捕获退出代码、stdout、stderr。

参数

类型

必填

描述

command

string

要执行的完整 shell 命令

working_dir

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 生成。自动创建目录。

参数

类型

必填

描述

file_path

string

绝对或相对文件路径

content

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

读取并返回任何本地文件的完整内容。

参数

类型

必填

描述

file_path

string

文件路径

{
  "name": "read_file",
  "arguments": { "file_path": "src/main.py" }
}

用途: 重构前检查代码、读取日志、审计配置、读取数据集。


📂 工具 4:list_directory

枚举文件和目录,显示类型和大小。

参数

类型

必填

描述

directory_path

string

要列出的目录(默认为当前工作目录)

{
  "name": "list_directory",
  "arguments": { "directory_path": "C:/Users/dev/myproject" }
}

用途: 发现项目结构、验证文件是否已创建、审计仓库。


🤖 工具 5:run_agent_task

为复杂的多步骤目标生成一个自主运行的Antigravity AI 子代理。立即返回一个 task_id

参数

类型

必填

描述

prompt

string

高层级的自然语言目标

workspace_dir

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

轮询后台子代理任务的实时进度、输出和错误。

参数

类型

必填

描述

task_id

string

来自 run_agent_task 的任务 ID

{
  "name": "get_agent_status",
  "arguments": { "task_id": "a1b2c3d4" }
}
// Returns: { "status": "completed", "output": "...", "error": null }

🛑 工具 7:terminate_task

安全取消任何正在运行的后台子代理任务。

参数

类型

必填

描述

task_id

string

要取消的任务 ID


🔗 Google 生态系统集成

Gemini Spark

通过自定义连接应用将您的桥接器连接到 Gemini。

Google Cloud

将桥接器部署到云端或与 Cloud AI 集成。

Vertex AI

企业级 AI 编排,支持本地执行。

Google Workspace

将 Docs、Drive、Gmail 用作 AI 上下文来源。


📚 官方文档与外部资源

🔵 模型上下文协议(MCP)

资源

链接

🏠 MCP 官方网站

modelcontextprotocol.io

📖 MCP 介绍

modelcontextprotocol.io/introduction

📖 MCP 快速入门指南

modelcontextprotocol.io/quickstart

📖 MCP 规范

spec.modelcontextprotocol.io

🐍 Python MCP SDK(官方)

github.com/modelcontextprotocol/python-sdk

📦 PyPI 上的 MCP

pypi.org/project/mcp

🐙 MCP GitHub 组织

github.com/modelcontextprotocol

📖 MCP 传输参考

modelcontextprotocol.io/docs/concepts/transports

📖 MCP 工具参考

modelcontextprotocol.io/docs/concepts/tools


🟣 Google Antigravity(AGY)

资源

链接

🏠 Antigravity 主页

antigravity.google

📖 Antigravity 文档

antigravity.google/docs

📖 MCP 集成指南

antigravity.google/docs/mcp

📖 技能系统

antigravity.google/docs/skills

📖 Python SDK

antigravity.google/docs/sdk

📖 钩子与插件

antigravity.google/docs/hooks

📖 代理权限

antigravity.google/docs/permissions

📖 更新日志

antigravity.google/changelog


🔵 Google Gemini 与 AI API

资源

链接

🏠 Google Gemini 应用

gemini.google.com

📖 Gemini API 文档

ai.google.dev/gemini-api/docs

📖 Gemini API 快速入门

ai.google.dev/gemini-api/docs/quickstart

📖 Google Workspace 版 Gemini

workspace.google.com/intl/en/products/gemini

📖 Google AI Studio

aistudio.google.com

📖 已连接应用 (MCP) 帮助

support.google.com/gemini?p=lm_custom_mcp_trust

🐙 Google Generative AI GitHub

github.com/google-gemini


☁️ Google Cloud Platform

资源

链接

🏠 Google Cloud 控制台

console.cloud.google.com

📖 Vertex AI 文档

cloud.google.com/vertex-ai/docs

📖 Cloud Run 文档

cloud.google.com/run/docs

📖 Cloud Build 文档

cloud.google.com/build/docs

📖 Google Cloud APIs 浏览器

cloud.google.com/apis

📖 AI 与机器学习产品

cloud.google.com/products/ai


🐍 Python 与核心库

资源

链接

🏠 Python 官方网站

python.org

📖 Python 文档

docs.python.org/3

📦 PyPI 包索引

pypi.org

📖 pip 文档

pip.pypa.io/en/stable

📖 asyncio 文档

docs.python.org/3/library/asyncio.html

📖 subprocess 文档

docs.python.org/3/library/subprocess.html


🌐 Web 与 ASGI 框架

资源

链接

🏠 Uvicorn (ASGI 服务器)

uvicorn.org

📖 Uvicorn 文档

uvicorn.org/settings

🏠 Starlette 框架

starlette.io

📖 Starlette 文档

starlette.io/applications

📖 Starlette 路由

starlette.io/routing

📖 CORS 中间件

starlette.io/middleware/#corsmiddleware

🏠 FastAPI

fastapi.tiangolo.com

📖 FastAPI 文档

fastapi.tiangolo.com/tutorial


🔒 隧道与安全暴露

资源

链接

🏠 ngrok 官方网站

ngrok.com

📖 ngrok 文档

ngrok.com/docs

📖 ngrok HTTP 隧道

ngrok.com/docs/http

📦 pyngrok (Python SDK)

pypi.org/project/pyngrok

📖 pyngrok 文档

pyngrok.readthedocs.io

🏠 Cloudflare 隧道

cloudflare.com/products/tunnel

📖 Cloudflare 隧道文档

developers.cloudflare.com/cloudflare-one/connections/connect-networks


📡 JSON-RPC 与 SSE 规范

资源

链接

📖 JSON-RPC 2.0 规范

jsonrpc.org/specification

📖 服务器发送事件 (SSE) — MDN

developer.mozilla.org/en-US/docs/Web/API/Server-sent_events

📖 HTTP 状态码 — MDN

developer.mozilla.org/en-US/docs/Web/HTTP/Status


🔧 开发工具

资源

链接

🏠 Git

git-scm.com

📖 Git 文档

git-scm.com/doc

🏠 GitHub

github.com

📖 GitHub CLI (gh)

cli.github.com

🏠 Python IDLE

docs.python.org/3/library/idle.html

📖 pytest 测试框架

docs.pytest.org

📖 unittest (内置)

docs.python.org/3/library/unittest.html


🚀 快速入门

先决条件

Python ngrok Git

步骤 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

  1. 打开 gemini.google.com

  2. 前往 设置 → 自定义已连接应用

  3. 粘贴:https://xxxx.ngrok-free.dev/mcp

  4. 接受权限 → 点击 保存

  5. 在任何聊天中输入 @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 生态系统构建。由开放标准驱动。

Gemini Cloud MCP Python ngrok GitHub

⭐ 为这个仓库点赞 如果它帮助了你! | 🍴 Fork 为你的团队定制

🐛 报告问题 · 💬 讨论 · 🤝 贡献

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    A comprehensive Model Context Protocol server implementation that enables AI assistants to interact with file systems, databases, GitHub repositories, web resources, and system tools while maintaining security and control.
    49
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    A 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
  • A
    license
    Not graded
    quality
    C
    maintenance
    A unified context layer that connects your local data — repositories, documents, remote machines, and notes — to LLM interfaces through the Model Context Protocol (MCP).
    3
    MIT

View all related MCP servers

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.

  • OCR, transcription, file extraction, and image generation for AI agents via MCP.

View all MCP Connectors

Latest Blog Posts

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/antigravity-mcp-bridge'

If you have feedback or need assistance with the MCP directory API, please join our Discord server