Agy MCP Server
tphakala/agy-mcp
Executa prompts Antigravity como jobs gerenciados e resilientes via MCP
Ver no GitHubServidor MCP que encapsula a CLI Antigravity (agy) para executar prompts e revisões de código como jobs assíncronos e resilientes a reinicializações. Funciona tanto via stdio quanto HTTP Streamable, permitindo que qualquer cliente MCP (Claude Code, Cursor, Cline) acesse nativamente ferramentas de automação agy sem problemas de bloqueio ou timeouts.
Instalação
npx convez-ai tphakala/agy-mcp1 comando no terminal: detecta o formato do repositório (marketplace ou plugin avulso) e instala via Claude Code. Requer Node 18+ e o Claude Code instalado.
Métricas
Casos de uso
- Automação de prompts Antigravity em fluxos de trabalho MCP
- Revisões de código assíncronas que resistem a desconexões
- Integração de agy em múltiplos clientes MCP via HTTP
Veredito

Solução robusta e bem arquitetada para integrar Antigravity em ecossistemas MCP, resolvendo problemas reais de bloqueio e timeouts. Excelente para equipes que automatizam código com agy e precisam de orquestração confiável.
README
A tradução para o português deste README ainda está na fila.
agy-mcp
An MCP (Model Context Protocol) server that wraps the Antigravity CLI (agy), so any MCP client (Claude Code, Cursor, Cline, and others) can run agy prompts, peer reviews, and follow-up turns as native tools.
Status: feature complete (stdio and HTTP transports, async and sync job lifecycle, model and session discovery, cross-platform builds) and verified against a live agy (1.0.7).
Why
Driving agy from a shell for automation has two recurring problems:
agy -p(print mode) reads stdin even when the prompt is passed with-p. If stdin is an open pipe that never closes, it blocks indefinitely. The fix is to always close stdin (</dev/null), which is easy to forget.- A review can run for many minutes. A single blocking call ties up the caller and can exceed a client's tool-call timeout with nothing recoverable.
agy-mcp solves both by running agy as managed, asynchronous jobs behind a small, typed tool surface, and by capturing output to disk so a run survives a client disconnect or a server restart.
What it provides
agy_run/agy_status/agy_cancel: start anagyprompt, poll for completion, cancel if needed.agy_run_sync: start a prompt and wait for it inline (bounded, with MCP progress notifications); returns thejob_idto poll if it outlives the wait cap.list_models: enumerate availableagymodels.list_sessions: list known conversations so review threads can be continued.
Session continuation rides agy's own durable conversation store (--conversation <id>), so threads survive across calls without keeping a process warm.
Two transports run the same core:
- stdio (default): zero-config, one line in your MCP client config.
- Streamable HTTP (opt-in): a long-lived, loopback-only daemon for multi-client use. See HTTP mode.
Requirements
- The
agybinary onPATH(or configured explicitly viaAGY_MCP_AGY_PATH). - Go 1.26+ to build.
- The server builds and runs on Linux, macOS, and Windows. Job supervision (running agy as managed jobs via
agy_run/agy_run_sync/agy_status/agy_cancel) relies on process groups,/proc, and the kernel boot id, so it runs on Linux only; on macOS and Windows those tools return a clear "job supervision is only supported on Linux" error, while stdio/HTTP serving,list_models, andlist_sessionswork everywhere.
Note: every job spawns a fresh
agyprocess, which on startup launches whatever MCP servers are configured in agy's ownmcp_config.json. Peer-review and automation runs usually do not need those servers, and a slow or hanging one adds latency to every job. agy 1.0.7+ bounds this with a per-server launchtimeout(set-1to disable it). If startup is slow, give the unneeded servers atimeoutin agy'smcp_config.json, or point agy at a trimmed config.
Install
go install github.com/tphakala/agy-mcp@latest
Use with Claude Code (stdio)
claude mcp add agy -- agy-mcp
Or add to your MCP client config:
{
"mcpServers": {
"agy": { "command": "agy-mcp" }
}
}
Tools
agy_run(prompt, model?, dirs?, conversation_id?, continue_latest?, cwd?, timeout?)->{ job_id, conversation_id?, state }agy_run_sync(prompt, model?, dirs?, conversation_id?, continue_latest?, cwd?, timeout?, wait?)->{ job_id, state, elapsed, result?, error?, conversation_id?, note? }agy_status(job_id)->{ state, elapsed, result?, error?, conversation_id? }agy_cancel(job_id)->{ state }list_models()->{ models }list_sessions(dir?)->{ sessions }
A fresh agy_run (no conversation_id, no continue_latest) starts with an empty
conversation_id; agy assigns one as the run proceeds, and agy_status reports it once the
run completes, so the thread can be continued later. To keep that capture unambiguous, fresh
runs sharing a cwd are serialized: while one fresh run is active, a second fresh run in the
same directory is refused (agy_run returns a conflict error rather than queuing it), so run
them in separate directories or retry once the first finishes. Runs in different directories,
and runs continuing distinct conversations, still run concurrently up to the configured cap.
The gate that enforces this is rebuilt at startup from jobs whose supervisor outlived a server
restart, so the cap and serialization hold across restarts.
HTTP mode
agy-mcp -http 127.0.0.1:8765
HTTP mode is opt-in and only accepts a loopback bind address (localhost, 127.0.0.1, or ::1). A non-loopback address (including :8765, which binds all interfaces) is refused at startup, so it cannot be accidentally exposed.
Two extra hardening layers are always available:
- Origin/CSRF protection is always on. A state-changing cross-origin browser request (one carrying a cross-site
Sec-Fetch-Siteor a mismatchedOrigin) is rejected with403. Normal non-browser MCP clients (Claude Code, Cursor, the go-sdk client) send noOriginheader and are unaffected. - Optional bearer token. Set
-http-token <token>(orAGY_MCP_HTTP_TOKEN) to requireAuthorization: Bearer <token>on every request; a missing or wrong token gets401. The flag overrides the env var. Off by default, so the bare loopback mode stays unauthenticated.
agy-mcp -http 127.0.0.1:8765 -http-token "$(openssl rand -hex 32)"
Configuration
| Env | Default | Meaning |
|---|---|---|
AGY_MCP_AGY_PATH | agy on PATH | path to the agy binary |
AGY_MCP_STATE_DIR | $XDG_STATE_HOME/agy-mcp | job state directory |
AGY_MCP_DEFAULT_MODEL | agy default | default model |
AGY_MCP_HTTP_TOKEN | (none) | optional bearer token for HTTP mode; empty = unauthenticated |
Development
go build ./...
go test ./... -race
golangci-lint run
CI builds and vets on Linux and macOS, runs the race-enabled test suite on Linux, and cross-compiles for Windows.
License
MIT. See LICENSE.