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

# Build with AI

> Give your coding assistant Formal MCP, the Formal docs MCP server, and plain-text docs so it writes correct Formal configuration

## Overview

AI assistants write better Formal configuration when they can read current docs and your real organization state.
Formal gives them three sources.

| Source | What the assistant gets | Address |
| - | - | - |
| [Formal MCP](https://docs.formal.ai/docs/api/mcp-server.md) | The API reference, your organization's objects, and your logs. Approved clients can also make changes. | `https://mcp.formal.ai/mcp` |
| Formal Docs MCP | Search across these docs and the API reference | `https://docs.formal.ai/mcp` |
| Plain-text docs | An index of every page for LLMs | `https://docs.formal.ai/llms.txt` |

Inside the Control Plane, [Formal Agent](https://docs.formal.ai/docs/guides/getting-started/formal-agent.md) searches these docs, the API reference, and your logs for you.

## Connect Formal MCP

Formal MCP runs as the identity that signs in.
The client never sees or changes more than you can in the Control Plane.

> [tab] Claude Code
>
> ```bash theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
> claude mcp add formal https://mcp.formal.ai/mcp --transport http
> ```

> [tab] Cursor
>
> ```json theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
> {
>   "mcpServers": {
>     "formal": {
>       "url": "https://mcp.formal.ai/mcp"
>     }
>   }
> }
> ```

The client opens a browser so you can approve it.
See [Connect Formal MCP](https://docs.formal.ai/docs/api/mcp-server.md) for write access, other clients, and API keys.

## Connect the docs MCP server

Add `https://docs.formal.ai/mcp` to your client to let it search these docs.

```bash theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
claude mcp add formal-docs https://docs.formal.ai/mcp --transport http
```

**Verify:** Ask the assistant "How do Formal network rules select traffic?" It should cite a page from these docs.

To log and control what agents do with this server, route it through the MCP Gateway.
See [Formal Docs MCP](https://docs.formal.ai/docs/guides/core-concepts/connectors/mcp-servers/formal-docs.md).

## Use a page as context

Every page has a **Copy page** menu at the top.
Use it to copy the page as Markdown, or to open it in ChatGPT, Claude, Perplexity, Cursor, or VS Code.

For the whole site, point the assistant at the plain-text index:

```bash theme={"languages":{"custom":["/languages/cel.json","/languages/rego.json"]}}
curl -s https://docs.formal.ai/llms.txt
```

## Next Steps

> [card] [Connect Formal MCP](https://docs.formal.ai/docs/api/mcp-server.md)
>
> Sign in with OAuth or an API key, and control write access

> [card] [Formal Agent](https://docs.formal.ai/docs/guides/getting-started/formal-agent.md)
>
> Use the assistant built into the Control Plane

> [card] [Formal API](https://docs.formal.ai/docs/api/introduction.md)
>
> Call the API your assistant uses

> [card] [Terraform](https://docs.formal.ai/docs/guides/configuration/terraform.md)
>
> Have the assistant write Formal as code


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.