# Overview

> Architure is where a team defines its software architecture, from the tech stack to the deployment, and serves it to its AI agents through an MCP server and a skill.

Source: https://docs.architure.dev/docs

Agents now write most of the code, so the decisions around it are what matter: which technologies to use, how the repositories are split, what each database holds, how agents should work, which configuration each app reads and where it is deployed. Architure keeps those decisions in one place. You define them once, and every agent reads them for the package it works in before it writes a line, instead of guessing in every session.

## The lifecycle

The docs follow the order in which a team usually fills Architure in:

- **[Tech stack](/docs/tech-stack): choose.** The organization's preferred technologies, with their versions, official docs and notes, in fixed categories. Agents read it before they choose a library.
- **[Repositories](/docs/repositories): structure.** Your GitHub repositories, imported through the GitHub App. Architure detects their packages from the workspace globs; the other resources link to packages.
- **[Databases](/docs/databases): model.** Each database designed on a canvas: import from SQL, information types, column definitions, issues, the text view and export, plus database connections and the schema sync that pulls a live schema into the design.
- **[Skills](/docs/skills): equip.** The skills your agents follow, added from skills.sh or written by your team, and installed into a repository with one `npx skills add` command.
- **[Environment variables](/docs/environment-variables): configure.** One encrypted value per scope (all, production, preview, development), per package. Agents read the names, never the values.
- **[Deployments](/docs/deployments): ship.** Vercel projects matched to packages. **Sync** pushes each package's variables to its project after you review the changes.
- **[Connect your agent](/docs/connect-your-agent): build.** Claude Code, Claude.ai, Cursor, Codex or any MCP client reach the [MCP server](/docs/mcp-tools) with an API key or OAuth, and the [`architure` skill](/docs/skill) tells them how to use it.

- [Getting started](/docs/getting-started): From sign-up to an agent working in one of your packages.
- [Concepts](/docs/concepts): Organizations, roles, packages, links, scopes and revisions.
- [Connect your agent](/docs/connect-your-agent): API keys or OAuth, step by step for each agent.
- [MCP tools](/docs/mcp-tools): The 15 tools agents call, what they read and what they write.

## How it fits together

An **organization** is your workspace: it holds everything below, its members and one subscription. It imports **repositories** from GitHub, and each repository holds **packages**: `apps/web` or `packages/email` in a monorepo, or `.` for a repository with one app.

Databases, skills and environment variables are either **linked to the packages** that use them or **available to all packages**, which is the default. The tech stack and the column definitions are organization-wide. Each Vercel project is matched to the one package it deploys.

An agent says where it works: the repository (`owner/name`) and the folder inside it. Architure answers for the package that holds that folder: its skills, its environment variable names and its databases, next to the organization's tech stack.

Every change to a database, whether you drag a table, edit the text view or an agent calls a tool, is a list of operations applied at a known revision. The database keeps a history of who changed what, and when two writers change it at once, the second one receives the changes it missed and applies its own on top. See [Concepts](/docs/concepts).

## For agents

These pages are written for people and for agents. [`/llms.txt`](/llms.txt) lists every page, [`/llms-full.txt`](/llms-full.txt) holds them all in one file, and each page has a Markdown version at its address plus `.md`, for example [`/docs/concepts.md`](/docs/concepts.md). A request that prefers `text/markdown` in its `Accept` header receives the Markdown too.

---

# Getting started

> From nothing to an agent working in one of your packages, in eight steps.

Source: https://docs.architure.dev/docs/getting-started

This page takes you from nothing to an agent that reads your architecture for the package it works in. Each step is short; the page it links to has the details. You can stop after any step: what you filled in is already served to your agents.

## 1. Create your organization

Sign up at `https://app.architure.dev/sign-up`.

**Create your account** with your name, your work email and a password of at least 8 characters, or continue with GitHub or Google where the app offers them. **Check your email**: enter the 6-digit code we sent (valid for 5 minutes; you can ask for a new one after 30 seconds).

**Name your organization.** The organization is your workspace: it holds your repositories, databases, tech stack, skills, environment variables, deployments, members and API keys. Its **Address** (3 to 48 lowercase letters, digits and hyphens) starts every link to its pages.

**Start the 14-day free trial** on one Stripe Checkout screen. No card is needed. **Skip for now** opens the organization read-only until an owner or admin starts the plan. See [Billing and trial](/docs/billing).

The organization opens on its **Overview**: the steps below with what each holds and the next one to do, then every package of your repositories with what it uses. The sidebar lists the same steps in the same order, under **Architecture** and **Delivery**.

> **Or try the canvas first**
>
> Open `https://app.architure.dev/new` without an account, paste a schema and design it. The draft stays in your browser. **Save** asks you to create the account and the organization, then the draft becomes a database of the organization. See [Import](/docs/import) and [Canvas](/docs/canvas).

## 2. List your tech stack

Open **Tech stack** and choose **Add technology**. Type a name: picking a well-known technology from the suggestions fills in its category and its doc links. Add the version you use and notes for your agents. Agents read this list before they choose a library. See [Tech stack](/docs/tech-stack).

## 3. Import your repositories

Open **Repositories** and choose **Connect GitHub**. GitHub installs the Architure app on your account or organization, and you choose there which repositories it may read. Back in Architure, **Import repositories** lists them: tick the ones to import.

Architure detects each repository's packages from its workspace globs (`pnpm-workspace.yaml`, `workspaces` in `package.json`, `lerna.json`). A repository without them is one package, `.`. A repository's page lists its packages and what each one uses. See [Repositories](/docs/repositories).

## 4. Add a database

Open **Databases** and create one with **New database** (a name and PostgreSQL or MySQL), then import your schema from the canvas or design it from scratch. See [Databases](/docs/databases), [Import](/docs/import) and [Canvas](/docs/canvas).

A new database is available to all packages. To say which packages use it, choose **Packages…** in the database's menu, or the **Packages** pill on its canvas, and turn off **Available to all packages**. To keep the design in step with a live database, add a connection under **Connections** on the canvas and choose **Sync…**. See [Database connections](/docs/database-connections) and [Schema sync](/docs/schema-sync).

## 5. Pick your skills

Open **Skills** and choose **Add from skills.sh**. Add the skills your agents should follow to the basket, then **Install all**. Your own skills start from **New skill**. **Packages…** in a skill's menu sets which packages use it. See [Skills](/docs/skills).

To install the skills into a repository, an owner or admin opens the repository's page and chooses **Create install link** under **Skills install link**. The command is shown once:

```bash
npx skills add https://app.architure.dev/k/<token>
```

