---
id: w2/m5/t004
title: MCP list_deploys/get_deploy + GraphQL deploys query
worker: worker2
status: done
estimate: 25m
depends_on: [w2/m5/t002]
---

## Objective

Three-adapter parity for deploy history: MCP tools `list_deploys`/`get_deploy` under Render's official names/args (keyed on `serviceId`/`deployId`), and a GraphQL `deploys(serviceId)` query for the dashboard — all through the same verbs as REST.

## Context

- `render-oss/render-mcp-server` ships `list_deploys` and `get_deploy` — w2/m1's README explicitly deferred them "until Core grows those verbs"; this closes that deferral.
- GraphQL name should match Render's captured dashboard operation if an artifact exists in `docs/render-artifacts/`; else use `deploys` and note it as bex's own (the env-vars-mutations precedent).

## Steps

1. MCP fragments registering the two tools; tool errors for unknown ids, 503-equivalent when store-less.
2. GraphQL query + `Deploy` type.
3. Update `docs/ADR006-bex-api.md` MCP table and the w2/m1 "out of scope" note (now shipped).

## Files

- `lego/backend/internal/apps/mcp.go` / `graphql.go` (or deploys feature)
- `docs/ADR006-bex-api.md`

## Acceptance criteria

- [ ] MCP round-trip test: both tools advertised, results identical to REST for the same fixture.
- [ ] No second implementation — adapters call the same `ListDeploys`/`GetDeploy`.

## Out of scope

- Dashboard Deploys/Events UI (w5).
