> ## Documentation Index
> Fetch the complete documentation index at: https://synthbrew.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex setup

> Configure Codex to use Synthbrew through the MCP server.

Use the Synthbrew MCP server in Codex to validate schemas, create projects, generate sources, and fetch runtime API details from chat.

## Prerequisites

* Codex installed
* A Synthbrew public API key

## Configure Codex

Add Synthbrew to `~/.codex/config.toml`:

```toml theme={null}
[mcp_servers.synthbrew]
command = "npx"
args = ["-y", "@synthbrew/agent"]

[mcp_servers.synthbrew.env]
SYNTHBREW_API_KEY = "sb_api_..."
SYNTHBREW_API_URL = "https://api.synthbrew.com/api"
```

Restart Codex after changing the configuration.

## Try a product prompt

Start a new chat and ask:

```text theme={null}
Use Synthbrew to generate a schema for a SaaS analytics app with accounts, users, subscriptions, invoices, and product events. Validate it first, then create a source with 100,000 rows and give me the connection details.
```

Codex should validate the schema before creating resources.

## Local package testing

Before publishing, point Codex at a local build instead of `npx`:

```toml theme={null}
[mcp_servers.synthbrew]
command = "node"
args = [
  "/path/to/synthbrew/packages/agent/dist/index.js"
]

[mcp_servers.synthbrew.env]
SYNTHBREW_API_KEY = "sb_api_..."
SYNTHBREW_API_URL = "http://localhost:3355/api"
```
