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

# MCP reference

> The Charter Model Context Protocol tools and their request contracts.

Start Charter as a stdio MCP server:

```sh theme={null}
charter mcp --principal codex
```

The server supports `initialize`, `ping`, `tools/list`, and `tools/call`, and advertises four tools. Tool failures are returned as MCP tool results with `isError: true` so an agent can reason about the message. If `.charter/config.yaml` lists `principals`, the server refuses to start for a `--principal` not on the list.

## `decision_check`

Returns accepted Decisions matching one or both inputs.

```json theme={null}
{"paths":["internal/store/repository.go"],"diff":"optional unified diff"}
```

At least one of `paths` or `diff` is required. Paths are matched against scope globs; the diff also supplies paths from diff headers and enables scope-tag matching.

## `decision_search`

```json theme={null}
{"query":"persistent storage"}
```

`query` is required. Results rank non-rejected Decisions by case-insensitive term occurrence; title matches receive extra weight.

## `decision_propose`

```json theme={null}
{
  "title": "Use PostgreSQL for persistent storage",
  "context": "Transactional writes are required.",
  "decision": "Use PostgreSQL for application data.",
  "consequences": "Operate migrations and backups.",
  "alternatives": "SQLite was not selected for production.",
  "scope_paths": ["internal/store/**"],
  "scope_tags": ["storage"],
  "supersedes": "0001",
  "enforcement": "advisory"
}
```

`title`, `context`, and `decision` are required. `enforcement` accepts `blocking`, `advisory`, or `off`; when omitted it defaults to `config.yaml`'s `enforcement_default`, else `advisory`. The server stamps the connection principal and current date, writes a proposed Decision, regenerates the index, and records a `proposed` event in the audit log. It never accepts the proposal.

## `decision_list`

```json theme={null}
{"status":"accepted"}
```

`status` is optional and must be one of `proposed`, `accepted`, `rejected`, or `superseded` when present.

## Agent response guidance

When `decision_check` returns matches, cite their IDs and state how the work honors them. When no Decision applies but an architectural choice is needed, call `decision_search`, then `decision_propose` if the repository has no applicable precedent.


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