# Goa & Goa-AI: Let agents reason. Let Goa generate.

- **For coding agents:** Goa gives coding agents less code to write and one contract to reason from. Edit [design/*.go](/docs/ai-development/), run `goa gen`, and let the Go compiler flag every handler or client that needs an update.
- **For AI products:** Compile HTTP, gRPC, JSON-RPC, and OpenAPI 3.2 servers with [Goa](/docs/1-goa/), and add [Goa-AI](/docs/2-goa-ai/) for tool-using agents, Streamable HTTP MCP servers, and clustered tool registries.

GitHub: [Goa](https://github.com/goadesign/goa) · [Goa-AI](https://github.com/goadesign/goa-ai)

Source: https://goa.design/

```go
// design/catalog.go -> goa gen example.com/catalog/design
var LookupPayload = Type("LookupPayload", func() {
    Field(1, "sku", String, func() { Pattern("^[A-Z0-9-]+$") })
    Required("sku")
})
var _ = Service("catalog", func() {
    Error("not_found", ErrorResult)
    JSONRPC(func() { POST("/rpc") })
    Method("lookup", func() {
        Payload(LookupPayload)
        Result(Product)
        Error("not_found")
        HTTP(func() { GET("/products/{sku}") })
        GRPC(func() {})
        JSONRPC(func() {})
    })
})
// Generated in gen/catalog/service.go (0 LLM tokens); you implement:
// Lookup(ctx context.Context, p *LookupPayload) (*Product, error)
```

## Get started

**1. Install**

```bash
npx skills add goadesign/goa --skill goa-service-designer
# or standalone Go CLI (Go 1.27+, then follow /docs/1-goa/ or /docs/2-goa-ai/):
go install goa.design/goa/v3/cmd/goa@latest
```

**2. Prompt your agent**

```text
Use goa-service-designer to create design/catalog.go with HTTP and gRPC endpoints, run go run goa.design/goa/v3/cmd/goa@latest gen example.com/catalog/design, implement Lookup, and test it.
```

[Build a service](https://goa.design/docs/1-goa/quickstart/) · [Build an AI agent](https://goa.design/docs/2-goa-ai/quickstart/) · [Setup guide](https://goa.design/docs/ai-development/#install-the-skill)

## Why contract generation

### 54 lines of DSL → 57 generated files

In the [catalog walkthrough](/docs/ai-development/#one-design-two-entry-points), 54 lines of `design/catalog.go` compile 5,000+ lines of Go transports, OpenAPI, Protobuf, and tool schemas in zero LLM tokens.

### One contract to load into context

Payloads, validations, and routes live in `design/*.go`. Your coding agent reads one contract instead of four hand-wired layers.

### Compiler errors catch drift immediately

Update `design/` and rerun `goa gen`. Go flags every handler, client, and tool executor whose signature changed.


## Goa

Declare payloads, validations, and errors once in Go. Generate standard `net/http`, gRPC, and JSON-RPC servers, typed clients, and OpenAPI 3 / Protobuf specs.

HTTP, gRPC, JSON-RPC. Servers, typed Go clients, and CLI clients compiled from one design.

Required fields, patterns, ranges, error status codes, OpenAPI 3.2, and Protocol Buffers.

[Explore Goa](https://goa.design/docs/1-goa/)

## Goa-AI

Build tool-using AI agents and MCP servers from the same Go DSL. Test locally in memory, then run on OpenAI, Anthropic, Bedrock, Vertex AI, or Temporal.

Expose existing Goa methods as tools, bind tenant IDs server-side so prompts cannot spoof them, and cap large paginated responses. Compose child agents with bounded budgets and test tool trajectories deterministically without live LLM calls.

Pause sensitive tool calls for human approval, stream typed UI events to clients, or run MCP servers standalone.

[Explore Goa-AI](https://goa.design/docs/2-goa-ai/)

## Create MCP servers from your services.

Your Goa design → `goa gen` → Generated MCP interface.

- **HTTP server**: Streamable HTTP MCP handlers wired to your Goa endpoints.

- **Typed clients**: Call MCP tools and read resources via generated Go methods.

- **Tool schemas**: Input and output JSON Schemas derived from `LookupPayload`.

- **Validation and codecs**: Reject malformed arguments with retry hints before your handler runs.


**One contract to review**: Review types and auth in `design/catalog.go`, implement `Lookup` once, and regenerate `gen/` when rules change.

**Clear work for coding agents**: Your coding agent edits `design/` and `internal/` while `gen/` stays read-only, turning schema drift into Go compiler errors.

Supports OAuth resource servers, interactive input exchanges, durable Tasks, MCP Apps, and Skills.

[Build an MCP server](https://goa.design/docs/2-goa-ai/mcp-integration/)

## Host a registry for your tools.

Publish toolsets to one clustered gateway over Redis and [Pulse](/docs/3-ecosystem/pulse/) so agents load schemas on demand.

[Host a tool registry](https://goa.design/docs/2-goa-ai/registry/)

## How Goa & Goa-AI compare

| Capability | Goa & Goa-AI | buf / Connect + oapi-codegen | Go MCP SDKs (go-sdk, mcp-go) | Python / TS Agent SDKs |
| --- | --- | --- | --- | --- |
| Source of truth | One Go design package | Separate `.proto` and OpenAPI YAML | Struct tags per handler | Pydantic or Zod in app code |
| HTTP, gRPC & OpenAPI | Compiled in 0 model tokens | Split across separate generators | MCP transport only | Separate web framework |
| MCP servers & schemas | Derived from the same service | Hand-written adapter layer | Duplicated from HTTP types | Separate Python or TS runtime |
| Agents & durable runs | Typed Go binary + Temporal | Out of scope | Out of scope | Interpreted Python or TS runtime |

## Can I adopt Goa incrementally, and do I commit gen/?

Yes to both. `goa gen` emits standard `net/http` and `google.golang.org/grpc` code you can mount alongside existing routes and commit in `gen/`.

## How do non-Go clients call Goa, and when do I add Goa-AI?

TypeScript, Python, and mobile apps use the generated OpenAPI 3.2 and `.proto` specs. Add Goa-AI when exposing MCP tools or running product agents.

## Can I use Goa-AI just to expose an MCP server?

Yes. Add `MCP(...)` and `Tool(...)` to a Goa service to generate JSON Schemas and Streamable HTTP handlers without an agent loop.

## When is Goa not a fit, and how should we evaluate it?

Skip Goa for throwaway scripts. For multi-endpoint services, compare one real feature end to end starting from the [catalog walkthrough](/docs/ai-development/#one-design-two-entry-points).


## Companion libraries and multi-agent tools

- **[Chorus](https://goa.design/chorus/)**: Local MCP server that gives Claude Code, Codex, and Gemini shared channels, direct messages, and pinned plans at zero idle tokens.
- **[Highbay](https://goa.design/highbay/)**: Guided browser workspace where you confirm a change card and architecture diagram while one agent builds and a second agent tests in clean Git worktrees.
- **[Pulse](https://goa.design/docs/3-ecosystem/pulse/) · [Clue](https://goa.design/docs/3-ecosystem/clue/) · [Model](https://goa.design/docs/3-ecosystem/model/)**: Redis event streams and worker pools (`Pulse`), OpenTelemetry tracing and health checks (`Clue`), and C4 architecture diagrams in Go (`Model`).
