AI Skill Hub 推荐使用:反重力工作空间 是一款优质的MCP工具。已获得 1.2k 颗 GitHub Star,AI 综合评分 7.8 分,在同类工具中表现稳健。如果你正在寻找可靠的MCP工具解决方案,这是一个值得深入了解的选择。
反重力工作空间 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
反重力工作空间 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/study8677/antigravity-workspace-template
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"-------": {
"command": "npx",
"args": ["-y", "antigravity-workspace-template"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 反重力工作空间 执行以下任务... Claude: [自动调用 反重力工作空间 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"_______": {
"command": "npx",
"args": ["-y", "antigravity-workspace-template"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
<img src="docs/assets/logo.png" alt="Antigravity Workspace" width="200"/>
ag init Inject context files into any project (--force to overwrite)
│
▼
.antigravity/ Shared knowledge base — every IDE reads from here
│
├──► ag-refresh Dynamic multi-agent self-learning → module knowledge docs + structure map
├──► ag-ask Router → ModuleAgent Q&A with live code evidence
└──► ag-mcp Optional MCP server → IDE tool integration
Dynamic Multi-Agent Cluster — During ag-refresh, the engine uses smart functional grouping: files are grouped by import relationships, directory co-location, and filename prefixes. Source code is pre-loaded directly into agent context (no tool calls needed), and build artifacts are automatically filtered out. Each sub-agent analyzes ~30K tokens of focused, functionally related code in a single LLM call and outputs a comprehensive Markdown knowledge document (agents/*.md). For large modules, multiple sub-agents run in parallel — each produces its own agent.md (no merging, no information loss). A Map Agent reads all agent docs and generates map.md — a routing index. During ag-ask, Router reads map.md to select relevant modules, then feeds their agent docs to answer agents. For structural questions (call chains, dependencies, impact analysis), the Router automatically queries GitNexus code graph for precise relationships. Fully language-agnostic — module detection uses pure directory structure, code analysis is done entirely by LLMs. Works with any programming language.
GitAgent — A dedicated agent for analyzing git history — understands who changed what and why.
GitNexus Graph Enrichment (optional) — Install GitNexus to auto-unlock graph-enriched answers. The Router LLM decides when a question needs structural analysis (call chains, dependencies, impact) and queries GitNexus automatically — combining precise graph data with semantic understanding from agent docs.
NLPM Audit Feedback — This repository has benefited from NLPM, a natural-language programming linter for Claude Code plugins, skills, and agent definitions by xiaolai. Its audit helped identify useful improvements in skill frontmatter and dependency hygiene.
---
<details> <summary><b>MCP Server — Give Claude Code a ChatGPT for your codebase</b></summary>
Instead of reading hundreds of documentation files, Claude Code can call ask_project as a live tool — backed by a dynamic multi-agent cluster: Router routes questions to the right ModuleAgent, returning grounded answers with file paths and line numbers.
Setup:
```bash
npm install -g gitnexus
Run this once per project, right after installing the plugin. Interactive picker for the LLM provider (OpenAI / DeepSeek / Groq / 阿里灵积 / NVIDIA NIM / Ollama local / any OpenAI-compatible endpoint), then writes .env to the project root with OPENAI_BASE_URL, OPENAI_API_KEY, OPENAI_MODEL, AG_ASK_TIMEOUT_SECONDS. Also ensures .env is in .gitignore. Skip it if you already have a working .env.
```
Deploys the multi-agent cluster to read your code: each module gets its own Agent that produces a knowledge doc under .antigravity/agents/*.md, plus a map.md routing index. Run after install, after significant code changes, or when ag-ask returns stale answers. The first refresh auto-creates .antigravity/ — no separate init step needed. Pass quick for an incremental update, failed-only to rerun only previously failed modules.
```
/plugin marketplace add study8677/antigravity-workspace-template /plugin install antigravity@antigravity /antigravity:ag-setup # interactive: pick LLM provider, paste API key, writes .env /antigravity:ag-refresh # runs ag-refresh directly; first refresh auto-creates .antigravity/ /antigravity:ag-ask "How does this project work?" # runs ag-ask directly
pipx install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=engine" codex plugin marketplace add study8677/antigravity-workspace-template /ag-setup # same flow, no antigravity: prefix in Codex /ag-refresh /ag-ask "How does this project work?"
Codex CLI auto-discovers slash commands from the plugin's `commands/` directory, so the same four commands work without the `antigravity:` namespace prefix (`/ag-setup`, `/ag-refresh`, `/ag-ask`, `/ag-init`). The raw CLI calls (`ag-refresh --workspace .`, `ag-ask "..." --workspace .`) also still work. If your Codex build supports MCP and you want tool-style integration, register `ag-mcp --workspace <project>` separately.
After install + setup you get `ag-ask <question>`, `ag-refresh`, and `ag-init <name>` slash commands in both hosts. MCP remains optional (`ask_project` + `refresh_project`) via `ag-mcp`; see [docs/examples/antigravity.mcp.json](docs/examples/antigravity.mcp.json). See [INSTALL.md](INSTALL.md) for details and troubleshooting.
**Option B — Manual install: engine + CLI via pip**bash
pip install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=cli" pip install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=engine"
ag-refresh --workspace .
pip install "git+https://...#subdirectory=cli" pip install "git+https://...#subdirectory=engine"
For local work on this repository itself:
bash python3 -m venv venv source venv/bin/activate pip install -e ./cli -e './engine[dev]' pytest engine/tests cli/tests ```
---
pip install "git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=engine"
Option A — Plugin install for Claude Code / Codex CLI ```bash
cd my-project cat > .env <<EOF OPENAI_BASE_URL=https://your-endpoint/v1 OPENAI_API_KEY=your-key OPENAI_MODEL=your-model AG_ASK_TIMEOUT_SECONDS=120 EOF
claude mcp add antigravity ag-mcp -- --workspace $(pwd)
**Option C — Context files only (any IDE, no LLM needed)**bash pip install git+https://github.com/study8677/antigravity-workspace-template.git#subdirectory=cli ag init my-project && cd my-project
| Command | What it does | LLM needed? |
|---|---|---|
ag init <dir> | Inject cognitive architecture templates | No |
ag init <dir> --force | Re-inject, overwriting existing files | No |
ag refresh --workspace <dir> | CLI convenience wrapper around the knowledge-hub refresh pipeline | Yes |
ag ask "question" --workspace <dir> | CLI convenience wrapper around the routed project Q&A flow | Yes |
ag-refresh | Multi-agent self-learning of codebase, generates module knowledge docs + conventions.md + structure.md | Yes |
ag-ask "question" | Router → ModuleAgent/GitAgent routed Q&A | Yes |
ag-mcp --workspace <dir> | **Start MCP server** — exposes ask_project + refresh_project to Claude Code | Yes |
ag report "message" | Log a finding to .antigravity/memory/ | No |
ag log-decision "what" "why" | Log an architectural decision | No |
ag ask / ag refresh are available when both cli/ and engine/ are installed. ag-ask / ag-refresh are the engine-only entrypoints.
---
antigravity-workspace-template/
├── cli/ # ag CLI — lightweight, pip-installable
│ └── templates/ # .cursorrules, CLAUDE.md, .antigravity/, ...
└── engine/ # Multi-agent engine + Knowledge Hub
└── antigravity_engine/
├── _cli_entry.py # ag-ask / ag-refresh / ag-mcp + python -m dispatch
├── config.py # Pydantic configuration
├── hub/ # ★ Core: multi-agent cluster
│ ├── agents.py # Router + ModuleAgent + GitAgent
│ ├── contracts.py # Pydantic models: claims, evidence, refresh status
│ ├── ask_pipeline.py # agent.md + graph-enriched ask
│ ├── refresh_pipeline.py # LLM-driven refresh → agents/*.md + map.md
│ ├── ask_tools.py
│ ├── scanner.py # multi-language project scanning
│ ├── module_grouping.py # smart functional file grouping
│ ├── structure.py
│ ├── knowledge_graph.py
│ ├── retrieval_graph.py
│ └── mcp_server.py
├── mcp_client.py # MCP consumer (connects external tools)
├── memory.py # Persistent interaction memory
├── tools/ # MCP query tools + extensions
├── skills/ # Skill loader
└── sandbox/ # Code execution (local / microsandbox)
CLI (pip install .../cli) — Zero LLM deps. Injects templates, logs reports & decisions offline.
Engine (pip install .../engine) — Repository knowledge runtime. Powers ag-ask, ag-refresh, ag-mcp. Uses the OpenAI-compatible endpoint written by ag-setup (OpenAI, DeepSeek, Groq, DashScope, NVIDIA NIM, Ollama, or custom).
New skill packaging updates: - engine/antigravity_engine/skills/graph-retrieval/ — graph-oriented retrieval tools for structure and call-path reasoning. - engine/antigravity_engine/skills/knowledge-layer/ — project knowledge-layer tools for semantic context consolidation.
```bash
ag-refresh --workspace /path/to/project
ag-refresh
ag-ask "What testing patterns does this project use?"
Asymmetric benchmark on three real-world Python codebases — fastapi/fastapi, psf/requests, fastapi/sqlmodel — asking each tool the same 36 questions across three difficulty bands. All three tools used gpt-5.5 with high reasoning effort; Codex and Claude had full read access to the workspace. Codex was the grader (4-axis 0–3 rubric, scores verified against actual source).
| Question type | Antigravity | Codex CLI | Claude Code |
|---|---|---|---|
| 15 factual lookups | **179/180 (99%)** | 179/180 (99%) | 178/180 (99%) |
| 12 synthesis (project / arch tour) | 116/144 (81%) | **144/144 (100%)** | 136/144 (94%) |
| 9 audit / security | **105/108 (97%)** | 104/108 (96%) | 98/108 (91%) |
Combined factual + audit (24 cells): Antigravity 284/288, Codex 283/288, Claude 276/288. Antigravity edges out both — at lower latency than Codex on every single question.
Latency (mean wall-clock per question, same proxy):
| Question type | Antigravity | Codex | Claude |
|---|---|---|---|
| Factual | **56s** | 119s | 42s |
| Audit | 160s | 177s | **100s** |
Antigravity is 2.1× faster than Codex on factual and on par with Codex on audit, while matching or beating it on correctness. Claude is fastest on audit but loses 7 percentage points of correctness.
What changed in this repo to get there. Two engine fixes landed during the benchmark, both committed in this branch:
1. _ask_with_agent_md now surfaces project-level docs (conventions.md, module_registry.md, map.md, structure.md) into its answer prompts. Removes the “module knowledge does not include project-wide conventions” refusal pattern. 2. The structured-facts answer agents now have search_code, read_file, list_directory, read_file_metadata, search_by_type bound at runtime, so the LLM can grep and read actual source instead of paraphrasing the KG.
Full report (data, methodology, per-cell tables, caveats): artifacts/benchmark-2026-05-09/REPORT.md.
---
ag-refresh builds the repository knowledge base. ag-ask routes questions to the right module context with source evidence. Plugins, CLI commands, and MCP are delivery channels around that core workflow.
Language: English | 中文 | Español
<br/>
<img src="https://img.shields.io/badge/Cursor-✓-000000?style=flat-square" alt="Cursor"/> <img src="https://img.shields.io/badge/Claude_Code-✓-D97757?style=flat-square" alt="Claude Code"/> <img src="https://img.shields.io/badge/Windsurf-✓-06B6D4?style=flat-square" alt="Windsurf"/> <img src="https://img.shields.io/badge/Gemini_CLI-✓-4285F4?style=flat-square" alt="Gemini CLI"/> <img src="https://img.shields.io/badge/VS_Code_+_Copilot-✓-007ACC?style=flat-square" alt="VS Code"/> <img src="https://img.shields.io/badge/Codex-✓-412991?style=flat-square" alt="Codex"/> <img src="https://img.shields.io/badge/Cline-✓-FF6B6B?style=flat-square" alt="Cline"/> <img src="https://img.shields.io/badge/Aider-✓-8B5CF6?style=flat-square" alt="Aider"/>
</div>
<br/>
<br/>
The main reason this plugin exists. Routes your question to the right ModuleAgent (and GitAgent / GitNexus when applicable), then returns an answer grounded in actual source with file paths and line numbers. Use it before manually grepping or reading files — it's faster and more accurate. Good question shapes: "where is X defined/handled?", "why was Y done this way?", "how does the auth flow work?", "what depends on module Z?".
```
ag-ask "How does auth work in this project?"
The ask pipeline uses a dual-path architecture: - Semantic path: Router reads map.md → selects modules → reads agents/*.md → LLM answers with code references. Multiple agent docs are read in parallel, then a Synthesizer combines answers. - Graph path (automatic): Router LLM decides if the question needs structural analysis → queries GitNexus for call chains, dependencies, or impact → injects graph data into the answer context. Silently skipped if GitNexus is not installed.
Falls back to the legacy Router → ModuleAgent/GitAgent swarm when agent docs are not yet generated.
---
创新的多智能体框架,整合MCP协议与代码分析能力,1.2k Stars体现社区认可度。架构清晰但文档需完善。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
总体来看,反重力工作空间 是一款质量良好的MCP工具,在同类工具中具备一定竞争力。AI Skill Hub 将持续追踪其更新动态,建议收藏备用,结合自身场景选择合适时机引入使用。
| 原始名称 | antigravity-workspace-template |
| Topics | 多智能体MCP协议代码分析知识引擎AI编码 |
| GitHub | https://github.com/study8677/antigravity-workspace-template |
| License | MIT |
| 语言 | Python |
收录时间:2026-05-24 · 更新时间:2026-05-24 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端