# Stratum MCP server

> Provides a 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
- Transport: stdio
- Stars: 2
- Latest version: 0.7.3

## Install

### Claude Code

```sh
claude mcp add stratum -- npx -y @smartmemory/stratum
```

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

```json
{
  "mcpServers": {
    "stratum": {
      "command": "npx",
      "args": [
        "-y",
        "@smartmemory/stratum"
      ]
    }
  }
}
```

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

```json
{
  "servers": {
    "stratum": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@smartmemory/stratum"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"stratum","type":"stdio","command":"npx","args":["-y","@smartmemory/stratum"]}'
```

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

```json
{
  "mcpServers": {
    "stratum": {
      "command": "npx",
      "args": [
        "-y",
        "@smartmemory/stratum"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add stratum -- npx -y @smartmemory/stratum
```

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

```toml
[mcp_servers.stratum]
command = "npx"
args = ["-y", "@smartmemory/stratum"]
```

### Gemini CLI

```sh
gemini mcp add -s user stratum npx -- -y @smartmemory/stratum
```

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

```json
{
  "mcpServers": {
    "stratum": {
      "command": "npx",
      "args": [
        "-y",
        "@smartmemory/stratum"
      ]
    }
  }
}
```

## 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 used for?

Stratum acts as an execution kernel for AI coding agents, providing a formal model with state tracking, postconditions, and auditable traces.

### Can Stratum handle human intervention in a workflow?

Yes, it uses 'Gate' steps that pause execution to wait for an external decision such as approve, revise, or kill.

### Does Stratum support Python?

The Python library and Python MCP server have been retired; the TypeScript engine is currently the only engine.