Run it at the repository's root. It installs the skills that the repository's packages use. See [the install link](/docs/skills#install-link).

## 6. Store your environment variables

Open **Environment variables** and choose **New variable**: a name, a description, and a value for **All** or for production, preview and development. Values are encrypted, and agents only ever read the names. Link a variable to the packages that read it, or leave it available to all packages. See [Environment variables](/docs/environment-variables).

## 7. Connect Vercel

An owner or admin opens **Deployments** and chooses **Connect Vercel**, then **Import projects**. Architure matches each Vercel project to the package it deploys, by its GitHub repository and root directory, and offers to import the variables a project already has.

**Sync** compares what each package reads with its Vercel project, target by target. Review the changes, choose **Review and sync**, and confirm: nothing is written to Vercel before that. See [Deployments](/docs/deployments).

## 8. Connect your agent

An owner or admin creates an API key on **Agents** (**Read** or **Read and write**, shown once), or you sign in with OAuth from the agent. Add the MCP server at this address:

```text
https://app.architure.dev/api/mcp
```

Then install the [`architure` skill](/docs/skill), so the agent knows when and how to call the tools. [Connect your agent](/docs/connect-your-agent) walks through Claude Code, Claude.ai, Cursor and Codex.

In its first session, the agent reads the repository's remote (`owner/name`) and the folder it works in, and passes them to the tools: it gets that package's skills, environment variable names and databases, and the organization's tech stack. When it changes a database, the open canvas shows the change within seconds. See [MCP tools](/docs/mcp-tools).

## Invite your team

Owners and admins invite teammates by email from **Settings**, **Members**, as admin, member or viewer; only an owner invites another owner. What each role reads and writes is in [Concepts](/docs/concepts).

---

# Concepts

> Organizations, roles, repositories and packages, how databases, skills and environment variables link to packages, scopes and precedence, lifecycle, revisions and read-only mode.

Source: https://docs.architure.dev/docs/concepts

The ideas that every other page relies on. Each section is short; the resource pages have the details.

## Organization

An organization is a workspace, not a company. It holds the repositories and their packages, the databases, the column definitions, the tech stack, the skills, the environment variables, the deployments, the members, the API keys and one subscription. One organization may hold the work of several companies or ventures; companies are not modelled.

Its **Address** (the slug, 3 to 48 lowercase letters, digits and hyphens) starts every link to its pages, and nothing is shared between organizations. A person may belong to several and switch between them in the sidebar. An API key or an OAuth connection belongs to one organization.

## Members and roles

Each member has one role. Owners and admins invite teammates by email and change roles in **Settings**, **Members**.

| What | Owner | Admin | Member | Viewer |
| --- | --- | --- | --- | --- |
| Databases and column definitions | Read and write | Read and write | Read and write | Read |
| Tech stack, skills and repositories (Connect GitHub, import, refresh, remove) | Read and write | Read and write | Read and write | Read |
| Environment variables (values included) and database connections | Read and write | Read and write | Read and write | None |
| Deployments | Everything | Everything | Read and **Sync** | None |
| Skills install links | Create and revoke | Create and revoke | None | None |
| API keys | Create and revoke | Create and revoke | None | None |
| Billing | Manage | Manage | See the status | See the status |
| Members | Manage, including owners | Manage, except owners | None | None |

"Everything" on deployments means connecting a Vercel team, importing projects and their variables, setting a project's package by hand, removing a project and syncing. A viewer has no **Environment variables** and no **Deployments** in the sidebar. Only an owner can delete the organization.

Agents act with less than people:

- An API key is **Read** or **Read and write**. Read covers the databases, the column definitions, the tech stack, the skills, the repositories and their packages, and the environment variable names. Read and write also writes the databases: tables, columns, relationships, indexes, areas and descriptions.
- An OAuth connection acts within your role: a viewer's agent reads but never writes.
- No agent creates, archives or deletes a database or a column definition, writes the tech stack, the skills or the environment variables, or reads a value. See [MCP tools](/docs/mcp-tools).

## Repositories and packages

A **repository** is a GitHub repository imported through the GitHub App (**Connect GitHub**, then **Import repositories**). A **package** is a folder of a repository that runs with its own environment, such as `apps/web` or `packages/email`, named by its `package.json`.

Architure detects packages from the workspace globs: `pnpm-workspace.yaml`, `workspaces` in `package.json` and `lerna.json`. A repository without them, or whose globs match nothing, is one package at its root, `.`. **Refresh** on a repository's page reads them again; packages that stay keep their links. See [Repositories](/docs/repositories).

An agent names a package by its repository and a folder: `owner/name` (from `git remote get-url origin`, case does not matter) and the path from the repository's root. The folder may be inside a package: Architure answers for the deepest package that holds it, and for the root package when no other does; a folder that no package holds is refused.

## Linked or available to all packages

Databases, skills and environment variables are each either:

- **Available to all packages**: every package of every repository uses it. This is the default for a new one.
- **Linked** to chosen packages: only those packages use it. Turn off **Available to all packages** in **Packages…** and tick them.

Linked to no package and not available to all means used by no package: agents asking for a package do not get it, and the install link does not serve it. The tech stack and the column definitions are organization-wide: they are not linked to packages. A Vercel project is matched to one package, the one it deploys.

A repository's page shows what each package uses, and the **Package** filter of **Environment variables** shows what one package reads.

## Scopes and precedence

An environment variable holds one encrypted value per scope:

| Scope | Used for |
| --- | --- |
| `all` | Every environment that has no value of its own |
| `production` | Vercel's Production target |
| `preview` | Vercel's Preview target |
| `development` | Vercel's Development target |

Two rules decide what a package reads for one name:

1. **The package's own variable beats the shared one, scope by scope.** When a variable linked to the package and one available to all packages have the same name, each scope the linked one sets comes from it; the scopes it leaves empty come from the shared one. The **Package** filter marks the shared value **Overridden**.
2. **An environment's own value overrides `all`.** Production reads its `production` value, else its `all` value. A sync to Vercel writes `all` to each target that has no value of its own.

For example, `REDIS_URL` available to all packages sets `all`, and a `REDIS_URL` linked to `apps/worker` sets only `production`. In production, `apps/worker` reads its own value; in preview and development it reads the shared `all`. Every other package reads the shared value everywhere.

Two variables at the same level that set the same name and scope for a package are refused when you save. See [Environment variables](/docs/environment-variables).

## Lifecycle

What happens when you remove something depends on the resource:

| Resource | How it goes | Can it come back? |
| --- | --- | --- |
| Database | **Archive** hides it; **Move to trash**; **Delete forever** from the trash, with its history | From the archive or the trash, yes; after Delete forever, no |
| Skill | **Archive**, **Move to trash**, then **Delete forever** from the trash | From the archive or the trash, yes; agents and install links get live skills only |
| Column definition | **Archive** (linked columns keep reading it); **Delete** | Archived, yes; Delete is final and is refused while columns link to it |
| Tech stack item, environment variable, database connection | **Delete** | No: a hard delete, with the variable's values and links |
| Repository | **Remove**: its packages, their links and its install link go | Import it again; the links are gone |
| Vercel project | **Remove**: Architure forgets it; its variables in Vercel stay | Import it again |
| Install link | **Revoke**, or **New link**, which revokes the previous one | No: create a new link |
| API key | **Revoke** | No: create a new key |

## Revisions and operations

Every change to a database goes through one path. Dragging a table, editing the text view, a schema sync and an agent's tool call all send a list of **operations** (such as `table.create` or `column.update`) based on the database's **revision**, a counter that grows with each change.

When the revision sent is the current one, the operations apply together and the revision moves on. When someone changed the database in between, the write is refused with a **Conflict** that carries the changes it missed: the canvas applies them and replays its own edits on top, and an agent reads the database again and retries. Every applied change is kept with its author: a member, an agent named after its API key or OAuth client, or the system. The open canvas shows other writers' changes within seconds.

Other resources (the tech stack, skills, environment variables) are saved one by one, without revisions.

## Read-only after the trial

An organization writes while its subscription is trialing, active or past due. Otherwise, after a trial that ended without payment or a cancelled plan, it is read-only: every page and every MCP read tool keeps working, install links keep serving skills, and databases still export, but every write is refused, from the app and from agents (`PlanRequired`), until an owner or admin subscribes. Nothing is deleted. See [Billing and trial](/docs/billing).

---

# Tech stack

> The technologies and libraries your organization builds with, with their versions and official docs, read by your agents before they choose a library.

Source: https://docs.architure.dev/docs/tech-stack

The tech stack is your organization's list of preferred technologies: the language and the framework, the database and the ORM, the authentication library, the payment and email services, each with its version, its official documentation and notes on when and how to use it. Your agents read it through the MCP server before they choose a library, so every session starts from the same choices and the same docs instead of guessing from training data.

The stack belongs to the organization, not to a repository: it holds what the team prefers everywhere, and every agent of the organization reads the same list. It is the first step of describing your architecture; [repositories](/docs/repositories), [databases](/docs/databases), [skills](/docs/skills) and [environment variables](/docs/environment-variables) come next.

## What an item holds

| Field | Meaning |
| --- | --- |
| Name | For example `Next.js` or `Better Auth`: picked from the catalog of well-known technologies, or typed |
| Category | What the technology is for, for example **Framework**, **Database** or **Payments**: one of a fixed list (see Categories below) |
| Version | Optional, for example `16.2` |
| Doc links | Up to five links to the official documentation, each starting with `http://` or `https://` |
| Notes | Rich text: when to use it, how, and what to avoid. Agents read it as Markdown |

## Categories

Every item belongs to one category of a fixed list: an organization cannot add its own. The page and your agents see the categories in this order, from what you write code in down to how you check it: Language, Runtime, Framework, Monorepo, Styling, Component library, Icons, State, Validation, Dates, Database, ORM, Bucket, Authentication, Payments, Send emails, Build emails, Background jobs, AI, CMS, Docs, Hosting, Infrastructure, Monitoring, Analytics, Testing, Linting and Other. **Other** holds what fits nowhere else.

## The Tech stack page

**Tech stack**, in the organization's sidebar, shows one table grouped by category, in the order above. Each category has a header row with its name and how many items it holds; a category without items does not show. Each item shows:

- **Name**: its logo, its name and its version.
- **Docs**: its doc links, each opening in a new tab. A link reads **llms.txt**, **API** or **GitHub** when it points at one of those, and the site's host (`nextjs.org`) otherwise.
- **Notes**: the first line of its notes.

An empty stack reads "No technologies yet", with **Add technology**.

## Adding a technology

**Add technology**, at the top of the page, opens the dialog. Start with **Name**: the catalog suggests matching technologies as you type, by name or by another spelling (`Postgres` finds PostgreSQL), each with its logo and its category. Picking one fills in its **Category** and replaces the **Doc links** with the catalog's: its documentation, its `llms.txt` for agents when the project publishes one, its API reference and its source on GitHub, in that order. Everything stays editable.

A name typed exactly like a known technology (or one of its other spellings) is linked to it as well: the item gets its logo, and the category and links you entered stay as they are. Under the name, the dialog says which catalog technology the item is linked to ("Next.js from the catalog"). A name outside the catalog is saved as you type it ("Not in the catalog: it is saved as you typed it."), in the category you choose, with its initials in place of a logo.

Then choose the **Category**, add a **Version** if you want one, and the **Doc links** (**Add a link** adds a field, up to five; the cross beside a link removes it). The **Notes** are rich text, for people and agents: type `/` for blocks. **Add technology** saves the item at the end of its category. A name and a category are required.

Architure keeps a catalog of about 160 well-known technologies: languages, frameworks, hosting, databases, ORMs, authentication, payments, email, styling, testing, monitoring, AI and more, most of them with a logo, each with its official links.

## Editing, ordering and deleting

The menu at the end of each row offers:

- **Edit**: the same dialog, titled with the item's name. To move an item to another category, change its category here.
- **Move up** and **Move down**: inside its category only. The order is the one agents read.
- **Delete**: after a confirmation, the item leaves the tech stack for good and agents stop seeing it. The skills and environment variables linked to it stay, with no tech stack item.

## Skills and environment variables of a technology

A skill or an environment variable can name the tech stack item it belongs to, so an agent reading "Stripe" in the stack also learns its keys and the skill that explains it:

- An environment variable: **Tech stack item** in its dialog, on the [Environment variables](/docs/environment-variables) page.
- A skill: **Tech stack item…** in its menu, on the [Skills](/docs/skills) page or on the skill's own page.

Each variable or skill belongs to one item at most; choose **None** to unlink it.

## What agents see

The MCP tool `list_tech_stack` returns the categories that have items, in the order above, each with its name and its items in the team's order. Each item has its name, version, doc links, notes in Markdown, and the names of the environment variables and live skills linked to it (names only, never a value). Every API key and OAuth connection can read it; agents cannot change it. The [skill](/docs/skill) tells agents to call it before choosing a library, to prefer what it lists and to read the linked docs rather than rely on memory. See [MCP tools](/docs/mcp-tools) for every tool.

## Who can do what

Owners, admins and members add, edit, reorder and delete items. Viewers read the stack; the page then says "Your role can read the tech stack, not change it." Like every write, changing the stack needs an active trial or subscription (see [Billing and trial](/docs/billing)); after an unpaid trial the stack stays readable, and the page says "This organization is read-only until it has a plan."

---

# Repositories

> Import your GitHub repositories; Architure detects their packages, so databases, environment variables and skills link to the code that uses them, and agents get what their package uses.

Source: https://docs.architure.dev/docs/repositories

A repository is one of your GitHub repositories, imported through Architure's GitHub App. Architure detects its **packages**: the folders that run with their own environment, such as `apps/web` or `packages/email` in a monorepo, or the root of a repository with one app. Packages are the backbone of your architecture in Architure: you link [databases](/docs/databases), [environment variables](/docs/environment-variables) and [skills](/docs/skills) to the packages that use them, [Vercel projects](/docs/deployments) are matched to the package they deploy, and an agent that names the folder it works in gets what its package uses.

## Connecting GitHub

On **Repositories**, in the organization's sidebar, choose **Connect GitHub**. GitHub asks where to install the Architure app (your personal account or one of your GitHub organizations) and which repositories it may read: all of them, or the ones you pick. The app asks for read access to repository contents and metadata only; it never writes to GitHub. GitHub also asks you to authorize the app, so Architure can check that the installation is one you can access, then brings you back to Repositories with the import dialog open.

If the connection fails, the page shows "GitHub could not be connected" with GitHub's reason; try again.

**Connect GitHub** shows until a GitHub account is connected; from then on the page offers **Import repositories**. To let the app read more repositories, or to connect another GitHub account or organization, choose **Add repositories on GitHub** in the import dialog. Uninstalling the app on GitHub stops Architure from reading those repositories; the repositories you imported stay in Architure until you remove them.

## Importing repositories

**Import repositories** lists, for each connected GitHub account (marked Personal or Organization), the repositories the app may read, with a search. Private repositories are marked **Private**; repositories already imported are checked, locked and marked **Imported**. Pick some and choose **Import**: at most 50 at once (the button then reads "At most 50 at once"). Architure reads each repository again from GitHub, stores it and detects its packages.

An account with no repository yet says "The app can read no repository of this account yet: add some on GitHub."

## How packages are detected

Architure reads the repository's default branch:

- The workspace globs of `pnpm-workspace.yaml` (its `packages` list), of `package.json` (`workspaces`, as a list or as `{ packages }`) and of `lerna.json` (`packages`). `*` matches within a folder, `**` across folders, `?` one character, `{a,b}` either name, and a glob starting with `!` excludes.
- A package is a folder that holds a `package.json` and matches a glob (and no exclude), outside `node_modules`. Its name is the `name` of its `package.json` (`@repo/email`).
- A repository without workspace globs, or whose globs match no folder, is one package: its root, `.`.

When the detection may be incomplete, the repository shows a warning: GitHub listed only part of a very large repository, more than 200 packages matched (the first 200 are kept), no folder matched the globs, or the repository is empty. Architure keeps what it found.

Packages are detected again only when you ask: after adding or removing a package in the repository, choose **Refresh** on the repository's page.

## The Repositories page

Each imported repository shows its `owner/name` (and **Private** when it is), its packages, its default branch and when its packages were detected. Click a repository to open its page. With no repository yet, the page reads "No repositories yet".

## A repository's page

The page's title is the repository's `owner/name`, with **Private** or **Public**, the default branch and when the packages were detected. **Open on GitHub** opens the repository on GitHub.

**Packages** lists each package with its **Name** (its `package.json` name, or "No package.json name"; click it to open the package's page), its **Folder** (`(root)` for `.`) and **Uses**: the databases, environment variables and skills linked to that package, each a link. A database opens its canvas, a skill its page, and an environment variable the [Environment variables](/docs/environment-variables) page filtered to that package. A package with nothing linked to it reads "Only what all packages use".

Above the table, one line counts what is available to all packages, which every package uses as well: for example "Every package also uses 2 databases, 5 environment variables and 3 skills available to all packages." Viewers do not see environment variables on this page.

**Refresh** reads GitHub again: the repository's details, then its packages. New packages appear, packages that are gone are removed with their links, and the others keep their links. **Remove** (the bin icon) asks for a confirmation, then deletes the repository from Architure with its packages, their links and its install link. The repository on GitHub does not change, and you can import it again.

## A package's page

A package's page shows what an agent working in its folder gets from Architure: the same answers the MCP tools give when the agent names this repository and folder. **Open on GitHub** opens the folder on GitHub.

- **Tech stack**: the organization's stack, the same for every package.
- **Databases** and **Skills**: the ones linked to the package (**Linked**) or available to all packages (**All packages**), each opening its canvas or its page.
- **Environment variables**: the names the package resolves, with a cell per scope saying whether its value comes from a variable linked to the package or one available to all packages; **Open in Environment variables** shows the same list with its values hidden. Viewers do not see this section.
- **Deployments**: the Vercel projects matched to the package and when each was last synced. Viewers do not see this section.

The **Overview** lists every package of every repository with what it uses, and links to the same page.

## Linking packages

Databases, environment variables and skills are **available to all packages** until you choose packages for them:

- a database: **Packages…** in its card's menu on Databases, or **Packages** on its canvas;
- an environment variable: **Packages** in its dialog;
- a skill: **Packages…** in its menu.

Each opens the same picker. Turn off **Available to all packages** ("Every package of every repository uses it, including the ones imported later") and check the packages that use it, grouped by repository. A resource with the switch off and no package checked is used by no package. Lists show the links as badges: **All packages**, the packages' names, or **No package**.

For environment variables, a variable linked to a package wins over one available to all packages with the same name, scope by scope (see [Environment variables](/docs/environment-variables)).

## Skills install link

Owners and admins see the repository's **Skills install link**. **Create install link** makes one and shows its command once: `npx skills add` followed by the link. Run it in the repository to install the skills its packages use (the skills linked to one of its packages, and the ones available to all packages); run it again to update them. Anyone with the link can read those skills, so keep it in the repository's scripts or in a secret, not in a public file.

The card then shows the start of the link, when it was made and when it was last used. **New link** replaces it (the previous link stops working) and **Revoke** stops it; skills already installed stay. See [Skills](/docs/skills#install-link) for what the link serves.

## What agents see

`list_repositories` lists the imported repositories as `owner/name`, each with whether it is private, its default branch and its packages (`path` and `name`). `list_skills`, `list_environment_variables` and `list_databases` take two optional inputs:

- `repository`: the GitHub repository the agent works in, as `owner/name` (from `git remote get-url origin`; the case does not matter);
- `path`: the folder it works in, from the repository's root. Any folder inside a package answers for that package (`apps/web/src/lib` answers for `apps/web`); left out, the repository's root package.

They then answer for that package, and say which package it is. Without a repository, they answer for the whole organization. A repository that was not imported, or a folder that no package holds, is an error that says so. The [skill](/docs/skill) tells agents to find where they work first. See [MCP tools](/docs/mcp-tools) for every tool.

## Who can do what

Owners, admins and members connect GitHub, import, refresh and remove repositories, and link databases, variables and skills to packages. Viewers see the repositories and their packages; the page says "Your role can read the repositories, not import or change them." Only owners and admins create and revoke install links. Like every write, it needs an active trial or subscription (see [Billing and trial](/docs/billing)).

---

# Databases

> The databases of an organization: create, schemas, the packages that use them, archive, trash and delete forever.

Source: https://docs.architure.dev/docs/databases

Databases are one part of the architecture you describe in Architure, next to the [tech stack](/docs/tech-stack), the [repositories](/docs/repositories) and their packages, skills and environment variables. Each database belongs to the organization: it has a dialect (PostgreSQL or MySQL), holds one or more schemas with their tables and relationships, and is linked to the packages that use it or available to all packages. Agents read it through the MCP server and can write its schema. See [Concepts](/docs/concepts) for how the pieces fit together.

## The Databases page

**Databases**, in the organization's sidebar, shows the organization's databases as cards in three tabs, each with its count:

- **Databases**: the databases in use. A card opens the database's canvas.
- **Archived**: databases hidden from the list. They keep everything and do not open until you restore them.
- **Trash**: databases on their way out. They can be restored or deleted for good.

Each card shows the database's name, its dialect, the start of its description, the packages that use it, its number of schemas and when it last changed (on the other tabs, when it was archived or moved to the trash). The menu of a card holds the actions below.

Above the tabs, a row of tiles sums up the databases in use: how many there are, with the total of their schemas and how many are archived or in the trash; how many use PostgreSQL and how many MySQL, each with its share; and the last change, with the name of the database it touched.

Agents list only the databases of the **Databases** tab.

## Create a database

Choose **New database**, give it a **Name** (up to 200 characters) and pick its **Database**, PostgreSQL or MySQL, then **Create database**. The new database is empty and its canvas opens: draw the first table, or import a schema (see below).

The dialect decides the data types the canvas offers, the issues it checks and the SQL it exports. You can change it later in the database's details on the canvas.

## Schemas

A database holds one or more schemas, such as `public` and `audit` in PostgreSQL. A new database starts with one schema, `public`. Each card says how many schemas its database has.

On the canvas, the sidebar lists every schema with its tables, and **New schema** adds one. An import reuses a schema of the same name, and in MySQL the imported database becomes `public`. See [Canvas](/docs/canvas) for adding, hiding, renaming and deleting schemas.

## Packages

A database is either used by chosen packages of your repositories or **Available to all packages**, the default. An agent that names the package it works in (a repository and a folder) gets the databases that package uses.

Choose **Packages…** in a card's menu, or the **Packages** button in the canvas's top bar, to set it. The dialog's **Available to all packages** switch covers every package of every repository, including the ones imported later. Turn it off to tick packages, grouped by repository, then **Save**. Without any repository yet, the dialog links to the Repositories page to import one.

Each card shows the result as badges: **All packages**, the names of the linked packages, or **No package** when it is linked to none. A database linked to no package and not available to all packages is used by no package. The **Packages** button shows `all` or the number of linked packages.

## Rename, archive, trash and delete forever

The menu of a card in **Databases** offers:

- **Open**: the canvas.
- **Rename**: a new name, then **Save**. The name can also be changed in the database's details on the canvas.
- **Packages…**: see above.
- **Archive**: the database moves to **Archived**. Its schemas, tables, descriptions and history stay as they are.
- **Move to trash**: the database moves to **Trash**.

An archived database offers **Restore** (back to **Databases**) and **Move to trash**. A database in the trash offers **Restore** and **Delete forever**, which asks first: its schemas, tables, columns, descriptions and change history are deleted, and this cannot be undone.

## On the canvas

Each database opens on its [canvas](/docs/canvas). Next to **Import**, **Export** and **Connect an agent**, its top bar holds two buttons for the database itself:

- **Connections**, with its count: the database's connection URLs, one per scope, tested from Architure's servers. From there, **Sync…** pulls the live schemas into the design after a preview. See [Database connections](/docs/database-connections) and [Schema sync](/docs/schema-sync). Viewers do not see this button.
- **Packages**, with `all` or the number of linked packages: the same dialog as **Packages…** on the card.

## Bring an existing database in

There are two ways to start from a database you already have:

- **Without an account**, on `https://app.architure.dev/new`: paste your schema and the diagram opens in your browser as a draft. **Save** creates your account and organization, then the draft becomes a database of the organization.
- **Into a saved database**: **Import** in the canvas's top bar adds the imported schemas to it. Create an empty database first to import into a new one.

Both read the catalog query's result or a schema-only dump. See [Import](/docs/import). Once a database has a connection, the [schema sync](/docs/schema-sync) brings later live changes in without importing again.

## Who can change databases

Owners, admins and members create, rename, link, archive, restore, trash and delete databases forever, and edit them on the canvas. Viewers open and export them; the page tells them their role cannot change databases. API keys and OAuth tokens with write access edit databases through MCP, but never create, archive or delete one.

Every change needs an active trial or subscription. After a trial that ended without payment, the organization is read-only: **New database** and the card actions are disabled, and the page says so, while databases still open, search and export. See [Billing and trial](/docs/billing).

---

# Import

> Bring an existing PostgreSQL or MySQL database into Architure with the catalog query or a schema-only dump.

Source: https://docs.architure.dev/docs/import

Import is how an existing database enters your architecture: its schemas, tables, keys, indexes, enum types and comments become a [database](/docs/databases) of your organization, which your agents then read and write. There are two ways in. The **catalog query** is recommended: it asks the database itself, so types, defaults, comments and enum types arrive exactly as the database knows them. A **schema-only dump** works too, through a SQL parser.

You can import in two places:

- The start screen of `https://app.architure.dev/new`, which starts a new draft without an account. Paste into **Your schema** and choose **Open the diagram**: a catalog query result is recognized as JSON and read in your browser, anything else is read as a dump. **How to get your schema** shows the query and the dump commands.
- **Import** in the top bar of the canvas, in a database or a draft, which adds the imported objects to it. The **Import a schema** dialog asks for the **Database** (PostgreSQL or MySQL) and **What you paste**: **Catalog query result** or **Schema dump (DDL)**. With the catalog query result, the dialog shows the query with a **Copy** button.

An import adds to the design; it does not compare. To bring a database that already has a [connection](/docs/database-connections) back in line with its live schemas, use the [schema sync](/docs/schema-sync), which previews what changes and keeps your positions, areas, information types and descriptions.

A database holds one dialect. Importing a schema of the other dialect works only while the database is empty, and the database's dialect changes with it.

## Catalog query

The query is read-only. It reads only the system catalogs (names, types, keys, indexes, comments), never your rows, and returns one row with one JSON value named `architure_catalog`. Nothing is sent anywhere until you paste the result into Architure.

### PostgreSQL

For PostgreSQL 12 or later. It reads `pg_catalog` only: schemas, enum types with their values in order, tables and partitioned tables, columns with their types, defaults, nullability and identity, primary keys, unique constraints, foreign keys with their actions, indexes, and comments.

It leaves out the system schemas (`pg_catalog`, `information_schema`, `pg_toast` and temporary schemas), the schemas and tables that extensions create, and the schemas Supabase manages (`auth`, `storage`, `realtime` and the others listed at the top of the query). To import one of those, delete its line from the list before running the query.

```sql
-- Architure catalog query for PostgreSQL 12 or later.
-- Read-only: it reads the system catalogs and returns one JSON value (architure_catalog).
-- Copy that value into Architure's import dialog.
with excluded_schemas (name) as (
  values ('pg_catalog'), ('information_schema'), ('pg_toast'),
    -- Supabase's managed schemas: delete a line to import that schema too.
    ('auth'), ('storage'), ('realtime'), ('_realtime'), ('supabase_functions'),
    ('supabase_migrations'), ('extensions'), ('graphql'), ('graphql_public'), ('pgbouncer'),
    ('pgsodium'), ('pgsodium_masks'), ('vault'), ('net'), ('cron'), ('_analytics')
),
schemas as (
  select n.oid, n.nspname
  from pg_catalog.pg_namespace n
  where n.nspname not in (select name from excluded_schemas)
    and n.nspname not like 'pg\_temp\_%'
    and n.nspname not like 'pg\_toast\_temp\_%'
    -- Schemas created by an extension.
    and not exists (
      select 1 from pg_catalog.pg_depend d
      where d.classid = 'pg_catalog.pg_namespace'::regclass and d.objid = n.oid and d.deptype = 'e'
    )
),
tables as (
  select c.oid, c.relname, s.nspname
  from pg_catalog.pg_class c
  join schemas s on s.oid = c.relnamespace
  where c.relkind in ('r', 'p')
    -- Tables created by an extension.
    and not exists (
      select 1 from pg_catalog.pg_depend d
      where d.classid = 'pg_catalog.pg_class'::regclass and d.objid = c.oid and d.deptype = 'e'
    )
)
select json_build_object(
  'format', 'architure-catalog',
  'version', 1,
  'dialect', 'postgresql',
  'server_version', current_setting('server_version_num'),
  'database', current_database(),
  'schemas', coalesce((
    select json_agg(json_build_object(
      'name', s.nspname,
      'comment', pg_catalog.obj_description(s.oid, 'pg_namespace')
    ) order by s.nspname)
    from schemas s
  ), '[]'::json),
  'enums', coalesce((
    select json_agg(json_build_object(
      'schema', s.nspname,
      'name', t.typname,
      'values', (
        select json_agg(e.enumlabel order by e.enumsortorder)
        from pg_catalog.pg_enum e where e.enumtypid = t.oid
      ),
      'comment', pg_catalog.obj_description(t.oid, 'pg_type')
    ) order by s.nspname, t.typname)
    from pg_catalog.pg_type t
    join schemas s on s.oid = t.typnamespace
    where t.typtype = 'e'
  ), '[]'::json),
  'tables', coalesce((
    select json_agg(json_build_object(
      'schema', t.nspname,
      'name', t.relname,
      'comment', pg_catalog.obj_description(t.oid, 'pg_class'),
      'columns', coalesce((
        select json_agg(json_build_object(
          'name', a.attname,
          'position', a.attnum,
          'type', pg_catalog.format_type(a.atttypid, a.atttypmod),
          'type_schema', tn.nspname,
          'type_name', ty.typname,
          'type_kind', ty.typtype,
          'nullable', not a.attnotnull,
          'default', pg_catalog.pg_get_expr(ad.adbin, ad.adrelid),
          'identity', a.attidentity,
          'generated', a.attgenerated,
          'comment', pg_catalog.col_description(t.oid, a.attnum)
        ) order by a.attnum)
        from pg_catalog.pg_attribute a
        join pg_catalog.pg_type ty on ty.oid = a.atttypid
        join pg_catalog.pg_namespace tn on tn.oid = ty.typnamespace
        left join pg_catalog.pg_attrdef ad on ad.adrelid = a.attrelid and ad.adnum = a.attnum
        where a.attrelid = t.oid and a.attnum > 0 and not a.attisdropped
      ), '[]'::json),
      'constraints', coalesce((
        select json_agg(json_build_object(
          'name', con.conname,
          'type', con.contype,
          'columns', (
            select json_agg(a.attname order by k.ord)
            from unnest(con.conkey) with ordinality as k (attnum, ord)
            join pg_catalog.pg_attribute a on a.attrelid = con.conrelid and a.attnum = k.attnum
          ),
          'ref_schema', rn.nspname,
          'ref_table', rc.relname,
          'ref_columns', (
            select json_agg(a.attname order by k.ord)
            from unnest(con.confkey) with ordinality as k (attnum, ord)
            join pg_catalog.pg_attribute a on a.attrelid = con.confrelid and a.attnum = k.attnum
          ),
          'on_delete', con.confdeltype,
          'on_update', con.confupdtype
        ) order by con.conname)
        from pg_catalog.pg_constraint con
        left join pg_catalog.pg_class rc on rc.oid = con.confrelid
        left join pg_catalog.pg_namespace rn on rn.oid = rc.relnamespace
        -- Primary keys, unique constraints and foreign keys, not the copies on partitions.
        where con.conrelid = t.oid and con.contype in ('p', 'u', 'f') and con.conparentid = 0
      ), '[]'::json),
      'indexes', coalesce((
        select json_agg(json_build_object(
          'name', ic.relname,
          'unique', i.indisunique,
          -- null for an expression
          'columns', (
            select json_agg(a.attname order by k.ord)
            from unnest(i.indkey::int2[]) with ordinality as k (attnum, ord)
            left join pg_catalog.pg_attribute a on a.attrelid = i.indrelid and a.attnum = k.attnum
            where k.ord <= i.indnkeyatts
          ),
          'partial', i.indpred is not null
        ) order by ic.relname)
        from pg_catalog.pg_index i
        join pg_catalog.pg_class ic on ic.oid = i.indexrelid
        where i.indrelid = t.oid
          -- Not the indexes behind a primary key, unique or exclusion constraint.
          and not exists (
            select 1 from pg_catalog.pg_constraint con
            where con.conindid = i.indexrelid and con.contype in ('p', 'u', 'x')
          )
          -- Not the copies of a partitioned table's index.
          and not exists (
            select 1 from pg_catalog.pg_inherits inh where inh.inhrelid = i.indexrelid
          )
      ), '[]'::json)
    ) order by t.nspname, t.relname)
    from tables t
  ), '[]'::json)
) as architure_catalog;
```

Save the query as `architure-catalog.sql` and run it with `psql`. `--no-align --tuples-only` prints the JSON value alone, without a header or line markers:

```bash
psql "postgresql://user@host:5432/database" --no-psqlrc --no-align --tuples-only \
  --file architure-catalog.sql > catalog.json
```

In a SQL client (pgAdmin, DBeaver, TablePlus, DataGrip, the Supabase SQL editor), run the query and copy the single value of the result. Architure also reads the value when the client copies it with its column name or as a one-row JSON array. It does not read `psql`'s default aligned output, which adds a `+` at the end of every line of the value: use the options above.

### MySQL

For MySQL 8.0 or later. It reads `information_schema` for the current database only: its tables (not views), their columns with the full column type, default, nullability, extra attributes (`auto_increment`, `on update CURRENT_TIMESTAMP`) and comment, their indexes including the primary key, their foreign keys with their actions, and table comments. The database becomes the database's `public` schema.

```sql
-- Architure catalog query for MySQL 8.0 or later.
-- Read-only: it reads information_schema for the current database (run USE your_database first)
-- and returns one JSON value (architure_catalog). Copy that value into Architure's import dialog.
select json_object(
  'format', 'architure-catalog',
  'version', 1,
  'dialect', 'mysql',
  'server_version', version(),
  'database', database(),
  'tables', coalesce((
    select json_arrayagg(json_object(
      'name', t.table_name,
      'comment', t.table_comment,
      'columns', (
        select json_arrayagg(json_object(
          'name', c.column_name,
          'position', c.ordinal_position,
          'type', c.column_type,
          'data_type', c.data_type,
          'nullable', c.is_nullable,
          'default', c.column_default,
          'extra', c.extra,
          'comment', c.column_comment
        ))
        from information_schema.columns c
        where c.table_schema = t.table_schema and c.table_name = t.table_name
      ),
      'indexes', (
        select json_arrayagg(json_object(
          'name', s.index_name,
          'non_unique', s.non_unique,
          'position', s.seq_in_index,
          -- null for a functional key part
          'column', s.column_name,
          'type', s.index_type
        ))
        from information_schema.statistics s
        where s.table_schema = t.table_schema and s.table_name = t.table_name
      ),
      'foreign_keys', (
        select json_arrayagg(json_object(
          'name', k.constraint_name,
          'position', k.ordinal_position,
          'column', k.column_name,
          'ref_schema', k.referenced_table_schema,
          'ref_table', k.referenced_table_name,
          'ref_column', k.referenced_column_name,
          'on_delete', r.delete_rule,
          'on_update', r.update_rule
        ))
        from information_schema.key_column_usage k
        join information_schema.referential_constraints r
          on r.constraint_schema = k.constraint_schema
          and r.constraint_name = k.constraint_name
          and r.table_name = k.table_name
        where k.table_schema = t.table_schema and k.table_name = t.table_name
          and k.referenced_table_name is not null
      )
    ))
    from information_schema.tables t
    where t.table_schema = database() and t.table_type = 'BASE TABLE'
  ), json_array())
) as architure_catalog;
```

Run it against the database you want to import (MySQL calls a schema a database). `--batch --raw --skip-column-names` print the JSON value alone, without escaping:

```bash
mysql --host=host --user=user --password --batch --raw --skip-column-names \
  database < architure-catalog.sql > catalog.json
```

In a SQL client (MySQL Workbench, DBeaver, TablePlus, DataGrip), select the database first (`USE database;`), run the query and copy the single value of the result.

### Paste the result

On the start screen of `https://app.architure.dev/new`, paste the JSON (the content of `catalog.json`) into **Your schema**. On the canvas, choose **Import**, then **Catalog query result**, and paste it under **2. Paste the JSON it returned**. The diagram appears.

## Schema-only dump

Paste the SQL that creates your schema. The usual way to get it:

```bash title="PostgreSQL"
pg_dump --schema-only --no-owner --no-privileges \
  "postgresql://user@host:5432/database" > schema.sql
```

```bash title="MySQL"
mysqldump --no-data --skip-comments --host=host --user=user --password database > schema.sql
```

Any file of `CREATE` statements works, such as your migrations squashed into one file. A dump is read on Architure's server, up to 1 MB at a time.

What the PostgreSQL import reads:

- `CREATE SCHEMA`, and `CREATE TABLE` with columns, defaults, `NOT NULL`, `PRIMARY KEY`, `UNIQUE` and `REFERENCES`;
- `ALTER TABLE ... ADD CONSTRAINT`, including the `ALTER TABLE ONLY` statements `pg_dump` writes;
- `CREATE INDEX` and `CREATE UNIQUE INDEX`;
- `CREATE TYPE ... AS ENUM`;
- identity columns, `serial` types and `nextval(...)` defaults, read as auto-increment;
- `COMMENT ON SCHEMA`, `COMMENT ON TABLE` and `COMMENT ON COLUMN`, read as descriptions.

What the MySQL import reads: `CREATE TABLE` with columns (`UNSIGNED` included), defaults with their `ON UPDATE`, keys, indexes, foreign keys, `AUTO_INCREMENT`, inline `ENUM(...)` types and `COMMENT` clauses, then `ALTER TABLE` and `CREATE INDEX`. It reads `mysqldump`'s output as the `mysql` client would: `DELIMITER` blocks, comments and `/*!... */` version comments. `USE` and `CREATE DATABASE` are ignored, so the tables of a one-database dump land in `public`.

Statements the model cannot hold are skipped, and the import tells you how many: views and materialized views, functions, procedures and triggers, domains, extensions, policies and grants, check and exclusion constraints, the expressions of generated columns, the condition of a partial index (the index is kept), indexes on expressions, `PARTITION OF` tables, and data statements. `FULLTEXT` and `SPATIAL` indexes become plain indexes. Session settings, owners, sequences, `DROP` statements and transactions are skipped silently.

When the text does not parse: a PostgreSQL dump stops the import at the first syntax error, with its line and column. A MySQL dump skips each statement it cannot read with a warning, and stops only when no table could be read.

## What an import creates

- **Tables** are placed on a grid. Run **Auto-layout** to arrange them. An import creates no areas.
- **Schemas.** A database starts with one schema, `public`. Tables without a schema land in it, and an imported schema whose name already exists in the database is reused. In MySQL, the imported database becomes the `public` schema.
- **Data types** are stored in their canonical, lowercase form: `character varying(45)`, `timestamp with time zone`, `numeric(10,2)`, `smallint unsigned`.
- **Keys.** Composite primary keys and composite foreign keys keep all their columns. Each foreign key becomes a column relationship with its constraint name and its `ON DELETE` and `ON UPDATE` actions: one-to-one when its columns are a key of their table, many-to-one otherwise. A foreign key or an index without a name gets the name the database would give it.
- **Enum types become [column definitions](/docs/column-definitions).** A PostgreSQL enum type becomes a definition of the same name. A MySQL inline `ENUM(...)` becomes a definition named after the first column that uses it (`<table>_<column>`), shared by every column with the same values. A definition of your organization with the same name and values (in MySQL, the same values) is linked instead; a name your organization already uses for other values gets a `_2` suffix and a warning. The columns of that type are linked to the definition. Only the enum types some column uses are imported.
- **New definitions** are created in your organization when you import into a database. In a draft, they stay in the draft and are created in your organization when you save.
- **Descriptions** come from the database's comments.
- **History.** The import is one change in the database's history, with new ids for every object. It is not part of the undo history: to take it back, delete the tables it created.

## Limits and privacy

- The canvas's **Import** dialog sends what you paste to Architure's server: up to 1 MB per import, and 20 imports per hour from one network address. Past the limit, the dialog says when to try again.
- The start screen of `https://app.architure.dev/new` reads a catalog query result in your browser, whatever its size, and sends only a dump to the server (the same 1 MB and 20 per hour).
- Architure does not keep the text you paste: it keeps the diagram built from it. In a draft, that diagram stays in your browser until you save.

---

# Canvas

> Schemas, tables, columns, relationships, areas, the three views, undo and redo, auto-layout, search, issues, export and keyboard shortcuts.

Source: https://docs.architure.dev/docs/canvas

The canvas is where you design one [database](/docs/databases) of your architecture: its schemas, tables, columns, relationships and descriptions, the part your agents read when they work with its data. The same canvas runs on a draft at `https://app.architure.dev/new` and on a saved database of your organization, at **Databases**, then the database. On a saved database, the organization's sidebar starts collapsed to icons to leave the room to the diagram.

## Layout

- **Top bar**: the back arrow to all databases, the database's name and whether your changes are saved; the view (**Simple**, **Raw** or **Text**); **Collapse all tables**, **Auto-layout**, **Undo** and **Redo**; **Import**, **Export** and **Connect an agent**. On a saved database, **Connections** (the database's [connections](/docs/database-connections) and the [schema sync](/docs/schema-sync); not for viewers) and **Packages** (the packages that use the database, see [Databases](/docs/databases)) close the bar, each with its count. In a draft, **Start over** and **Save** close it instead.
- **Left sidebar**: two tabs. **Tables** lists the database's schemas, each with its table count, a button that hides or shows it on the diagram, and its tables, then **New schema**, with the search box; **Issues** lists what to fix, with their count.
- **Diagram**: a toolbar at the bottom centre holds **Table** and **Area**, then **Zoom out**, the zoom level, **Zoom in** and **Fit view**. An empty database shows "This database is empty" with **Import** and **Add a table**. Drag the background to pan, scroll or pinch to zoom. <kbd>Shift</kbd> and drag selects several objects; <kbd>Cmd</kbd> or <kbd>Ctrl</kbd> and click adds an object to the selection.
- **Details panel** on the right: what you selected (a table, a column, a relationship, an area or a schema), with its description. With nothing selected, it shows the database: its numbers of tables and relationships, its **Schemas** with their table counts (**Schema** adds one), its **Name**, its **Dialect** and its **Description**, then the colours of the information types.

## Schemas

A database holds one or more schemas, such as `public` and `audit` in PostgreSQL. A new database starts with `public`. The sidebar always lists them, each with its table count, and a table's name shows its schema (`audit.events`) when the database has more than one.

- **Add one** with **New schema** in the sidebar, or **Schema** in the database's details. It is called `new_schema`: rename it in its details.
- **Put tables in it.** Select the schema, then press <kbd>T</kbd>: the new table goes into it. Otherwise a new table goes into the schema of the selected table, else into the first schema shown. Move a table with the **Schema** field of its details.
- **Hide it** with the eye button beside its name, in the sidebar or its details: its tables and the relationships that touch them leave the diagram until you show it again. Your browser remembers it for this database; your teammates keep their own view.
- **Delete it** from its details. Its tables are deleted with it, after you confirm; undo brings them back. A database keeps at least one schema: rename the last one rather than delete it.

## Tables and columns

Press <kbd>T</kbd> or choose **Table** to add a table in the middle of the view. Drag a table by its header; double-click the header to rename it. The arrow at the left of the header collapses the table to its header.

The table's details hold its name, its schema, its description, its columns and its indexes. Add a column with **Column**, reorder columns with their up and down arrows, and select one to edit it. A column has:

- a **name** and a **type**. The type picker shows your organization's [column definitions](/docs/column-definitions) first, then the data types of the database's dialect; type any other type and choose **Use** to keep it as written;
- **Nullable**, **Primary key**, **Unique** and **Auto-increment**. A composite primary key is several columns marked as primary key, in column order;
- a **Default value**, written as SQL (`0`, `'draft'`, `now()`);
- an **Information type** ([information types](/docs/information-types)), the colour band at the left of the column;
- a **Description**.

A column linked to a column definition shows a chain icon and takes its type, values, information type and description from the definition. **Unlink and keep the type** gives the column back its own type.

The table's indexes are listed in its details. Add or change them in the [text view](/docs/text-format#indexes), or let an agent do it.

## Relationships

- **Between columns.** Drag from the handle at the edge of one column to another column. This is a foreign key: the column that is not a primary key references the one that is, whichever way you drag. Its details hold its **Cardinality**, **On delete** and **On update** (no action, restrict, cascade, set null, set default) and its **Constraint name** (left empty, the database names the constraint when you run the exported SQL).
- **Between tables.** Drag from one table's header to another's. The dashed line says "these tables are related" before you know which columns join them, so you can design fast. To detail it, select it, choose the **Referencing column** and the **Referenced column**, then **Detail into columns**. Until then the issues panel lists it.

Cardinalities are one to one, many to one, and many to many. Many to many exists only between tables: detail it with a link table that holds a foreign key to each side. A composite foreign key is several column relationships that share one constraint name, written in the [text view](/docs/text-format#references) or imported.

## Areas

Press <kbd>A</kbd> or choose **Area** to add an area: a titled, coloured rectangle that groups tables, such as "Billing" or "Catalogue". Drag it by its title and resize it by its edges. A table you drop joins the area its centre lands in (the smallest one, where areas overlap), and dragging an area moves its tables with it. Its details hold its title and colour; deleting an area keeps its tables.

Area colours: slate, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink and rose.

## Views

| View | Key | Shows |
| --- | --- | --- |
| Simple | <kbd>1</kbd> | Column names and a `NULL` or `NOT NULL` mark |
| Raw | <kbd>2</kbd> | Column names and data types, with `PK` (primary key), `FK` (foreign key) and `UQ` (unique) badges |
| Text | <kbd>3</kbd> | The whole database in the [text format](/docs/text-format), in a code editor |

In both diagram views, each column shows its information type's colour band, and a primary key column is in bold. When you zoom far out, the columns turn into bars without text.

In the text view, edit the text, then choose **Apply** or press <kbd>Cmd</kbd> + <kbd>S</kbd> (<kbd>Ctrl</kbd> + <kbd>S</kbd> on Windows and Linux). **Discard** drops your edit. Errors are marked at their line and nothing changes until the text applies. Renaming in the text view deletes the object and creates a new one, which loses a table's position and description: rename on the canvas to keep them.

**Collapse all tables** shows every table as its header only, with relationships drawn between the headers; **Expand all tables** brings the columns back.

## Descriptions

Select a schema, a table, a column or a relationship, or nothing for the database, to write its description in the details panel. The editor keeps to what Markdown can carry: headings (two levels), bold, italic, inline code, links, bulleted and numbered lists, and code blocks. Type <kbd>/</kbd> for the block menu, select text for the formatting menu, or type Markdown shortcuts such as `## ` or `- `. A column linked to a column definition shows the definition's description: edit it on the definition.

Agents read descriptions as Markdown and can write them too.

## Search and issues

Press <kbd>/</kbd> to search tables and columns by name in the **Tables** tab; <kbd>Esc</kbd> clears the search. The **Issues** tab lists errors, warnings and information about the database as you edit, the same list an agent gets from `check_database`. Choose an issue to select its object and centre the view on it. Every rule is in the [issues reference](/docs/issues).

## Auto-layout

**Auto-layout** arranges the tables from left to right along their relationships, keeps the tables of an area together, and respects each table's column order. It runs in the background on large schemas, and you can undo it like any other change.

## Undo and redo

Undo and redo cover the changes you make in this tab, up to 100 steps: edits, moves, auto-layout, the text view. An [import](/docs/import) is not in the undo history. Changes made by teammates or agents are not in your undo history either, and an undo step that would touch an object someone else deleted is dropped with a notice.

## Copy, paste and duplicate

<kbd>Cmd</kbd> + <kbd>C</kbd> copies the selected tables with their columns, their indexes and the relationships between them; <kbd>Cmd</kbd> + <kbd>V</kbd> pastes them in this tab, next to the originals, named `<table>_copy`. <kbd>Cmd</kbd> + <kbd>D</kbd> duplicates the selected tables in one step. Pasted tables keep their schema, or go into the schema you selected before pasting, and join no area.

## Export

**Export** opens three tabs:

- **PostgreSQL DDL** or **MySQL DDL**: the `CREATE` statements for the database's dialect. Column definitions with values become `CREATE TYPE ... AS ENUM` in PostgreSQL and inline `ENUM(...)` types in MySQL.
- **DBML**: for dbdiagram.io and other DBML tools, with descriptions as notes. Information types, column definition links, area colours and relationships between tables are left out.
- **Image**: **Download PNG** or **Download SVG** of the whole diagram in the current view, with its areas. Switch to the simple or raw view first.

**Copy** copies the DDL or the DBML; **Download .sql** or **Download .dbml** saves it as a file. Exporting works on read-only databases too.

## Keyboard shortcuts

On macOS use <kbd>Cmd</kbd>; on Windows and Linux use <kbd>Ctrl</kbd>. Shortcuts do not fire while you type in a field, the description editor or the text view.

| Shortcut | Action |
| --- | --- |
| <kbd>Cmd</kbd> + <kbd>Z</kbd> | Undo |
| <kbd>Shift</kbd> + <kbd>Cmd</kbd> + <kbd>Z</kbd>, or <kbd>Cmd</kbd> + <kbd>Y</kbd> | Redo |
| <kbd>Cmd</kbd> + <kbd>C</kbd> | Copy the selected tables |
| <kbd>Cmd</kbd> + <kbd>V</kbd> | Paste the copied tables |
| <kbd>Cmd</kbd> + <kbd>D</kbd> | Duplicate the selected tables |
| <kbd>Delete</kbd> or <kbd>Backspace</kbd> | Delete the selection |
| <kbd>T</kbd> | Add a table |
| <kbd>A</kbd> | Add an area |
| <kbd>/</kbd> | Search tables and columns |
| <kbd>1</kbd>, <kbd>2</kbd>, <kbd>3</kbd> | Simple, raw and text view |
| <kbd>Cmd</kbd> + <kbd>S</kbd> | Apply the text view |

## Saving, teammates and agents

A saved database is written as you edit; there is no save button. The top bar says **Saved**, **Unsaved changes**, **Saving…**, **Offline, retrying** while the connection is down, or **Not saved** when a change could not be saved (a notice says why). A draft says **Saved in this browser**.

The canvas picks up changes from teammates and agents every 3 seconds while the tab is visible, and at once when you come back to it: an agent's new table appears without a reload.

When someone else changed the database at the same moment as you, their changes are applied first and yours on top. A change of yours that no longer fits (for example, an edit to a table they deleted) is dropped, and a notice tells you.

## Connect an agent

**Connect an agent** shows the MCP server's address, a link to create an API key, and a link to [Connect your agent](/docs/connect-your-agent). In a draft, it asks you to save the database first.

## Read-only databases

A database opens read-only when you are a viewer of the organization (the top bar says **Read-only**), or when the organization has no active plan, for example after a trial that ended without payment (**Read-only: plan required**, with a **Subscribe** link; see [Billing and trial](/docs/billing)). You can still browse, search, read descriptions, check issues and export.

## What your browser remembers

The canvas position and zoom, the collapsed tables, the hidden schemas and the view are saved per database in this browser. They are not part of the database: your teammates keep their own.

---

# Information types

> Seven types that say what every column holds, shown as colours on the canvas and read by your agents.

Source: https://docs.architure.dev/docs/information-types

Every column of a [database](/docs/databases) belongs to one of seven information types. The type answers a simple question, "what does this column hold?", so that people see the structure of a table at a glance and agents name, fill and query columns consistently.

| Colour  | Information type                      | What it holds                                                                  | Typical columns                                        |
| ------- | ------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------ |
| Blue    | Identification `identification`       | Keys and codes that identify a row: ids, numbers, slugs, external references.  | `id`, `order_number`, `slug`, `stripe_customer_id`     |
| Emerald | Status `status`                       | Where a row stands in its lifecycle: states, active flags, versions.           | `status`, `is_active`, `version`, `returned_at`        |
| Violet  | Categorization `categorization`       | Types, kinds and tags that sort rows into groups.                              | `type`, `kind`, `genre`, `tags`                        |
| Amber   | Descriptive information `descriptive` | Names, text and values that describe the row to people.                        | `name`, `title`, `email`, `description`, `price`       |
| Teal    | Relationships `relationships`         | References to other rows: foreign keys and link columns.                       | `customer_id`, `parent_id`, `book_id`                  |
| Slate   | Settings `settings`                   | Options that change how the row behaves or is shown: flags, limits, positions. | `max_loans`, `position`, `is_public`, `theme`          |
| Neutral | Audit fields `audit`                  | When the row was created, changed, archived or deleted, and by whom.           | `created_at`, `updated_at`, `created_by`, `deleted_at` |

## Choosing a type

- **Identification** identifies the row, inside or outside the database: the primary key, a public number, a slug, the id the row has in another system.
- **Status** says where the row stands: a state, an active or archived flag, a version, the moment a state changed (`returned_at`, `paid_at`).
- **Categorization** sorts rows into groups: a type, a kind, a genre, tags.
- **Descriptive information** is what people read about the row: names, titles, emails, text, amounts and prices.
- **Relationships** point at other rows: foreign keys and link columns.
- **Settings** change how the row behaves or is shown: limits, options, flags such as `is_public`, a position used for sorting.
- **Audit fields** record when the row was created, changed, archived or deleted, and by whom.

When a column could be two types, choose what it is for. A foreign key that also identifies the row (a composite key of a link table) is relationships; a timestamp that marks a state change is status, while `created_at` is audit.

## Where you set it

- **Canvas**: **Information type** in the column's details. The simple and raw views show the type as a colour band at the left of each column, and the details panel shows the colours when nothing is selected.
- **Text format**: the column setting `type: <value>`, for example `type: identification`. See the [text format](/docs/text-format#columns).
- **Agents**: the MCP tools `create_table` and `update_column`, or `apply_operations` (a `column.update` with `informationType`). The skill tells agents to give every column a type.

A column linked to a [column definition](/docs/column-definitions) takes the definition's information type: set it on the definition.

## Why it matters

- The diagram shows each table's shape at a glance: keys, references, settings and audit fields each have their colour.
- Agents read the type with every column (`get_database`, `get_table`) and can find columns by type across your databases with `search_columns`.
- The issues panel lists columns without a type as information (rule `missing_information_type`), so a database can reach a fully typed state.

---

# Column definitions

> Reusable column types and enums shared by every database of your organization, so one meaning has one definition.

Source: https://docs.architure.dev/docs/column-definitions

A column definition is a named, reusable column type of your organization: an enum such as `order_status` with its values, or a type with a meaning such as `email_address` or `money_amount`. Columns in any database link to it and take its type, values, information type and description. When the definition changes, every linked column follows.

Definitions belong to the organization, not to a database, like the tech stack and the skills. That is what lets your agents reuse the same `order_status` everywhere instead of inventing a new set of values in each session.

## What a definition holds

| Field | Meaning |
| --- | --- |
| Name | How columns and agents refer to it, for example `copy_condition` |
| Kind | **Enum**, with its values in order, or **Other data type** |
| Data type | For another data type, the SQL type, for example `text` or `numeric(12,2)`. An enum's type is its own name |
| Dialect | PostgreSQL, MySQL, or **Every dialect** for a portable definition |
| Information type | The [information type](/docs/information-types) of every linked column |
| Allows NULL and default value | Copied onto a column when it links, as a starting point; the column can change them afterwards |
| Description | Rich text, read by people and agents |

## The Column definitions page

**Column definitions**, under **Databases** in the organization's sidebar, lists the definitions **In use** and the **Archived** ones. **New definition** creates one; the menu of each definition offers **Edit**, **Archive** (or **Restore**) and **Delete**.

- **Edit**: every column linked to the definition follows the change, in every database.
- **Archive**: the definition leaves the type pickers, and the columns already linked to it keep it. **Restore** brings it back.
- **Delete**: refused while columns link to it; archive it instead, or link those columns to another type first. A definition no column uses is deleted for good.

Owners, admins and members create, edit, archive and delete definitions; viewers read them. Like every write, it needs an active trial or subscription (see [Billing and trial](/docs/billing)).

## Linking a column

In the canvas, open a column's type picker: **Column definitions** come first (those of the database's dialect and the portable ones), then the dialect's **Data types**. Choosing a definition links the column, and the column shows a chain icon. **New column definition…** at the end of the definitions creates one and links the column to it.

A linked column:

- reads its **data type, values, information type and description** from the definition;
- keeps its **own name, nullable, default, primary key, unique and auto-increment** settings and its position;
- gets the definition's nullable and default when it links, as a starting point.

To unlink, choose **Unlink and keep the type** in the column's details, or choose a plain data type in the type picker.

## Where definitions come from

- The **Column definitions** page, or **New column definition…** in the canvas's type picker. In a draft, definitions stay in the draft until you save it; saving creates them in your organization.
- **Imports**: every enum type of an imported database becomes a definition, or links to an existing definition with the same name and values. See [Import](/docs/import).
- **Agents** do not create definitions. They read them with the MCP tool `list_column_definitions` and link columns to them with `create_table` and `update_column`; the skill tells them to prefer an existing definition over a new enum, and to ask you when none fits.

## In SQL, DBML and text

- **PostgreSQL export**: a definition with values becomes `CREATE TYPE <name> AS ENUM (...)`, and linked columns use that type.
- **MySQL export**: linked columns get an inline `ENUM(...)` with the definition's values.
- **DBML export**: the enum types, without the links.
- **Text format**: a linked column carries the setting `use: <definition name>`, and the database's enums appear as `Enum` blocks. The text can link and unlink columns, but not change a definition. See the [text format](/docs/text-format#enums).

The issues panel warns when a definition used in the database has a type the database's dialect does not know, or was made for the other dialect (rule `unknown_data_type`).

---

# Database connections

> Store how to reach a database in each environment, encrypted, test it from Architure's servers, and sync its schemas into the design.

Source: https://docs.architure.dev/docs/database-connections

A database designed in Architure usually exists somewhere too: a production database, a preview branch, a local one. A database connection records how to reach it in each environment, so Architure can test it and [sync](/docs/schema-sync) its live schemas into the design. Each [database](/docs/databases) holds one connection URL per scope: **All**, **Production**, **Preview** and **Development**, the same scopes as [environment variables](/docs/environment-variables). The URL is encrypted on Architure's servers, and Architure never writes to the live database.

## Adding a connection

Open the database's canvas and choose **Connections** in the top bar; its count is the number of connections. The **Connections of** dialog lists them, then a form: pick a **Scope** among those still free, paste the **Connection URL** and choose **Save and test**:

- PostgreSQL: `postgres://user:password@host:5432/database`, with `?sslmode=require` to encrypt the connection or `?sslmode=verify-full` to also check the server's certificate.
- MySQL: `mysql://user:password@host:3306/database`, with `?ssl-mode=required` or `?ssl-mode=verify_identity`.

The URL must match the database's dialect. Each scope holds one connection; delete it to replace it. The test connects from Architure's servers and runs `select 1`; a failed test still saves the URL.

## The list of connections

Each row shows the scope, the URL hidden behind dots, and the last test: **Connected**, **Failed** with the driver's message under the row, or **Not tested**, with when it ran. On the row:

- the eye reveals the URL and hides it again, and the copy button copies it;
- **Sync…** opens the [schema sync](/docs/schema-sync);
- the refresh button tests the connection again;
- the bin deletes the connection, at once.

Tests are limited to ten a minute per organization.

## Syncing schemas

**Sync…** on a connection's row reads the live database through that connection and brings the design in line with it: you choose the live schemas, review a preview (**New**, **Changed**, **Only in Architure**), then **Apply changes** as one undoable edit. The read runs the [catalog query](/docs/import) in a read-only transaction and counts against the ten tests a minute. See [Schema sync](/docs/schema-sync).

## What is protected

- **Encryption.** URLs are encrypted with the server's secrets key, like environment variable values.
- **Public addresses only.** Before connecting, Architure resolves the host and refuses loopback, link-local (including cloud metadata addresses), private, unique-local, carrier-grade NAT and multicast addresses, then connects to the address it checked. A database inside a private network cannot be tested.
- **Reads only.** A test runs `select 1`. A sync runs the catalog query in a read-only transaction, with a 30-second limit, and keeps nothing of what it read but the changes you apply. Nothing is ever written to the live database.
- **Allow lists.** A database that accepts only known addresses must allow Architure's servers, or the test fails with a timeout.

## Who can see and change connections

Owners, admins and members add, reveal, test, sync and delete connections. Viewers do not see the **Connections** button, and agents never get the URLs: no MCP tool reads them.

Like every write, saving, testing, syncing and deleting need an active trial or subscription. While the organization is read-only (see [Billing and trial](/docs/billing)), the dialog still lists and reveals the connections, without the form and the row buttons.

---

# Schema sync

> Pull the chosen live schemas of a database connection into the design, previewed, then applied as one undoable edit.

Source: https://docs.architure.dev/docs/schema-sync

The schema sync brings a database's design in line with what its live database holds. It reads the chosen schemas through one of the database's [connections](/docs/database-connections), shows what would change, and changes the design only when you apply. It never writes to the live database: the live database is the source, the design the target.

Use it after a migration ran, or to bring a database that changed outside Architure back in step. For a first look at a database that has no connection, [import](/docs/import) its schema instead.

## Start a sync

Open the database's canvas, choose **Connections** in the top bar, then **Sync…** on the row of the connection to read. The **Sync from the live database** dialog opens and reads the live schemas through that connection.

Owners, admins and members sync, while the organization has an active trial or subscription. Viewers do not see the connections, and agents have no tool for it.

## 1. Choose the schemas

The dialog lists the live schemas with their table counts. **In Architure** marks a schema the design already has. Those are ticked at first; when the design has none of them, every schema is ticked. Tick the ones to sync, then **Preview**.

A MySQL connection has one schema: the database named in its URL, which syncs into `public`, as an import maps it. The URL must name a database.

## 2. Preview

Architure reads the chosen schemas and compares them with the design by name: schemas, then tables by schema and name, then the columns, indexes and foreign keys of each table. The preview opens with a summary per group, counted in schemas, tables, columns, indexes and foreign keys:

- **New**: what the live database has and the design lacks. A live schema the design lacks is created. A new enum type proposes a new column definition, listed under "New column definitions".
- **Changed**: what differs, for example a data type (`text → character varying(120)`), NOT NULL, a default, a key, an index's columns or a foreign key's actions.
- **Only in Architure**: tables, columns, indexes and foreign keys of the chosen schemas that the live database lacks, such as tables planned in Architure or dropped live. They are kept.

Then each table that changes is listed with its schema, its column count, its group and its lines: `+` for what is new, `~` for what changed, `−` for what is only in Architure.

Tick **Also remove what is only in Architure** to make the chosen schemas mirror the live database: the preview counts what goes, and the apply removes it. Left unticked, nothing is removed.

Under **skipped or approximated**, the preview lists what the design cannot hold, as an import of the catalog query does: the expression of a generated column, the condition of a partial index, an index on an expression, a foreign key to a table outside the chosen schemas that the design does not have. A foreign key to such a table that the design has, by schema and name, is kept. Views, functions and triggers are not read at all. When nothing differs, the dialog says "No changes: the chosen schemas match the live database." **Back** returns to the schemas.

## 3. Apply

**Apply changes** creates the proposed column definitions in the organization, then applies every change to the design as one edit. A notice says what was added, changed and removed, with **Undo**; **Undo** in the top bar reverts the whole sync too. New tables appear on a grid under the existing ones: **Auto-layout** arranges them.

Teammates and agents may change the database while the preview is open. The dialog computes the changes again when you apply. If the result differs from the preview, nothing is applied: the dialog shows the new preview and says "The model changed since the preview: check it again, then apply."

## What the live database wins on

For every matched table, the live values replace the design's: data types (compared by meaning, so `int4` equals `integer`), NOT NULL, defaults, primary keys, unique and auto-increment flags, the order of the live columns, an index's columns and uniqueness, a foreign key's name, cardinality and actions.

A renamed table, column or index cannot be matched by name: it shows as one removal and one addition.

## What stays

- The position, area and information type of every matched table and column.
- Descriptions. A live comment fills only an empty description; a description written in Architure always wins.
- Table relationships, which exist only in Architure.
- Schemas you did not choose. A schema is never deleted.
- Column definitions. A sync never edits one. A column linked to a definition stays linked while the definition's data type is the live type; otherwise it is unlinked, takes the live type and keeps its information type. A live enum links to a definition with the same name and values, or proposes a new one (a taken name gets a `_2` suffix and a warning).

## Limits

- Each read runs the [catalog query](/docs/import) in a read-only transaction, with a 30-second limit, through the same public-address check as a test. The catalog is not stored.
- Reading the schemas and the preview each count against the ten connection tests a minute per organization.
- One preview reads at most about 4 MB of catalog: sync a large database a few schemas at a time.
- The outcome of each read is shown on the connection like a test: **Connected**, or **Failed** with the message.

---

# Text format reference

> The text view's format, DBML plus information types, column definitions and coloured areas, and how an edit in text is applied.

Source: https://docs.architure.dev/docs/text-format

The text format describes a whole [database](/docs/databases) as text: its schemas, tables, columns, relationships, enums and areas. You edit it in the canvas's text view, and agents receive it from the MCP tool `get_database`. It is [DBML](https://dbml.dbdiagram.io/docs/) (tables, columns, references, enums and table groups) with three additions:

- the column setting `type: <information type>`;
- the column setting `use: <column definition>`;
- table groups, which are the canvas's areas, with a `color` setting.

The format round-trips exactly: writing a database as text and reading the text back gives the same database and no changes. Every example on this page is checked that way.

What the text leaves out: descriptions (edit them in the canvas's details panel, or with the MCP tool `set_description`), table positions, area positions and sizes, and the canvas's view settings.

## An example

The "Lending library" sample database, as the text view shows it:

```dbml title="Lending library"
Enum copy_condition {
  new
  good
  worn
  damaged
}

Table branches {
  id uuid [pk, not null, type: identification]
  name text [not null, type: descriptive]
  city text [not null, type: descriptive]
  opens_at time [type: settings]
  created_at "timestamp with time zone" [not null, default: `now()`, type: audit]
}

Table members {
  id uuid [pk, not null, type: identification]
  card_number text [not null, unique, type: identification]
  full_name text [not null, type: descriptive]
  email text [not null, unique, type: descriptive]
  home_branch_id uuid [type: relationships]
  max_loans integer [not null, default: 5, type: settings]
  created_at "timestamp with time zone" [not null, default: `now()`, type: audit]
}

Table authors {
  id uuid [pk, not null, type: identification]
  full_name text [not null, type: descriptive]
  born_year integer
}

Table books {
  id uuid [pk, not null, type: identification]
  isbn text [not null, unique, type: identification]
  title text [not null, type: descriptive]
  genre text [type: categorization]
  branch_id uuid [not null, type: relationships]
  is_archived boolean [not null, default: false, type: status]
  created_at "timestamp with time zone" [not null, default: `now()`, type: audit]

  indexes {
    (branch_id) [name: 'books_branch_id_idx']
  }
}

Table book_authors {
  book_id uuid [pk, not null, type: relationships]
  author_id uuid [pk, not null, type: relationships]
  position integer [not null, default: 0, type: settings]
}

Table loans {
  id bigint [pk, not null, increment, type: identification]
  book_id uuid [not null, type: relationships]
  member_id uuid [not null, type: relationships]
  borrowed_at "timestamp with time zone" [not null, default: `now()`, type: descriptive]
  due_on date [not null, type: descriptive]
  returned_at "timestamp with time zone" [type: status]
  condition_out copy_condition [not null, default: 'good', type: status, use: copy_condition]
  condition_in copy_condition [type: status, use: copy_condition]

  indexes {
    (member_id) [name: 'loans_member_id_idx']
  }
}

Ref members_home_branch_id_fkey: members.home_branch_id > branches.id [delete: set null]
Ref books_branch_id_fkey: books.branch_id > branches.id [delete: restrict]
Ref book_authors_book_id_fkey: book_authors.book_id > books.id [delete: cascade]
Ref book_authors_author_id_fkey: book_authors.author_id > authors.id [delete: cascade]
Ref loans_book_id_fkey: loans.book_id > books.id [delete: restrict]
Ref loans_member_id_fkey: loans.member_id > members.id [delete: restrict]
Ref: members <> books

TableGroup Catalogue [color: teal] {
  authors
  books
  book_authors
}
```

The text lists the enums the database uses first, then the tables (schema by schema, in the order they were created), then the references, then the areas.

## Tables

```dbml
Table books {
  id uuid [pk, not null, type: identification]
  title text [not null, type: descriptive]
}

Table billing."invoice lines" {
  id bigint [pk, not null, increment, type: identification]
  amount numeric(10,2) [not null, type: descriptive]
}
```

- A table of the default schema `public` is written without its schema: `Table books`. A table of another schema is qualified: `Table billing.invoices`. A new schema is created when a table needs it; the text never deletes a schema.
- A name is bare when it is made of letters, digits and `_`; quote any other name in double quotes: `"invoice lines"`. The words `Table`, `Ref`, `Enum`, `TableGroup`, `Project`, `Note`, `Indexes` and `as` are quoted when they are used as names.
- Columns come first, one per line, then the table's `indexes` block.

## Columns

```dbml
Enum copy_condition {
  new
  good
  worn
  damaged
}

Table loans {
  id bigint [pk, not null, increment, type: identification]
  member_id uuid [not null, type: relationships]
  borrowed_at "timestamp with time zone" [not null, default: `now()`, type: descriptive]
  fee numeric(6,2) [not null, default: 0, type: descriptive]
  is_renewed boolean [not null, default: false, type: status]
  notes "character varying(500)"
  condition_out copy_condition [not null, default: 'good', type: status, use: copy_condition]
}
```

A column is its name, its data type and its settings in brackets, on one line. Columns are written in their order. The data type is written as in SQL; it is quoted when it contains spaces: `"timestamp with time zone"`, `"character varying(500)"`.

Settings, all optional, separated by commas, written in this order:

| Setting | Meaning |
| --- | --- |
| `pk` | Part of the primary key. Several `pk` columns make a composite key, in column order. `primary key` is read too |
| `not null`, `null` | Nullability: a column is nullable unless it says `not null` |
| `unique` | Unique |
| `increment` | Auto-increment (an identity column in PostgreSQL, `AUTO_INCREMENT` in MySQL) |
| `default: <value>` | A number (`5`), `true` or `false`, a string in single quotes (`'good'`, the SQL string literal), or any other SQL expression in backticks (`` `now()` ``). `default: null` means no default |
| `type: <information type>` | One of `identification`, `status`, `categorization`, `descriptive`, `relationships`, `settings`, `audit`. See [information types](/docs/information-types) |
| `use: <column definition>` | Links the column to the organization's [column definition](/docs/column-definitions) of that name |
| `note: '<text>'` | Read and ignored: descriptions are not part of the text |

A column with `use:` takes its data type, values, information type and description from the definition, so the text must agree with the definition: write the definition's data type (for an enum, its name), and write `type:` with the definition's information type, or leave `type:` out when the definition has none. A name that is not one of your organization's definitions is an error: create the definition on the **Column definitions** page first. To unlink a column, remove `use:`.

Strings use single quotes, and three single quotes (`'''`) for text over several lines. Inside quotes, a backslash escapes the next character (`\'`, `\\`, `\n`). `//` starts a comment to the end of the line, and `/* ... */` a comment over several lines.

## Indexes

Inside a table, after its columns:

```dbml
Table loans {
  id bigint [pk, not null, increment, type: identification]
  member_id uuid [not null, type: relationships]
  borrowed_at "timestamp with time zone" [not null, type: descriptive]

  indexes {
    (member_id) [name: 'loans_member_id_idx']
    (member_id, borrowed_at) [unique, name: 'loans_member_borrowed_key']
  }
}
```

Each line lists the index's columns in parentheses, in order, with the settings `unique` and `name`. An index you add without a name is named `<table>_<columns>_idx` (`_key` when it is unique). A bare column name without parentheses is read too. DBML's `(a, b) [pk]` marks those columns as the primary key. Indexes on expressions are not part of the model.

## References

A reference between columns is a foreign key, written from the referencing column to the referenced one:

```dbml
Table customers {
  id uuid [pk, not null, type: identification]
}

Table orders {
  id uuid [pk, not null, type: identification]
  customer_id uuid [not null, type: relationships]
}

Table invoices {
  id uuid [pk, not null, type: identification]
  order_id uuid [not null, unique, type: relationships]
}

Table order_lines {
  order_id uuid [pk, not null, type: relationships]
  line_number integer [pk, not null, type: identification]
}

Table shipments {
  id uuid [pk, not null, type: identification]
  order_id uuid [not null, type: relationships]
  line_number integer [not null, type: relationships]
}

Ref orders_customer_id_fkey: orders.customer_id > customers.id [delete: restrict, update: cascade]
Ref invoices_order_id_fkey: invoices.order_id - orders.id
Ref order_lines_order_id_fkey: order_lines.order_id > orders.id [delete: cascade]
Ref shipments_order_line_fkey: shipments.(order_id, line_number) > order_lines.(order_id, line_number)
```

`Ref`, then the constraint name (optional), a colon, the two ends and the operator, then the actions:

| Operator | Cardinality |
| --- | --- |
| `>` | Many-to-one: many rows of the left table point at one row of the right table |
| `<` | One-to-many: the same, written from the referenced side (`Ref: authors.id < books.author_id`) |
| `-` | One-to-one |
| `<>` | Many-to-many, only between tables |

Actions: `delete:` and `update:`, each `no action`, `restrict`, `cascade`, `set null` or `set default`. A composite foreign key lists its columns in parentheses on both sides, in the same order. A reference without a constraint name (`Ref: orders.customer_id > customers.id`) gets the database's usual name when you export SQL.

A reference between two tables, drawn before you know which columns join them, names the tables only:

```dbml
Table members {
  id uuid [pk, not null, type: identification]
}

Table books {
  id uuid [pk, not null, type: identification]
}

Ref: members <> books
```

The issues panel lists such a reference until you detail it into columns (rule `table_relationship_not_detailed`).

## Enums

```dbml
Enum copy_condition {
  new
  good
  worn
  damaged
}

Table loans {
  id bigint [pk, not null, increment, type: identification]
  condition_out copy_condition [not null, default: 'good', type: status, use: copy_condition]
}
```

An `Enum` block shows the values of a column definition the database uses, so that the text reads like DBML in other tools. Definitions belong to your organization: the text cannot create or change them. An `Enum` that is not one of your definitions, or that lists other values, is an error; change the values on the **Column definitions** page.

## Areas

An area of the canvas is a table group with a colour:

```dbml
Table authors {
  id uuid [pk, not null, type: identification]
}

Table books {
  id uuid [pk, not null, type: identification]
}

Table members {
  id uuid [pk, not null, type: identification]
}

TableGroup Catalogue [color: teal] {
  authors
  books
}

TableGroup "Members and loans" [color: amber] {
  members
}
```

Colours: `slate`, `red`, `orange`, `amber`, `yellow`, `lime`, `green`, `emerald`, `teal`, `cyan`, `sky`, `blue`, `indigo`, `violet`, `purple`, `fuchsia`, `pink`, `rose`. A new group without `color` is slate. A table belongs to at most one area, and a table listed in no group leaves its area. Removing a group deletes the area and keeps its tables.

## DBML from other tools

The text view also reads what other DBML tools write. What the model does not hold is read and ignored: `Project` blocks, `Note` blocks and `note:` settings, table aliases (`as B`) and table settings such as `headercolor`.

```dbml title="DBML from another tool"
Project library {
  database_type: 'PostgreSQL'
}

Table authors {
  id integer [primary key, increment]
  name varchar(100) [not null]
}

Table books as B [headercolor: #3498DB] {
  id integer [primary key, increment]
  title varchar(200) [not null, note: 'Shown in the catalogue']
  author_id integer

  Indexes {
    author_id
  }

  Note: 'One row per title the library owns.'
}

Ref: authors.id < books.author_id // one author, many books
```

Pasted this way, the tables arrive without information types: the issues panel lists the columns to type (rule `missing_information_type`).

## How an edit is applied

In the text view, edit the text, then choose **Apply** or press <kbd>Cmd</kbd> + <kbd>S</kbd> (<kbd>Ctrl</kbd> + <kbd>S</kbd> on Windows and Linux). **Discard** drops your edit. Until you edit, the text view follows the database as it changes, including your teammates' and agents' changes.

Architure compares the text with the database by name, using `schema.table.column` paths:

- an object with the same name keeps its identity and receives only what changed;
- a name that disappeared is deleted;
- a new name is created. A new table is placed under the existing ones, and a new area around its tables.

So **a rename in the text is a delete plus a create**: a renamed table gets a new identity, a new place on the canvas and no description, and a renamed column loses its description. Rename on the canvas, or with the MCP tool `update_column`, to keep them.

References are matched by their columns: changing a reference's name or actions updates it, and changing its columns replaces it. Indexes are matched by name.

Text that cannot be applied changes nothing. Its errors are marked at their line and column: a syntax error, an unknown setting, a reference or a group that names a missing table or column, an unknown column definition, or an `Enum` that differs from its definition.

---

# Environment variables

> The variables your packages read, one encrypted value per scope, linked to the packages that use them and pushed to Vercel; your agents read the names, never the values.

Source: https://docs.architure.dev/docs/environment-variables

Environment variables keep the configuration your apps read (`DATABASE_URL`, `STRIPE_SECRET_KEY`, `RESEND_API_KEY`) in one place. Each variable has a name, a description, and a value for **All** environments or its own value for **Production**, **Preview** and **Development**. A variable is available to all packages, or linked to the [packages](/docs/repositories) that read it (`apps/web` of one repository, `packages/email` of another).

Your agents read the names and descriptions their package uses, never the values: they write `process.env.STRIPE_SECRET_KEY` instead of guessing a name, and ask you for a value when they need one. [Deployments](/docs/deployments) pushes the values each package reads to its Vercel projects.

## Names and descriptions

A name uses upper-case letters, digits and underscores, and does not start with a digit (`DATABASE_URL`, `NEXT_PUBLIC_APP_URL`), up to 255 characters. The description is rich text: what the variable is for and where to get a value, for people and agents. Agents read it as Markdown.

A variable can also name the [tech stack](/docs/tech-stack) item it belongs to (**Tech stack item** in its dialog), so an agent reading "Stripe" in the tech stack also learns its keys.

## Values and scopes

A variable holds one value per scope, and at least one:

| Scope | Used |
| --- | --- |
| All | In every environment that has no value of its own |
| Production | In production |
| Preview | In preview deployments |
| Development | In development |

An environment's own value overrides **All**: a variable with an **All** value and a **Production** value uses the second in production and the first everywhere else. The three environments are Vercel's targets; a sync pushes an **All** value to each of the three (see [Deployments](/docs/deployments)).

Values are encrypted on Architure's servers (AES-256-GCM) before they are stored. They are decrypted only on the server: when you reveal or copy one, and when [Deployments](/docs/deployments) compares or pushes it. A value holds up to 32 KB of text.

## The Environment variables page

**Environment variables**, in the organization's sidebar, lists one row per variable: its **Name** (with the first line of its description), its **Packages** (**All packages**, the packages' names, or **No package**) and a cell per scope: **All**, **Production**, **Preview**, **Development**.

A value shows as dots. The eye reveals it, and hides it again; the copy button copies it without showing it. A scope without its own value shows **Uses All**, or a dash when there is no **All** value either. With no variable yet, the page reads "No variables yet".

## Creating and editing a variable

**New variable** opens the dialog:

- **Name** and **Tech stack item** (or **None**).
- **Values**: one field per scope. Fill in at least one. "An environment's own value overrides All."
- **Packages**: **Available to all packages** (the default), or turn it off and check the packages that read the variable, grouped by repository.
- **Description**.

**Create variable** saves it. **Edit**, in the row's menu, opens the same dialog, but it never loads the stored values: a scope with a value reads **Unchanged** and keeps its value until you type a new one, and one without a value reads **Not set**. **Clear** beside a stored value removes it on save (the field then reads "Cleared on save"; **Keep** undoes it). **Save** writes the changes.

**Delete**, in the row's menu, asks for a confirmation, then deletes every value of the variable for good, in every scope.

## Two variables with the same name

Several variables may share a name, as long as a package never gets two values for the same name and scope from the same level. The two levels are "linked to the package" and "available to all packages". So you can have:

- a `DATABASE_URL` available to all packages with an **All** value, and another `DATABASE_URL` linked to `apps/api` with its own **Production** value;
- two `DATABASE_URL` variables available to all packages, one with a **Preview** value and one with a **Production** value.

A save that would give a package a second value for the same name and scope at the same level (two variables available to all packages, or two linked to one package, setting the same scope) is refused with a "clash" error that names the other variable. Change the scope, the packages, or the other variable.

## Precedence

For one package, Architure resolves each name scope by scope:

1. A variable linked to the package wins over one available to all packages with the same name.
2. At that level, the environment's own value wins over **All**.

So a `DATABASE_URL` available to all packages and a `DATABASE_URL` linked to `apps/api` with only a **Production** value give `apps/api` its own value in production and the shared one elsewhere. The page filtered to a package, the agents and the Vercel sync all use this one rule (see [Concepts](/docs/concepts#scopes-and-precedence)).

## The Package filter

Once the organization has imported a [repository](/docs/repositories), **Package** above the table filters the page to one package (or **All variables**), grouped by repository. The page then shows only the variables that package reads (the ones linked to it and the ones available to all packages), resolved exactly as its agents get them from `list_environment_variables`, with a line saying "What `apps/web` (`acme/shop`) reads".

Each cell then says whether the package reads that value:

- **Used**: the package gets this value for this scope ("This package reads this value.").
- **Overridden**: another variable of the same name supplies this scope; hover to see whether it is one linked to the package or one available to all packages.

A scope that falls back to **All** is marked the same way. The filtered page has its own address (`?package=` and the package's id), so you can share it; **All variables** shows every variable again. A package with no variable reads "No variable for" and its name. A repository's page links each variable a package uses to this filtered view.

## Synced to Vercel

Once a variable has been pushed to a Vercel project, or brought in from one, its name shows **Synced to Vercel**, with the project names on hover. When one of its values changed since the last sync, it shows **Out of sync** instead: run **Sync** on [Deployments](/docs/deployments) to push it. Nothing is pushed when you save a variable.

## What agents see

The MCP tool `list_environment_variables` never returns a value:

- With `repository` (`owner/name`) and the folder the agent works in (`path`), it returns the package it answered for and the names that package reads, each with its description and the scopes that hold a value, each scope with its source: `package` (linked to it, which wins) or `allPackages`.
- Without a repository, it returns every variable of the organization: its name, its description and the scopes that hold a value (`all`, `production`, `preview`, `development`).

`list_tech_stack` lists, for each technology, the names of the variables linked to it. Both API key permissions (read and write) and OAuth connections read the names; no agent can create, change or reveal a variable. See [MCP tools](/docs/mcp-tools).

## Who can do what

Owners, admins and members create, edit, reveal, copy and delete variables. Viewers have no access: the page is not in their sidebar, and a repository's page shows them no variables. Like every write, saving and deleting need an active trial or subscription (see [Billing and trial](/docs/billing)); after an unpaid trial the variables stay readable, and the page says "This organization is read-only until it has a plan."

---

# Deployments

> Connect Vercel, match each Vercel project to the package it deploys, and push the environment variables that package reads, after reviewing every change.

Source: https://docs.architure.dev/docs/deployments

Deployments connects your Vercel teams to Architure. Each Vercel project is matched to the [package](/docs/repositories) it deploys, and **Sync** pushes the [environment variables](/docs/environment-variables) that package reads to the project's Production, Preview and Development environments. Nothing is written to Vercel before you review the changes and confirm them.

Architure only pushes. A project's variables are read once, when you bring them in after importing the project; from then on values flow from Architure to Vercel, never back. Deployments shows no deployment status or logs.

## Connecting Vercel

On **Deployments**, in the organization's sidebar, choose **Connect Vercel**. Architure connects through its integration on Vercel: Vercel asks which team to install it on and which of the team's projects it may reach (all of them, or the ones you pick), then brings you back to Deployments with the import dialog open. The integration reads the team's projects and reads and writes their environment variables.

Once a team is connected, the page lists the connected teams, with **Connect another team** beside them (also in the import dialog). To let Architure reach more projects of a team, give the integration access to them in Vercel.

The team's token is stored encrypted and never shown. Vercel ties the connection to the person who connected the team: if that person leaves the Vercel team, Vercel disables it, and the team's projects cannot be synced. They show this message: "The person who connected this team left it. A team owner can transfer the integration in Vercel within 30 days, or connect the team again." Connect a team from an account that stays.

Removing the Architure integration in Vercel deletes the variables Architure created there; the page says so beside the connected teams. To stop syncing a project and keep its variables in Vercel, remove the project from Deployments instead.

## Importing projects

**Import projects** lists, for each connected team, the projects the integration reaches, with a search. Each project shows its GitHub repository and root directory, and the package it matches ("Package `web` (acme/shop)") or why it matches none ("No package:" and the reason below). Projects already imported are checked, locked and marked **Imported**. Pick some and choose **Import**: at most 50 at once.

## How projects match packages

A Vercel project matches a package by its Git repository and its root directory:

- the repository is the [imported repository](/docs/repositories) whose GitHub repository is the one connected to the Vercel project;
- the package is that repository's package whose folder is the project's root directory (the repository's root, `.`, when the project has none).

A project that matches no package has **No package**, with the reason:

- "No Git repository is linked to this project in Vercel."
- "Its repository is not on GitHub." (GitLab, Bitbucket and other providers do not match.)
- "Its GitHub repository is not imported in Repositories." Import it on Repositories.
- "Its root directory is not one of the repository's packages." Check the root directory in Vercel, or refresh the repository.
- "A member cleared its package."
- "Its repository and root directory match a package now." The repository or the package was imported after the project: choose **Use** and the package's name to match it.

A project without a package is never synced. A package may have several Vercel projects (a web app deployed twice, for example); a project has at most one package.

## The Deployments page

Each imported project shows:

- **Project**: its name, its team and its root directory.
- **Package**: the package it deploys, or **No package** and why.
- **Variables**: how many of its Vercel variables Architure manages ("3 managed").
- **Last sync**: when it was last synced, or "Never".

Owners and admins change a project's package in the **Package** select: a package of the organization, grouped by repository, or **No package** to clear it.

The menu at the end of a row offers **Sync** (for a project with a package), **Import variables…** (owners and admins, for a project with a package) and **Remove** (owners and admins). **Remove** asks for a confirmation: Architure stops syncing the project and forgets which of its variables it manages, and its variables stay in Vercel as they are.

## Bringing in a project's variables

Right after an import, Architure opens **Import variables of** for each new project that has a package, one after the other. It lists the variables the project holds in Vercel, by name, each with the environments (Production, Preview, Development) that have it. An environment marked with a lock holds a Secret: Vercel never returns its value. Every name that can come in is ticked; untick the ones to leave out and choose **Import** (at most 200 at once), or **Not now** to skip. **Import variables…** in the project's menu opens the dialog again later.

- A name becomes an environment variable linked to the project's package, or joins the variable of that name already linked to it ("Joins the variable of this name linked to the package.").
- The values Vercel returned become the variable's values. When Production, Preview and Development hold the same value, it becomes one **All** value ("The same value for every target: stored as All.").
- Each environment whose value was read is now managed by Architure: the next sync updates that Vercel variable instead of creating a second one.
- An environment holding a Secret comes in without a value and stays not managed until you set the value in Architure; a name whose every value is a Secret cannot be imported (create it on the Environment variables page).
- A name already managed in every environment is not offered again ("Already managed by Architure."), and a name that is not upper-case letters, digits and underscores cannot come in: rename it in Vercel first.
- Variables limited to a Git branch or a custom environment are not imported.

Changes made later in Vercel are never read back: Architure's value wins on the next sync.

## Sync

**Sync** at the top of the page reviews every imported project; **Sync** in a project's menu reviews only that one. The **Sync to Vercel** dialog computes, for each project and each environment, the values its package reads, exactly as the Environment variables page filtered to that package (and as its agents get them): a variable linked to the package before one available to all packages, then the environment's own value, else **All**. An **All** value goes to each of the three environments. Architure then compares those values with the project's Vercel variables and lists one row per name, grouped by environment:

- **Add**: Architure gives a value and the project has no variable for that name and environment (also when the variable was deleted in Vercel since the last sync).
- **Change**: the value changed in Architure since the last sync, or someone edited the variable in Vercel since then (the row is marked **Edited in Vercel**). Architure's value replaces it.
- **Remove**: a variable Architure manages that the package no longer reads (its variable was deleted, unlinked from the package, or lost that environment's value).
- **Take over**: Architure gives a value for a name and environment that the project already holds in a variable Architure does not manage ("Vercel already holds this key; Take over overwrites it."). Taking it over overwrites the Vercel value and manages the variable from then on.
- **Not managed**: a variable that exists only in Vercel, or is limited to a Git branch ("Preview value for the branch" and its name) or to a custom environment (listed under **Custom environments**). It is listed without a checkbox and never touched.

Adds and changes start ticked; removes and take-overs start unticked, so each one is your own decision. A project already in step reads "Up to date: nothing to write."

A project shows a badge instead of tickable rows when it cannot be synced:

- **No package**: it matches no package.
- **Blocked**: two variables of one level give its package the same name for one environment ("Two variables of one level set the same key for a target: fix them before syncing this project."). Fix them on the Environment variables page.
- **Unreachable**: Vercel refused, with its reason: for example the project is no longer one the integration may reach, or the person who connected the team left it.

**Review and sync** shows the confirmation: "Write 5 changes to 2 projects in Vercel?", with the count of adds, changes, removes and take-overs, what removes and take-overs do, and that deployments pick the new values up on their next build. **Write 5 changes** writes them; **Back** returns to the review. At most 2,000 rows go in one sync.

**Sync finished** then says what each project got: "Synced: 3 changes written.", "Nothing to write.", or "Stopped after 2 changes:" with Vercel's error. Projects are written one at a time, and a project stops at its first refused write, keeping what was written before it. A row whose situation changed between the review and the confirmation (someone else synced, or a value changed) is skipped, and the outcome says how many rows were skipped: sync again to see them.

Architure writes every value as a **Secret** (sensitive) variable, in Production, Preview and Development alike, so Vercel never shows it again. Values are compared through a fingerprint that never leaves Architure's servers, and the dialog shows names, never a value.

## What Architure never does in Vercel

- It never reads values back from Vercel after a project's variables were brought in.
- It never changes or deletes a variable it did not create or take over.
- It never removes a variable unless you tick its **Remove** row, and never takes one over unless you tick its **Take over** row.
- It never writes before you confirm, and never syncs on its own when a value is saved.
- It never touches Shared Environment Variables, Git branch values or custom environments.

## On the Environment variables page

A variable pushed to or brought in from at least one project shows **Synced to Vercel**, with the project names on hover, or **Out of sync** when one of its values changed since the last sync. Run **Sync** to push it.

## Who can do what

Owners and admins connect Vercel teams, import projects and their variables, change a project's package and remove a project. Members see the projects and run **Sync**; the page tells them "Your role can read the projects and sync them, not connect Vercel or change the projects." Viewers do not see the page, since the review shows which values changed, and agents have no access to it. Like every write, connecting, importing and syncing need an active trial or subscription (see [Billing and trial](/docs/billing)).

---

# Connect your agent

> Let Claude Code, Claude.ai, Cursor, Codex or any MCP client read your architecture and write your databases through Architure's MCP server, with an API key or OAuth.

Source: https://docs.architure.dev/docs/connect-your-agent

Architure serves your organization's architecture to agents through an MCP server (Streamable HTTP): the tech stack, the repositories and their packages, the team's skills, the environment variable names (never the values) and the databases, which agents also write. Its address:


```text
https://app.architure.dev/api/mcp
```



In the app, **Agents** in the organization's sidebar and **Connect an agent** in the canvas's top bar show the same address. The Agents page also holds the organization's API keys, each repository's [install link](/docs/skills#install-link) status and the list of the MCP tools.

Connecting an agent takes two things: **access** to the MCP server (an API key or OAuth) and, recommended, the **[skill](/docs/skill)**, which teaches the agent how to work with Architure: find the package it works in, read the tech stack before choosing a library, follow the team's skills, use the organization's variable names, read the database before writing, check it after writing.

## API key or OAuth

| | API key | OAuth |
| --- | --- | --- |
| Who it acts as | The organization; changes are signed with the key's name | You, with your role in the organization |
| What it may do | Chosen when the key is created: **Read** (every read tool), or **Read and write** (also the database writes) | Read and write, limited by your role: an owner, admin or member writes; a viewer's agent only reads |
| Who sets it up | An owner or admin creates the key on the organization's **Agents** page | You, by signing in from the agent |
| Best for | CI, scripts, shared or headless machines | Your own Claude Code, Claude.ai, Cursor or Codex |
| How to stop it | Revoke the key on **Agents** | Remove the connection in the agent; leaving the organization stops it too |

Both reach one organization only: a key or a token never sees another organization's work. Neither ever returns an environment variable's value, and agents never change the tech stack, skills or variables: they write databases only.

### Create an API key

1. In the app, open **Agents** in your organization's sidebar. Only owners and admins create and revoke keys; other members connect through OAuth.
2. Give the key a **Name** that says where it runs (for example `Claude Code on my laptop` or `ci`), choose its **Permission**, **Read** or **Read and write**, and choose **Create key**.
3. Copy the key, which starts with `architure_`. It is shown once: if you lose it, revoke it and create another.

Keep the key in an environment variable, never in a file you commit. The examples below read it from `ARCHITURE_API_KEY`:

```bash
export ARCHITURE_API_KEY="architure_..."
```

A key allows 600 requests per minute. Create one key per machine or pipeline, so its changes are signed with its own name and you can revoke it alone. The Agents page lists each key with its permission and when it was last used.

### Sign in with OAuth

When an agent connects without a key, it opens your browser on **Connect *agent* to Architure**: sign in to Architure (or create an account), read what the agent asks for, choose the **Organization** it works on (it works on that organization only), check the return address the page shows, and choose **Allow**; **Deny** tells the agent no. The agent receives a token for that organization with the scopes `schema:read` and `schema:write`. Your membership and your role are checked again on every call: leave the organization, or become a viewer, and the agent loses what it had.

If you belong to no organization yet, the page says so: choose **Deny**, then **Create an organization**, and start the connection again from the agent. The page expires after ten minutes; start again from the agent if it says the request has expired.

Agents find the sign-in on their own: the server answers a request without a credential with `401` and the address of its OAuth metadata (`/.well-known/oauth-protected-resource`). Architure accepts sign-ins that return to:

- Claude.ai, Claude Desktop and Claude's mobile apps (Claude's hosted callback);
- Cursor on the web and Cursor's cloud agents (Cursor's hosted callback);
- an agent on your own machine, such as Claude Code, Cursor's desktop app or Codex, which listens on a `localhost` or `127.0.0.1` address.

Any other hosted service cannot sign in: give it an API key.

## Claude Code

### With the plugin and OAuth (recommended)

The `architure` plugin installs the skill and the MCP server together.

**1. Install the plugin.** Add the marketplace and install the plugin from your shell:

```bash
claude plugin marketplace add architure/skills
claude plugin install architure@architure
```

**2. Sign in.** Start Claude Code (`claude`), run `/mcp`, select `architure` and choose **Authenticate**. Your browser opens: sign in, choose the organization, and allow access. If the browser does not open, copy the address Claude Code prints.

**3. Check.** Ask Claude "List my Architure databases". It calls `list_databases` and lists them.

### With an API key

**1. Create a key.** [Create a key](#create-an-api-key) and export `ARCHITURE_API_KEY`.

**2. Add the MCP server** for every repository on this machine (`--scope user`):


```bash
claude mcp add --transport http --scope user architure https://app.architure.dev/api/mcp \
  --header "Authorization: Bearer $ARCHITURE_API_KEY"
```



To share the server with your team through the repository instead, commit a `.mcp.json` at its root that reads the key from each person's environment:


```json
{
  "mcpServers": {
    "architure": {
      "type": "http",
      "url": "https://app.architure.dev/api/mcp",
      "headers": {
        "Authorization": "Bearer ${ARCHITURE_API_KEY}"
      }
    }
  }
}
```



**3. Install the skill** on its own, since the plugin would add a second, OAuth connection:

```bash
npx skills add architure/skills
```

**4. Check.** Run `claude mcp list` (or `/mcp` in Claude Code) to see `architure` connected, then ask "List my Architure databases".

## Claude.ai

Custom connectors are available on every Claude plan (one custom connector on the Free plan).

1. Open **Customize**, then **Connectors**. Choose **+ Add**, then **Add custom connector**.
2. Name it `Architure` and enter the server address shown below, then choose **Continue**.
3. Review the detected settings and choose **Continue** again.
4. Under **Authentication**, choose **Sign in when needed** (or **Sign in now**). Under **OAuth client**, keep **Use Claude's published identity (Recommended)**.
5. Choose **Add**. When you sign in, choose the organization and allow access.


```text
https://app.architure.dev/api/mcp
```



To use an API key instead, choose **No sign in** at step 4 and add a request header `Authorization` with the value `Bearer architure_...`. Everyone who uses this connector then shares the key; prefer OAuth for a team.

On Team and Enterprise plans, an owner adds the connector once in **Organization settings**, **Connectors**, **Add**, **Custom**, **Web**, with the same steps; each member then finds it in **Customize**, **Connectors** and chooses **Connect**.

To add the skill, upload it in **Customize**, **Skills** as a ZIP file whose root is the `architure` folder of the `architure/skills` repository (skills need code execution to be turned on). See [Skill](/docs/skill).

## Cursor

**1. Create a key.** [Create a key](#create-an-api-key) and set `ARCHITURE_API_KEY` in the environment Cursor starts from (your shell profile).

**2. Add the server** to `~/.cursor/mcp.json` for every repository, or to `.cursor/mcp.json` in one repository:


```json
{
  "mcpServers": {
    "architure": {
      "url": "https://app.architure.dev/api/mcp",
      "headers": {
        "Authorization": "Bearer ${env:ARCHITURE_API_KEY}"
      }
    }
  }
}
```



**3. Turn it on.** Open **Customize**, find `architure` and turn it on. The **Output** panel's **MCP Logs** show the connection and any error.

**4. Install the skill:**

```bash
npx skills add architure/skills
```

To use OAuth in Cursor's desktop app, leave out `headers`: Cursor opens your browser to sign in.

## Codex

**1. Create a key.** [Create a key](#create-an-api-key) and export `ARCHITURE_API_KEY` in the shell that runs Codex.

**2. Add the server** to `~/.codex/config.toml`:


```toml
[mcp_servers.architure]
url = "https://app.architure.dev/api/mcp"
bearer_token_env_var = "ARCHITURE_API_KEY"
```



Recent versions of the Codex CLI write the same entry with `codex mcp add architure --url <address> --bearer-token-env-var ARCHITURE_API_KEY`.

**3. Install the skill:**

```bash
npx skills add architure/skills
```

**4. Check.** Run `codex mcp list` to see `architure` enabled.

To use OAuth instead, add the server without a bearer token, then sign in:


```bash
codex mcp add architure --url https://app.architure.dev/api/mcp
codex mcp login architure
```



## Any other MCP client

Any client that speaks MCP over Streamable HTTP connects the same way: point it at the server address above.

- **With OAuth**, the client needs nothing more: the server answers its first request with `401` and the address of its OAuth metadata, and the client opens the sign-in. Architure accepts only the return addresses listed in [Sign in with OAuth](#sign-in-with-oauth): a client on your own machine listening on `localhost` or `127.0.0.1` works; a hosted service that is not listed there needs an API key.
- **With an API key**, send it on every request as the header `Authorization: Bearer architure_...`.

Then install the skill, if the client reads skills, with `npx skills add architure/skills`, or give the client the content of its `SKILL.md`.

## Tell your agent where it works

Architure answers for a package: a folder of an imported [repository](/docs/repositories) that runs with its own environment, such as `apps/web`. With the repository (`owner/name`) and the folder it works in, `list_skills`, `list_environment_variables` and `list_databases` return what that package uses; without them, they return the whole organization's.

With the skill installed, the agent finds both itself: it reads `git remote get-url origin` and the folder it works in. Without the skill, or when the repository's remote is not the GitHub repository you imported, say it in your prompt:

```text
I work in the repository acme/shop, in the folder apps/web.
```

Ask "Which Architure repositories and packages do we have?" to see what the agent can name: it calls `list_repositories`.

## First prompts

Once connected, try these in a repository you imported (each names the tools the agent calls):

- "Which libraries should I use for this package? Check the Architure tech stack." (`list_tech_stack`)
- "Which skills does our team want you to follow here? Read them." (`list_skills`, `get_skill`)
- "Which environment variables does this package read? Add them to the config module." (`list_environment_variables`; names only)
- "Show me the schema of the database this package uses." (`list_databases`, `get_database`)
- "Add a `reviews` table linked to `books`, with information types and descriptions, then check the database." (`create_table`, `check_database`)

The open canvas shows the agent's database changes within seconds.

## The tools

The server has 15 tools: `list_repositories`, `list_tech_stack`, `list_skills`, `get_skill` and `list_environment_variables` read the workspace; `list_databases`, `get_database`, `get_table`, `search_columns`, `list_column_definitions` and `check_database` read databases; `create_table`, `update_column`, `set_description` and `apply_operations` write them. A read key or `schema:read` calls the first eleven; the four writes need a write key, or `schema:write` for an owner, admin or member. Every tool, with its inputs and answers, is on [MCP tools](/docs/mcp-tools).

Agents address objects as `schema.table.column` (for example `public.books.isbn`), or `table.column` when the table's name is unique across schemas; ids are accepted too. Write tools take the revision the agent read (`baseRevision`; `apply_operations` requires it). When someone changed the database in between, the write fails with a conflict that carries the missing changes: the agent reads the database again, then writes again.

## Troubleshooting

- **401 Unauthorized**: the key is missing, mistyped, revoked, or sent without `Bearer `. With OAuth, sign in again (`/mcp` in Claude Code, `codex mcp login architure` in Codex).
- **`Forbidden` on a write tool**: the key is a **Read** key, or your role is viewer. An OAuth token without `schema:write` gets a `403` that asks the agent to sign in again with that scope.
- **429 Too Many Requests**: the key passed 600 requests in a minute. Wait a minute, or give each machine its own key.
- **The sign-in page refuses the agent's redirect**: the agent is a hosted service Architure does not list above. Use an API key.
- **`NotFound` from `list_skills`, `list_environment_variables` or `list_databases`**: the `repository` the agent sent is not imported in this organization, or no package holds its `path`. Import the repository in [Repositories](/docs/repositories), check its packages with `list_repositories`, or ask the agent to leave `repository` out.
- **This connection request has expired**: the sign-in page is valid for ten minutes. Start the connection again from the agent.
- **`PlanRequired`**: the organization has no active trial or subscription. Reading still works; writes come back once an owner or admin subscribes. See [Billing and trial](/docs/billing).
- **`Conflict`**: the database changed since the agent read it, and the answer lists the changes. The skill tells the agent to call `get_database` again, redo its change on the current schema and retry with the new revision.

---

# Skills

> Keep your team's skills in Architure, from skills.sh or written by your team, link them to the packages that use them, and install them in each repository with one command.

Source: https://docs.architure.dev/docs/skills

A skill is a folder with a `SKILL.md`: instructions an agent loads when a task matches the skill's description, with optional supporting files (references, scripts, templates). **Skills** in the app holds your team's skills in one place, from [skills.sh](https://skills.sh) or written by your team. Each skill is linked to the [packages](/docs/repositories) that use it, so an agent working in `apps/web` gets the skills of `apps/web`, and each repository installs its skills with one command.

The `architure` skill, which teaches agents to work with Architure itself, is described on the [Skill](/docs/skill) page.

## The skills list

**Skills** has three tabs: **Skills** (the live ones), **Archived** and **Trash**. Each row shows the skill's name, its source (**skills.sh** or **Custom**), its audit, its installs on skills.sh and when it was last updated. Click a row to open the skill's page; its menu holds the actions described below.

The page's two buttons add skills: **Add from skills.sh** and **New skill**.

## Add from skills.sh

**Add from skills.sh** opens the leaderboard of skills.sh, the open directory of agent skills: the most installed skills of all time, 100 at a time (**Load more** for the next hundred), refreshed once a day. Type in **Search skills.sh** and choose **Search** to find others. A skill your organization already has is marked **Added**.

Open a skill to read it before adding it. Its page shows:

- its `SKILL.md` and how many files it has;
- **Installs**: how often it was installed through skills.sh;
- **Repository**: where it comes from, with **View on skills.sh** (check the skill's licence there before sharing it);
- **Security audits**: what skills.sh's audit partners (Socket, Snyk, Gen Agent Trust Hub and others) found, each **Pass**, **Warn** or **Fail**, or **Not audited**;
- **Install without Architure**: the `skills` command that installs it straight from GitHub.

**Add skill** keeps a pinned copy in your organization. A skill whose audit failed asks first: **This skill failed an audit** names the partners and what they found, and **Add anyway** stays disabled until you tick **I read the failed audit and add it anyway**. When your organization already has the skill, the page says so and offers **Open your copy**.

A skill from skills.sh is a snapshot: it changes only when you refresh it. To change it yourself, duplicate it as custom.

### The basket

To add several skills at once, put them in the basket: the `+` button on each row of the leaderboard, or **Add to basket** on a skill's page. The basket holds 25 skills at most and stays in this browser while you browse.

The bar at the bottom of the page shows how many skills it holds; open it to see them and remove one, or choose **Clear**. **Install all** adds a pinned copy of each skill:

- When some skills failed an audit, a dialog lists them with what each partner found; **Install all anyway** stays disabled until you tick **I read the failed audits and add these skills anyway**.
- A skill that cannot be added (its name is taken, its files break the rules below, skills.sh did not answer) stays in the basket with the reason, and the others are added.

## Custom skills

**New skill** opens the editor on a `SKILL.md` template:

```markdown
---
name: my-skill
description: What this skill does and when an agent should use it.
---

# My skill

Steps and rules for the agent.
```

The frontmatter's `name` and `description` are required. The `name` uses lowercase letters, digits and hyphens (at most 64 characters) and is unique among your organization's skills; the `description` (at most 1,024 characters) is what agents read to decide when to load the skill, so say what it does and when to use it.

To add a supporting file, type its path from the skill's root in **New file path** (`references/api.md`, `scripts/check.sh`) and press Enter or **Add the file**; remove a file with the button beside it. Files are text only: at most 50 files, 256 KB each and 1 MB in all, at relative paths. **Create skill** saves it and opens its page.

## A skill's page

A skill's page shows its files in the editor, and beside them:

- **Source**: skills.sh (with **Installs on skills.sh** and **Security audits**) or custom;
- **Packages**: the packages that use it, or **Available to all packages**;
- **Tech stack item**: the technology it goes with, if any;
- **Updated**, and **Refreshed from skills.sh** for a copy from skills.sh.

A custom skill is edited in place: **Save**, or Cmd+S (Ctrl+S on Windows and Linux). A copy from skills.sh is read-only.

The menu, on the page or on the skill's row in the list, holds:

- **Packages…**: turn on **Available to all packages** (the default: every package of every repository uses it, including those imported later), or turn it off and tick the packages that use it. A skill linked to no package and not available to all packages reaches no agent and no repository.
- **Tech stack item…**: link the skill to one item of your [tech stack](/docs/tech-stack), or **None**. Agents reading the tech stack learn which skill goes with a technology.
- **Refresh** (skills.sh copies): fetches the skill's latest version from skills.sh and shows which files it changes and its audit, then **Save the new version**. When skills.sh changed the skill again in the meantime, nothing is saved: refresh again.
- **Duplicate as custom**: a custom copy you can edit, under a new name (`<name>-custom` by default); its `SKILL.md` takes the new name, and its page opens.
- **Archive**: hides the skill from agents and install links until you **Restore** it from **Archived**.
- **Move to trash**: the same, from **Trash**. In **Trash**, **Delete forever** deletes its files; repositories keep the copy they installed.

A skill restored from the archive or the trash keeps its name, unless another skill took it meanwhile: rename that one first.

## Roles

Owners, admins and members add, write, link, refresh, duplicate, archive, trash and delete skills. Viewers read them. Only owners and admins make and revoke install links.

After the trial, while the organization has no active plan, skills are read-only: agents still read them and install links still serve them. See [Billing and trial](/docs/billing).

## Install link

Each imported repository has one **Skills install link**, on the repository's page under [Repositories](/docs/repositories), for owners and admins. Its command installs into the repository every live skill one of its packages uses (linked to one of them, or available to all packages), with the [skills command line](https://skills.sh):

```bash
npx skills add https://app.architure.dev/k/<token>
```

Run it at the repository's root. Run it again to pick up the skills that changed in Architure, then commit the result as you would any other change.

- **Create install link** (or **New link** when the repository has one) makes a link and shows its command once, in **Install the skills in this repository**: copy it then. A new link revokes the previous one at once: update the scripts that used it.
- The card shows the link's start, when it was made and when it was last used.
- **Revoke** stops the link: the repository can no longer install or update its skills until you make a new link. Skills already installed stay.
- Removing a repository revokes its links too.

Anyone with the link can read those skills, without signing in: keep it in the repository's scripts or a secret, not in a public file.

The link serves the [Agent Skills discovery index](https://schemas.agentskills.io/discovery/0.2.0/schema.json) at `/k/<token>/.well-known/agent-skills/index.json`, which the `skills` command reads. Each skill is listed with its name, description and a SHA-256 digest, and served as its `SKILL.md` alone when it has no other file, or as `skill.zip`, its folder with `SKILL.md` at the root. A skill keeps its digest until its files change, so the command reinstalls only what changed. Responses are never cached; an unknown or revoked link answers `404`, and a link that makes more than about 120 requests a minute answers `429` until the minute passes.

## What agents read

Agents connected through the [MCP server](/docs/connect-your-agent) read the same skills, whatever the install links:

- `list_skills` lists them with their name, description, source and audit: with the agent's `repository` and `path`, the skills of the package that holds that folder (the same set its repository's install link serves for that package); without, every live skill of the organization.
- `get_skill` returns one skill's files by name, for the agent to follow or to write under `.agents/skills/<name>/`.
- `list_tech_stack` names, for each technology, the skills linked to it.

Archived skills and skills in the trash reach no agent. Agents never add or change skills. See [MCP tools](/docs/mcp-tools).

---

# Skill

> The architure skill teaches your agent how to work with your architecture in Architure; install it in Claude Code, Claude.ai, Cursor, Codex and other agents.

Source: https://docs.architure.dev/docs/skill

The MCP server gives your agent access to your organization's architecture. The `architure` skill gives it the method: a short set of instructions the agent loads when its task touches what Architure holds. It lives in the public repository `architure/skills`, in the folder `architure`, next to the plugin that bundles it with the MCP server for Claude Code.

This page is about that one skill. Your team's own skills, which agents read through Architure, are on the [Skills](/docs/skills) page.

## When it triggers

The agent loads the skill:

- before choosing a library, framework or service;
- when you work on a database schema, its tables, columns, enums, relationships or migrations in an application connected to Architure;
- when you ask it to read, extend, document or check that schema.

Its description also names the 15 [MCP tools](/docs/mcp-tools), so the agent reaches for it when it sees them.

## What it tells the agent

Architure is the source of truth for the stack and the schema: read the stack before choosing a library, read the schema before writing code against the database, and make schema changes in Architure rather than inventing names, types or enums in code. Then, in order:

1. **Find where you work.** Read the repository's GitHub remote (`git remote get-url origin`, which gives `owner/name`) and the folder it works in, from the repository's root (`apps/web`). Pass them as `repository` and `path` to `list_skills`, `list_environment_variables` and `list_databases`, which then answer for the package that holds that folder (see [Repositories](/docs/repositories)). `list_repositories` lists the imported repositories and their packages; when the repository is not there, leave `repository` out to get the whole organization.
2. **Read the tech stack.** Call `list_tech_stack` before choosing a library, framework or service. Prefer what it lists, at its version, and read the docs it links to before relying on memory. When nothing fits, say which technology it would add and why (see [Tech stack](/docs/tech-stack)).
3. **Follow the team's skills.** Call `list_skills` with the repository and folder, and read the ones that fit the task with `get_skill`. When you want one installed in the repository, write its files under `.agents/skills/<name>/` (see [Skills](/docs/skills)).
4. **Read the environment variable names.** Call `list_environment_variables` with the repository and folder before writing code that reads configuration, and use those names (`process.env.STRIPE_SECRET_KEY`), never invented ones. Architure never gives values: ask you for one when needed, and never write a value into a committed file (see [Environment variables](/docs/environment-variables)).
5. **Find the database.** Call `list_databases` with the repository and folder (the databases the package uses) and pick the one you work on, asking when several fit.
6. **Read before you write.** Call `get_database` for the whole schema in the [text format](/docs/text-format) and its revision. Use `get_table` for one table with its descriptions, `search_columns` to see how the organization already names and types a kind of column, and `list_column_definitions` for the shared enums and types.
7. **Write through the tools**, with the revision it read as `baseRevision`: `create_table` for a new table with its columns, foreign keys and single-column indexes; `update_column` for one column; `set_description` for a description in Markdown; `apply_operations` for everything else, after `get_database` with `includeIds`. Each write answers with the new revision, used for the next write.
8. **Check and fix.** Call `check_database` after writing. Fix every error (missing primary key, foreign key type mismatch, duplicate name, reserved word) and the warnings (foreign key without an index, column definition type unknown to the dialect) unless you decided otherwise, then check again.
9. **Describe what it created.** Every new table and column gets a short, factual description in Markdown: what it holds, its unit or format, who writes it, the rules around it.

Along the way, it follows these rules:

- **Information types.** Every column gets one of the seven [information types](/docs/information-types), chosen by why the column exists: a foreign key is `relationships`, `position` is `settings`, a soft-delete timestamp is `audit`. A column linked to a column definition takes the definition's type.
- **Column definitions.** Before creating a column with an enum or a shared type, it looks for an existing [column definition](/docs/column-definitions) and links the column to it instead of repeating the values. When none fits, it tells you which one to create: definitions are created in the app.
- **Conventions.** It follows the database's naming, gives every table a primary key, types and indexes foreign keys like the column they reference, writes types as the dialect writes them in DDL, and prefers the narrowest tool.
- **Addressing.** It names objects as `schema.table` and `schema.table.column` (`table` and `table.column` when the table name is unique), and sends the id when a name matches several objects.

## When a write is refused

The skill tells the agent what each refusal means and what to do:

| Refusal | Meaning | What the agent does |
| --- | --- | --- |
| `Conflict` | Someone changed the database since its `baseRevision`; the answer lists those changes | Calls `get_database` again, redoes its change on the current schema, retries with the new revision |
| `ValidationError` | An operation does not apply; the message names it (`operations.<index>`) and why (`not_found`, `already_exists`, `invalid_reference`, `invalid_row`, `invalid_operation`) | Fixes the input and retries |
| `PlanRequired` | The organization's trial is over or its subscription is not active | Tells you that an owner or admin restores writing from the billing settings; reading and `check_database` still work. Does not retry |
| `Forbidden` | The connection can only read: a read API key, a token without `schema:write`, or a viewer | Tells you. Does not retry |
| `NotFound` | The id is not in this organization | Calls `list_databases` again |

The full list of errors is on [MCP tools](/docs/mcp-tools#errors).

## Install

### Claude Code

The plugin installs the skill and the MCP server, which signs in with OAuth:

```bash
claude plugin marketplace add architure/skills
claude plugin install architure@architure
```

Then run `/mcp` in Claude Code, choose `architure` and sign in. If you connect with an API key instead, install the skill alone with the command below, so that the plugin does not add a second connection. See [Connect your agent](/docs/connect-your-agent#claude-code).

### Cursor, Codex and other agents

The `skills` command line installs the skill into the agents it finds on your machine:

```bash
npx skills add architure/skills
```

Then connect the MCP server: see [Connect your agent](/docs/connect-your-agent).

### Claude.ai

1. Download the `architure/skills` repository and make a ZIP file of its `architure` folder, so the ZIP's root is that folder.
2. Open **Customize**, then **Skills**, add a skill and upload the ZIP.
3. Turn the skill on. Skills need code execution to be enabled.

The skill's `SKILL.md` keeps to the keys Claude.ai accepts in an uploaded skill: `name`, `description` and `license`.

## Updating

- Claude Code: `claude plugin marketplace update architure`, or turn on auto-update for the marketplace in `/plugin`.
- Other agents: run `npx skills add architure/skills` again.
- Claude.ai: upload the new ZIP.

The skill is plain text you can read before installing: `SKILL.md` in the `architure` folder of the repository.

---

# MCP tools

> Every tool of the Architure MCP server, what it reads or writes, its inputs, what it answers and the permission it needs; then authentication, limits, errors and how objects are named.

Source: https://docs.architure.dev/docs/mcp-tools

The Architure MCP server is at `https://app.architure.dev/api/mcp` (Streamable HTTP; the server's name is `architure`). It has 15 tools: five read the workspace (repositories, tech stack, skills, environment variable names), six read databases, and four write databases. [Connect your agent](/docs/connect-your-agent) sets it up; the [skill](/docs/skill) tells the agent in which order to call the tools.

Every answer is text: JSON for most tools, Architure's [text format](/docs/text-format) for `get_database`. A refusal comes back as a tool error whose first word is its code (see [Errors](#errors)).

## The tools at a glance

| Tool | Group | Needs | What it answers |
| --- | --- | --- | --- |
| `list_repositories` | Workspace | read | The imported repositories (`owner/name`) and their packages |
| `list_tech_stack` | Workspace | read | The tech stack by category, with doc links, notes, linked variable names and skills |
| `list_skills` | Workspace | read | The skills of a package, or of the organization |
| `get_skill` | Workspace | read | One skill's files |
| `list_environment_variables` | Workspace | read | The variable names of a package, or of the organization; never a value |
| `list_databases` | Database | read | The databases of a package, or of the organization |
| `get_database` | Database | read | A database, or one schema, in the text format, with its revision |
| `get_table` | Database | read | One table in detail |
| `search_columns` | Database | read | Columns across the organization's databases |
| `list_column_definitions` | Database | read | The organization's column definitions |
| `check_database` | Database | read | The database's issues and how to fix them |
| `create_table` | Database write | write | Creates a table with its columns, foreign keys and indexes |
| `update_column` | Database write | write | Changes one column |
| `set_description` | Database write | write | Writes a description from Markdown |
| `apply_operations` | Database write | write | Applies raw operations, all or nothing |

**read** is any API key or an OAuth token with `schema:read`. **write** is a write API key, or an OAuth token with `schema:write` for an owner, admin or member of the organization. See [Authentication](#authentication).

## Telling the tools where you work

The organization's work is organized by [repositories](/docs/repositories) and their packages: the folders that run with their own environment, such as `apps/web` or `packages/email` (`.` for a repository without workspaces). Databases, skills and environment variables are each linked to packages or available to all packages.

`list_skills`, `list_environment_variables` and `list_databases` take two optional inputs that name the package:

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `repository` | string, 3 to 200 characters | no | The GitHub repository as `owner/name`, as `git remote get-url origin` shows it (case does not matter). Left out, the tool answers for the whole organization |
| `path` | string, up to 500 characters | no | The folder you work in, from the repository's root (`apps/web`, or a folder inside it). Read only with `repository`; left out, the repository's root package |

The answer is then for the package that holds the folder: the deepest package whose path is the folder or one of its parents, else the root package. It names that package first (`package`: `repository`, `path`, `name`). A repository the organization did not import, or a folder that no package holds (in a monorepo whose root is not a package), answers `NotFound`: call `list_repositories`, or leave `repository` out.

## Workspace reads

### list_repositories

The GitHub repositories the organization imported, each with its packages. Use it to check that your repository is there and which folder is a package.

**Inputs:** none.

**Answers:** `repositories`, each with `repository` (`owner/name`), `private`, `defaultBranch` and `packages` (`path`, `name` from its `package.json`).

**Needs:** read.

### list_tech_stack

The organization's [tech stack](/docs/tech-stack): its preferred technologies and libraries. Agents read it before choosing a library, framework or service, prefer what it lists and follow the docs it links to.

**Inputs:** none. The tech stack is the organization's, not a package's.

**Answers:** `categories`, the categories that have items in their fixed order, each with its `name` and `items` in the team's order: `id`, `name`, `version`, `docUrls`, `notes` (Markdown), `environmentVariables` (the names of the variables linked to the item) and `skills` (the names of the skills linked to it).

**Needs:** read.

### list_skills

The team's [skills](/docs/skills): folders with a `SKILL.md`, instructions the team wants agents to follow. Archived skills and skills in the trash are left out.

**Inputs:** `repository` and `path` (see [Telling the tools where you work](#telling-the-tools-where-you-work)).

**Answers:** `skills` (with `package` when `repository` is given): those linked to the package or available to all packages, else every live skill of the organization. Each has `name`, `description`, `source` (`skills_sh` or `custom`), `skillsShId` (the skills.sh id of a copy from skills.sh, else null), `audit` (each audit partner's `provider` and `status`, or `not audited`) and `files` (how many files it has).

**Needs:** read.

### get_skill

One skill's files, by name. The agent follows its instructions; to install it in a repository, it writes the files under `.agents/skills/<name>/` (or wherever the user's agent reads skills). A repository can also install every skill its packages use with its [install link](/docs/skills#install-link).

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `name` | string, 1 to 64 characters | yes | The skill's name, from `list_skills` |

**Answers:** `name`, `description`, `source` and `files`, each with its `path` (`SKILL.md` first at the root, then supporting files such as `references/api.md`) and `contents`. A name that is not a live skill answers `NotFound`.

**Needs:** read.

### list_environment_variables

The [environment variable](/docs/environment-variables) names the code reads, with their descriptions. Never the values: the agent uses the names in code (`process.env.STRIPE_SECRET_KEY`), asks the user for a value when it needs one, and never writes a value into a committed file.

**Inputs:** `repository` and `path` (see [Telling the tools where you work](#telling-the-tools-where-you-work)).

**Answers:**

- With `repository`: `package` and `environmentVariables`, the names that package resolves to, each with `name`, `description` and `scopes`: each scope that holds a value (`all`, `production`, `preview`, `development`) with its `source`, `package` (the variable is linked to the package, which wins) or `allPackages` (available to every package).
- Without: `environmentVariables`, every variable of the organization, with `name`, `description` (Markdown) and `scopes` (the scopes that hold a value).

An environment's own value overrides `all`.

**Needs:** read.

## Database reads

### list_databases

The [databases](/docs/databases), most recently changed first. Every database tool takes a `databaseId` from this list.

**Inputs:** `repository` and `path` (see [Telling the tools where you work](#telling-the-tools-where-you-work)).

**Answers:** `databases` (with `package` when `repository` is given): those the package uses (linked to it or available to all packages), else every database of the organization. Each has `id`, `name`, `dialect` (`postgresql` or `mysql`), `revision`, `updatedAt`, `schemas` (the names of its schemas, in the canvas's order) and `description` (Markdown). Archived databases and databases in the trash are left out.

**Needs:** read.

### get_database

One database in Architure's [text format](/docs/text-format) (DBML plus `type:` for information types, `use:` for column definitions, and table groups for areas), with its current revision: the `baseRevision` of the write tools.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database, from `list_databases` |
| `schema` | string | no | Only this schema, by name or id: its tables, the relationships between them and the areas that hold one. Relationships with other schemas' tables are counted, not shown. Default: the whole database |
| `includeIds` | boolean | no | Also list the id of every schema, table, column, relationship, index, area and column definition, for `apply_operations`. A definition marked `archived` is archived or in the trash: columns may not link to it anew |

**Answers:** a header (the database's name, id, dialect and revision; its schemas with their table counts; whether the connection may write, else why not: a read key or a viewer, or a plan that is not active), then the text format, then the ids when asked. An unknown schema is refused with the names there are.

**Needs:** read.

### get_table

One table in detail, as JSON. Use it for the descriptions, which the text format leaves out.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `table` | string | yes | `schema.table` (`public.orders`), `table` when the name is unique across schemas, or the table's id |

**Answers:** `revision` and `table`: `id`, `path`, `schema`, `name`, `description`, `area`, `primaryKey` (column names), `columns` (each with `id`, `name`, `position`, `dataType`, `enumValues`, `nullable`, `defaultValue`, `isPrimaryKey`, `isUnique`, `isAutoIncrement`, `informationType`, `columnDefinition` and `description`; a column linked to a column definition shows the definition's type, values, information type and description), `relationships` that start or end on the table (`id`, `name`, `kind`, `direction`, `from`, `to`, `cardinality`, `onDelete`, `onUpdate`, `description`) and `indexes` (`id`, `name`, `isUnique`, `columns`). Descriptions are Markdown.

**Needs:** read.

### search_columns

Finds columns across every live database of the organization, so the agent reuses the names and types already chosen (how is an email stored elsewhere? which columns use the `order_status` enum?). Filters combine.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `name` | string, up to 200 characters | no | Part of the column name, without case: `email` finds `email`, `billing_email`, `EmailVerified` |
| `dataType` | string, up to 200 characters | no | Part of the data type (`timestamp`, `varchar`, `uuid`). A linked column matches on its definition's type and name, so an enum definition's name finds the columns that use it |
| `informationType` | one of the seven [information types](/docs/information-types) | no | Only columns of this type (a linked column has its definition's) |
| `databaseId` | uuid | no | Only this database |
| `limit` | integer, 1 to 200 | no | The most results, 50 by default |

**Answers:** `count`, `truncated` (with a `note` when more columns match) and `columns`, each with `databaseId`, `databaseName`, `dialect`, `schemaName`, `tableId`, `tableName`, `columnId`, `columnName`, `path` (`schema.table.column`), `dataType`, `informationType`, `columnDefinition` (`id` and `name`, or null), `nullable`, `isPrimaryKey` and `isUnique`.

**Needs:** read.

### list_column_definitions

The organization's [column definitions](/docs/column-definitions): shared enums and column types. Agents link a column to a definition instead of repeating an enum's values.

**Inputs:** none.

**Answers:** `columnDefinitions` (archived ones and those in the trash left out), each with `id`, `name`, `dialect` (null: it works in PostgreSQL and MySQL), `dataType`, `enumValues`, `informationType`, `nullable`, `defaultValue` and `description` (Markdown). A column links only to a definition of its database's dialect or with `dialect` null, by name, or by id when two share a name.

**Needs:** read.

### check_database

Lints the database, as the canvas's [issues](/docs/issues) panel does. Agents call it after every change they write, fix the errors, and fix the warnings unless the user decided otherwise.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `severity` | `error`, `warning` or `info` | no | List only this severity. By default errors and warnings are listed and information issues are counted per rule |
| `limit` | integer, 1 to 1000 | no | List at most this many issues, errors first (100 by default) |
| `includeAll` | boolean | no | List every issue, without a limit |

**Answers:** `revision`; `summary` (the number of `errors`, `warnings` and `info`); `rules`, each rule found once with its `severity`, `title` and `fix`; `issues`, each with `rule`, `severity`, `message` and `target` (`kind`, `id`, `path`); `omitted`, how many were not listed; `infoByRule`, the information issues counted per rule with up to 10 example paths; and `next`, what to do about what was left out.

**Needs:** read.

## Database writes

Every write is one change of the database, with the agent as its author: the open canvas shows it within seconds. Each write tool takes `baseRevision` (see [Revisions and conflicts](#revisions-and-conflicts)) and answers with the new `revision` and `next`, a reminder to call `check_database`.

Writes are refused with `Forbidden` for a read key, a token without `schema:write` or a viewer, and with `PlanRequired` once the organization's trial is over or its subscription is not active.

### create_table

Creates a table with its columns in one change, placed on the canvas to the right of the existing tables, with its foreign keys and single-column indexes. Refused when the schema already has a table of that name.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `baseRevision` | integer | no | The revision the agent read; left out, the current one |
| `schema` | string | no | The schema's name or id. Default: `public`, or the database's only schema |
| `name` | string | yes | The table's name, following the database's naming |
| `description` | Markdown, up to 20,000 characters | no | What the table holds and why |
| `columns` | array, 1 to 500 | yes | The columns, in order (below) |

Each column:

| Field | Type | Required | What |
| --- | --- | --- | --- |
| `name` | string | yes | The column's name |
| `dataType` | string | no | The type as the dialect writes it in DDL (`uuid`, `varchar(255)`, `numeric(10,2)`, `timestamp with time zone`). Left out when `definition` is set |
| `definition` | string | no | A column definition's name or id: the column then reads its type, values, information type and description |
| `nullable` | boolean | no | Default: false for a primary key column, the definition's for a linked column, true otherwise |
| `defaultValue` | string or null | no | The SQL default as written in DDL (`now()`, `'draft'`) |
| `primaryKey` | boolean | no | Part of the primary key; several columns make a composite key |
| `unique` | boolean | no | Values must be unique |
| `autoIncrement` | boolean | no | Filled by a sequence or identity |
| `informationType` | one of the seven information types | no | What the column holds |
| `references` | string | no | Makes the column a foreign key to `schema.table.column`, `table.column` or a column id (the new table's own columns too). Many-to-one, or one-to-one when the column is unique or the only primary key column; named `<table>_<column>_fkey` |
| `onDelete` | `no_action`, `restrict`, `cascade`, `set_null` or `set_default` | no | The foreign key's ON DELETE action |
| `index` | boolean | no | An index on this column alone; set it on foreign keys that do not start the primary key, or `check_database` warns |
| `description` | Markdown | no | What the column holds, its unit or format |

**Answers:** `revision`, `table` (`id`, `path`, and `columns`: each column's name with its id), `relationships` (the names of the foreign keys created) and `next`.

**Needs:** write.

### update_column

Changes one existing column. Send only the fields that change. To add, delete or reorder columns, or to change relationships and indexes, use `apply_operations`.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `baseRevision` | integer | no | The revision the agent read |
| `column` | string | yes | `schema.table.column` (`public.orders.status`), `table.column`, or the column's id |
| `changes` | object | yes | At least one of the fields below |

`changes` takes `name` (renames the column, which keeps its identity), `dataType` (unlinks a linked column), `definition` (links the column to a definition by name or id; null unlinks it and keeps the definition's type as the column's own; not together with `dataType`), `nullable`, `defaultValue` (null removes it), `primaryKey`, `unique`, `autoIncrement`, `informationType` (null clears it) and `description` (Markdown; null or empty clears it).

**Answers:** `revision`, `column` (`id` and `path`), a `note` when the description was set on a linked column (readers show the definition's description), and `next`.

**Needs:** write.

### set_description

Writes the description of the database, a schema, a table, a column or a relationship from Markdown, replacing the whole description. It is stored as sanitized rich text and shown in the canvas's editor.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `baseRevision` | integer | no | The revision the agent read |
| `kind` | `database`, `schema`, `table`, `column` or `relationship` | yes | What to describe |
| `target` | string | for all but `database` | A schema name, `schema.table`, `schema.table.column`, a relationship's constraint name, or any id |
| `markdown` | string or null, up to 20,000 characters | yes | Paragraphs, `##` and `###` headings, bold, italic, code, links, lists and fenced code blocks are kept; other markup is dropped. Null or empty clears it |

**Answers:** `revision`, `described` (`kind` and `path`), a `note` for a column linked to a definition, and `next`.

**Needs:** write.

### apply_operations

The general write tool, for what the other three do not cover: adding, deleting or reordering columns; relationships, indexes, areas and schemas; moves and deletes. The operations apply in order, all or nothing, as the canvas applies its edits.

| Input | Type | Required | What |
| --- | --- | --- | --- |
| `databaseId` | uuid | yes | The database |
| `baseRevision` | integer | yes | The revision the operations were written against |
| `operations` | array, 1 to 1000 | yes | Operations, each discriminated by `type` |

The operation types are `database.update`; `schema.create`, `schema.update`, `schema.delete`; `table.create`, `table.update`, `table.move`, `table.delete`; `column.create`, `column.update`, `column.reorder`, `column.delete`; `relationship.create`, `relationship.update`, `relationship.delete`; `area.create`, `area.update`, `area.move`, `area.delete`; `index.create`, `index.update`, `index.delete`; and `database.import`.

- A create carries the whole row with a new id the agent makes (a uuid, v7 preferred). An update carries `id` and only the changed fields in `changes`. A delete carries `id` and cascades as the database does: deleting a table removes its columns, indexes and relationships.
- Ids come from `get_database` with `includeIds`, or from `get_table`.
- Descriptions inside operations are `descriptionHtml`, sanitized on the server; `set_description`, which takes Markdown, is simpler.

**Answers:** `revision` and `next`. An operation that does not apply is a `ValidationError` naming it.

**Needs:** write.

## Addressing objects

Tools name objects by path:

| Object | Path | Example |
| --- | --- | --- |
| Schema | its name | `public` |
| Table | `schema.table`, or `table` when the name is unique across schemas | `public.orders` |
| Column | `schema.table.column`, or `table.column` when the table name is unique | `public.orders.status` |
| Relationship | its constraint name | `orders_customer_id_fkey` |
| Column definition | its name | `order_status` |

Exact names match first, then names without case. Ids (uuids) work everywhere a path does. A name that matches several objects (a duplicate, or names that differ only in case) is refused with their paths and ids, never resolved to the first: the agent sends the id.

## Revisions and conflicts

Each database has a revision, a counter that moves with every change. `get_database`, `get_table`, `check_database` and every write answer with it. A write names the revision it was based on (`baseRevision`; required by `apply_operations`, the revision just read when the other write tools get none).

When the database has moved past it, someone else (the canvas, another agent) changed it in between: nothing is written and the answer is a `Conflict` with the current revision and the changes since, with their operations in full while they fit in about 20 KB (an import shown by its counts), else outlined by operation types and target ids. The agent reads the database again, redoes its change on the current schema and retries with the new revision.

## Authentication

Every request carries a bearer token: `Authorization: Bearer <token>`. A request without one, or with one the server refuses, answers `401` with a `WWW-Authenticate` header that points at the server's OAuth metadata (`resource_metadata`, at `/.well-known/oauth-protected-resource/api/mcp`) and asks for the scopes `schema:read schema:write`, so an agent that supports OAuth starts the sign-in by itself.

### API keys

An organization API key starts with `architure_`. An owner or admin creates it on **Agents** with the permission **Read** or **Read and write** (see [Create an API key](/docs/connect-your-agent#create-an-api-key)).

- **Read** calls every read tool. The write tools answer `Forbidden`: an owner or admin creates a write key.
- **Read and write** calls every tool.

A key acts for the organization; its changes are signed with the agent's name and the key's name. It is never challenged for a scope.

### OAuth

Any other bearer token is an OAuth access token, issued after the user signs in and chooses the organization on the consent page. Its scopes are `schema:read` and `schema:write`, limited by the user's role, which is read again on every call: an owner, admin or member writes with `schema:write`; a viewer only reads, whatever the scopes; a user who left the organization is refused.

A write tool called with a token that lacks `schema:write` answers `403` with an `insufficient_scope` challenge asking for `schema:read schema:write`, so the agent can ask the user to sign in again with write access. A viewer's token that has the scope gets `Forbidden` from the tool instead.

## Rate limit

An API key may make 600 requests a minute. Past it the server answers `429` with `Retry-After: 60`. One MCP request counts once, whatever the tools do inside it.

## Errors

A refused call comes back as a tool error whose first word is its code, then the reason and what to do. Before any tool runs, the HTTP layer may answer `401`, `403`, `429` or `500` instead.

| Code | When | What the agent does |
| --- | --- | --- |
| `Conflict` | The database moved past `baseRevision`; the answer lists the changes since | Read the database again, redo the change, retry with the new revision |
| `ValidationError` | An input or an operation does not apply; `operations.<index>` names the operation, and the message starts with `not_found`, `already_exists`, `invalid_reference`, `invalid_row` or `invalid_operation` | Fix the input and retry |
| `PlanRequired` | A write while the organization's trial is over or its subscription is not active | Tell the user: an owner or admin restores writing in the billing settings. Reads still work. Do not retry |
| `Forbidden` | A write with a read key, a token without `schema:write` or a viewer's connection | Tell the user. Do not retry |
| `NotFound` | No database with that id, no live skill of that name, a repository the organization did not import, or a folder no package holds | Call `list_databases`, `list_skills` or `list_repositories` again |
| `401 Unauthorized` | No token, an unknown, revoked or expired one, or a token without an organization | Sign in again, or check the key |
| `429` | The API key passed 600 requests in a minute | Wait for `Retry-After` |

A path that matches nothing, or several objects, is refused with a message that says which (and lists the candidates' ids), and nothing is written.

---

# Issues reference

> Every rule the issues panel and the MCP tool check_database report, with its severity and how to fix it.

Source: https://docs.architure.dev/docs/issues

Architure checks each [database](/docs/databases) as you edit it on the [canvas](/docs/canvas). The canvas shows the result in the **Issues** tab of its sidebar, and agents get the same list from `check_database`, with how to fix each issue. Errors come first, then warnings, then information.

| Rule                                                                  | Severity    | Reports                                       |
| --------------------------------------------------------------------- | ----------- | --------------------------------------------- |
| [`missing_primary_key`](#missing_primary_key)                         | Error       | Missing primary key                           |
| [`foreign_key_type_mismatch`](#foreign_key_type_mismatch)             | Error       | Foreign key type differs from its target      |
| [`duplicate_name`](#duplicate_name)                                   | Error       | Duplicate name                                |
| [`reserved_word`](#reserved_word)                                     | Error       | Reserved word                                 |
| [`foreign_key_without_index`](#foreign_key_without_index)             | Warning     | Foreign key without an index                  |
| [`unknown_data_type`](#unknown_data_type)                             | Warning     | Column definition type unknown to the dialect |
| [`missing_information_type`](#missing_information_type)               | Information | Missing information type                      |
| [`table_relationship_not_detailed`](#table_relationship_not_detailed) | Information | Table relationship not detailed               |

Each issue names its object as `schema.table.column`; in the canvas, choosing it selects the object. Rule ids never change: agents and scripts can rely on them.

## Errors

### missing_primary_key

**Error**: Missing primary key. Every table needs a primary key: mark one column, or several for a composite key.

Mark the column that identifies a row as primary key, usually `id`. For a link table, mark both foreign key columns: together they form a composite key.

### foreign_key_type_mismatch

**Error**: Foreign key type differs from its target. A column relationship joins two columns of different data types (arguments such as a length are ignored).

Give both columns the same type. The check compares canonical names, so `int4` and `integer` match, a `serial` key matches an `integer` reference, and lengths such as `varchar(20)` against `varchar(40)` are not reported. Arrays must match too.

### duplicate_name

**Error**: Duplicate name. Two schemas of the database, two tables of a schema or two columns of a table share a name (without case in MySQL).

Rename one of the two. PostgreSQL compares names with their case (`Users` and `users` are different); MySQL ignores case. A duplicate is reported rather than refused, so an import or a paste never fails on it.

### reserved_word

**Error**: Reserved word. A schema, table or column is named with a word the dialect reserves, so every query must quote it.

Rename the object, for example `user` to `app_user` or `order` to `purchase_order`. The words come from the reserved words of PostgreSQL 17 and MySQL 8.4.

## Warnings

### foreign_key_without_index

**Warning**: Foreign key without an index. No index (and not the primary key) starts with the columns of a foreign key, so joins and deletes on the referenced table scan this one.

Add an index whose first columns are the foreign key's columns, in any order (in the [text view](/docs/text-format#indexes), or ask your agent). A foreign key whose columns start the primary key (as in a link table) needs no extra index. The columns of a composite foreign key are checked together.

### unknown_data_type

**Warning**: Column definition type unknown to the dialect. A column definition used in the database has a data type the database's dialect does not know, or is defined for another dialect.

Change the [column definition](/docs/column-definitions)'s type to one the dialect knows, or use a definition made for this dialect (or portable). Enum definitions are fine: their type is their own name.

## Information

### missing_information_type

**Information**: Missing information type. A column has no information type, so the diagram cannot colour it and agents cannot tell what it holds.

Choose one of the seven [information types](/docs/information-types). A column linked to a column definition takes the definition's type.

### table_relationship_not_detailed

**Information**: Table relationship not detailed. A relationship drawn between two tables is not yet detailed into the columns that implement it.

Select the dashed relationship, choose its **Referencing column** and **Referenced column**, then **Detail into columns**. A many-to-many relationship is detailed with a link table that holds a foreign key to each side.

---

# Billing and trial

> One plan billed per seat, a free trial without a card, and what stays available when the trial ends.

Source: https://docs.architure.dev/docs/billing

Architure has one plan for every team, and it covers the whole product: the tech stack, repositories and packages, databases with their canvas, connections and schema sync, skills and install links, environment variables, deployments to Vercel, and the MCP server with the `architure` skill. Billing belongs to the organization, and only its owners and admins manage it, in **Settings**, **Billing**.

| Plan            | Team                                                                          |
| --------------- | ----------------------------------------------------------------------------- |
| Billed          | Per seat, monthly or yearly                                                   |
| Monthly         | $15 / month                                                                   |
| Yearly          | $144 / year                                                                   |
| Free trial      | 14 days, no card needed                                                       |
| After the trial | Read-only until the organization pays: databases stay readable and exportable |

## What the plan includes

- Tech stack with versions, official docs and notes
- GitHub repositories and their packages, through the GitHub App
- Database canvas for PostgreSQL and MySQL: import, information types, column definitions, issues, export
- Database connections and the schema sync
- Skills from skills.sh or your own, with an install link per repository
- Environment variables, encrypted per scope and per package
- Vercel deployments: Sync pushes each package's variables after a reviewed diff
- MCP server and the architure skill, with API keys and OAuth

## Seats

The plan is billed per seat, and every member of the organization is one seat, whatever their role. Checkout bills the number of members at that moment. When a member joins, leaves or is removed, the number of seats follows, prorated; during the trial nothing is charged. Agents are not seats: API keys and OAuth connections cost nothing more.

## The free trial

- You start the trial right after you create your organization (the second step of setting it up), or later from **Settings**, **Billing**. You confirm it on one Stripe Checkout screen, and no card is needed.
- It lasts 14 days, with every feature. A banner above the organization's pages counts the days left.
- Each organization gets one trial, and so does each person: when the owner or admin who starts the plan already owns or administers another organization that had a trial, the plan starts paid. Teammates you invite as members or viewers keep their own trial for an organization of their own.
- To keep the plan after the trial, an owner or admin adds a payment method before the trial ends, with **Manage billing in Stripe** in **Settings**, **Billing**. Owners and admins receive an email three days before the trial ends, and another when it has ended.

Until a trial or a subscription runs, the organization is read-only. That is the case when you choose **Skip for now** while setting up the organization.

## When the trial ends without payment

The organization becomes read-only. Nothing is deleted, and everything stays readable:

- every page of the organization opens: databases and their canvas, column definitions, the tech stack, repositories and their packages, skills, environment variables (members and up can still reveal a value) and deployments;
- agents keep every MCP read tool, `check_database` included;
- install links keep serving the skills to `npx skills add`;
- databases still export to SQL, DBML and images.

Every write is refused until the organization pays: changes on the canvas and in its text view, the schema sync, creating, editing, archiving or deleting any resource, connecting GitHub or Vercel and importing, creating or revoking an install link, **Sync** to Vercel, saving a draft, and the MCP write tools (with the error `PlanRequired`). The banner above the organization's pages says the trial has ended, and the canvas shows **Read-only: plan required**.

An owner or admin subscribes from **Settings**, **Billing** (or the banner's **Subscribe**) to restore writes as soon as Stripe confirms the plan.

## The Billing page

**Settings**, **Billing** shows the plan's status (**Free trial**, **Active**, **Payment failed**, **Ended** and others), when the trial ends or the plan renews, the billing interval and the number of seats. Owners and admins open the Stripe billing portal with **Manage billing in Stripe** to change the payment method, see invoices, switch between monthly and yearly, or cancel. Other members see the status and are told who manages it.

## Payment problems

An organization can write while its subscription is `trialing`, `active`, `past_due`. When a payment fails (`past_due`), writes keep working while Stripe retries the card, and the banner asks an owner or admin to update the payment method.
