# Stratum MCP server

> Provides a formal state machine execution model for AI agents to enforce typed contracts, postconditions, and human-in-the-loop gates.

- Repository: https://github.com/smartmemory/stratum
- Page: https://hostedmcp.org/servers/smartmemory/stratum-mcp
- Transport: stdio
- Stars: 2
- Latest version: 0.2.42

## Install

### Claude Code

```sh
claude mcp add stratum-mcp -- uvx stratum-mcp
```

### Cursor (`~/.cursor/mcp.json`)

```json
{
  "mcpServers": {
    "stratum-mcp": {
      "command": "uvx",
      "args": [
        "stratum-mcp"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "stratum-mcp": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "stratum-mcp"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"stratum-mcp","type":"stdio","command":"uvx","args":["stratum-mcp"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "stratum-mcp": {
      "command": "uvx",
      "args": [
        "stratum-mcp"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add stratum-mcp -- uvx stratum-mcp
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.stratum-mcp]
command = "uvx"
args = ["stratum-mcp"]
```

### Gemini CLI

```sh
gemini mcp add -s user stratum-mcp uvx -- stratum-mcp
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "stratum-mcp": {
      "command": "uvx",
      "args": [
        "stratum-mcp"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `SMARTMEMORY_API_KEY` | no | no |  |
| `SMARTMEMORY_API_URL` | no | no |  |
| `SMARTMEMORY_EXTRA_MEMORY_TYPES` | no | no |  |
| `SMARTMEMORY_WORKSPACE_ID` | no | no |  |
| `STRATUM_LEARN_EGRESS` | no | no |  |

## Tools (13)

- `spec`
- `flow`
- `inputs`
- `flow_id`
- `retries_remaining`
- `step_id`
- `result`
- `trace`
- `child_audits`
- `total_duration_ms`
- `outcome`
- `rationale`
- `resolved_by`

## FAQ

### What is Stratum?

Stratum is a state machine dispatch server for AI agent workflows that provides a formal execution model including contracts, postconditions, and gates.

### Can Stratum be used with agents other than Claude?

Yes, Stratum runs as an MCP server and library under Claude Code, Codex, or any MCP host.
