@@ -204,15 +204,6 @@ python3 -m pip install --upgrade "state-trace[mcp]"
204204state-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-
216207Environment 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
222213Tools 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
229223python3 -m pip install --upgrade " state-trace[mcp]"
230224cd /path/to/your/repo
231225state-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
233231python3 -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
253251Restart 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] "
259257codex 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]"
272280claude 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
278303claude 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
283313Open 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
287337Any 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
295350Use ` 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