Skip to content

Commit 8037ba4

Browse files
docs: clarify codex mcp install syntax
1 parent f7e1b44 commit 8037ba4

2 files changed

Lines changed: 87 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to `state-trace` are documented here. The format roughly fol
44

55
## [Unreleased]
66

7+
### Changed
8+
9+
- Clarified MCP install docs to mirror Geometra's per-client syntax, with explicit Codex project-level, global, and uninstall commands.
10+
711
## [0.3.3] — 2026-04-25
812

913
### Added

README.md

Lines changed: 83 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,6 @@ python3 -m pip install --upgrade "state-trace[mcp]"
204204
state-trace-mcp
205205
```
206206

207-
For project-scoped MCP installs, generate a local `.mcp.json` from the installed package. The generated config uses an absolute `state-trace-mcp` path so clients with a minimal PATH can still start it.
208-
209-
```bash
210-
cd /path/to/your/repo
211-
state-trace-mcp-config --namespace "$(basename "$PWD")" > .mcp.json
212-
# If your shell cannot find the console script:
213-
python3 -m state_trace.mcp_config --namespace "$(basename "$PWD")" > .mcp.json
214-
```
215-
216207
Environment config:
217208

218209
- `STATE_TRACE_STORAGE_PATH` — durable path; `.db`/`.sqlite` uses the SQLite backend. Default: `~/.state-trace/memory.db`.
@@ -221,19 +212,26 @@ Environment config:
221212

222213
Tools exposed: `store`, `retrieve`, `retrieve_brief`, `record_action`, `record_observation`, `record_test_result`, `ingest_agent_log_file`, `current_state`, `failed_hypotheses`, `list_namespaces`, `graph_snapshot`.
223214

224-
### OpenAI Codex
215+
### Install
216+
217+
<details>
218+
<summary>OpenAI Codex</summary>
225219

226-
Recommended per-repo install:
220+
**Project-level install (recommended, one repo at a time):**
227221

228222
```bash
229223
python3 -m pip install --upgrade "state-trace[mcp]"
230224
cd /path/to/your/repo
231225
state-trace-mcp-config --namespace "$(basename "$PWD")" > .mcp.json
232-
# If your shell cannot find the console script:
226+
```
227+
228+
If your shell cannot find `state-trace-mcp-config`:
229+
230+
```bash
233231
python3 -m state_trace.mcp_config --namespace "$(basename "$PWD")" > .mcp.json
234232
```
235233

236-
Manual project-level `.mcp.json`:
234+
Or manually add to `.mcp.json` in the repo:
237235

238236
```json
239237
{
@@ -252,48 +250,109 @@ Manual project-level `.mcp.json`:
252250

253251
Restart Codex after adding or changing `.mcp.json`.
254252

255-
Codex also supports global MCP config:
253+
**Global install:**
256254

257255
```bash
258-
STATE_TRACE_MCP="$(python3 -c 'from state_trace.mcp_config import resolve_entrypoint; print(resolve_entrypoint())')"
256+
python3 -m pip install --upgrade "state-trace[mcp]"
259257
codex mcp add state-trace \
260258
--env STATE_TRACE_NAMESPACE=repo-x \
261-
--env STATE_TRACE_STORAGE_PATH=/Users/me/.state-trace/repo-x.db \
262-
-- "$STATE_TRACE_MCP"
259+
--env STATE_TRACE_STORAGE_PATH="$HOME/.state-trace/repo-x.db" \
260+
-- "$(python3 -c 'from state_trace.mcp_config import resolve_entrypoint; print(resolve_entrypoint())')"
263261
```
264262

265-
Use the project `.mcp.json` path when you want state-trace mounted one repo at a time.
263+
**Uninstall:**
266264

267-
### Claude Code
265+
```bash
266+
codex mcp remove state-trace
267+
```
268268

269-
Project-level `.mcp.json` is the same as Codex. For a global install:
269+
For project-level installs, remove the `state-trace` entry from `.mcp.json`.
270+
271+
</details>
272+
273+
<details>
274+
<summary>Claude Code</summary>
275+
276+
**One-line install:**
270277

271278
```bash
279+
python3 -m pip install --upgrade "state-trace[mcp]"
272280
claude mcp add state-trace -- state-trace-mcp
273281
```
274282

275-
To uninstall:
283+
Or manually add to `.mcp.json` (project-level) or `~/.claude/settings.json` (global):
284+
285+
```json
286+
{
287+
"mcpServers": {
288+
"state-trace": {
289+
"command": "/absolute/path/to/state-trace-mcp",
290+
"env": {
291+
"STATE_TRACE_STORAGE_PATH": "/Users/me/.state-trace/repo-x.db",
292+
"STATE_TRACE_NAMESPACE": "repo-x",
293+
"STATE_TRACE_CAPACITY_LIMIT": "256"
294+
}
295+
}
296+
}
297+
}
298+
```
299+
300+
**Uninstall:**
276301

277302
```bash
278303
claude mcp remove state-trace
279304
```
280305

281-
### Cursor
306+
To uninstall manually, remove the `state-trace` entry from the config file.
307+
308+
</details>
309+
310+
<details>
311+
<summary>Cursor</summary>
282312

283313
Open Settings → MCP → Add new MCP server, or add the same `mcpServers.state-trace` entry to `.cursor/mcp.json`.
284314

285-
### Other MCP clients
315+
```json
316+
{
317+
"mcpServers": {
318+
"state-trace": {
319+
"command": "/absolute/path/to/state-trace-mcp",
320+
"env": {
321+
"STATE_TRACE_STORAGE_PATH": "/Users/me/.state-trace/repo-x.db",
322+
"STATE_TRACE_NAMESPACE": "repo-x",
323+
"STATE_TRACE_CAPACITY_LIMIT": "256"
324+
}
325+
}
326+
}
327+
}
328+
```
329+
330+
To uninstall, remove the entry from MCP settings.
331+
332+
</details>
333+
334+
<details>
335+
<summary>Other MCP clients</summary>
286336

287337
Any MCP client that supports stdio transport can run:
288338

289339
```json
290340
{
291-
"command": "/absolute/path/to/state-trace-mcp"
341+
"command": "/absolute/path/to/state-trace-mcp",
342+
"env": {
343+
"STATE_TRACE_STORAGE_PATH": "/Users/me/.state-trace/repo-x.db",
344+
"STATE_TRACE_NAMESPACE": "repo-x",
345+
"STATE_TRACE_CAPACITY_LIMIT": "256"
346+
}
292347
}
293348
```
294349

295350
Use `python3 -m state_trace.mcp_config` to print a complete config with storage, namespace, and capacity env vars.
296351

352+
To uninstall, remove the server entry from your client's MCP configuration.
353+
354+
</details>
355+
297356
## Online agent loop
298357

299358
```python

0 commit comments

Comments
 (0)