Skip to content

Commit 11d71fe

Browse files
feat(mcp): add $history variable and structured response format (nushell#17132)
<img width="1582" height="686" alt="image" src="https://github.com/user-attachments/assets/538326ec-7ec8-45c0-a59f-f170ea88f5f8" /> - Add `$history` variable that stores all previous command outputs - Access by index: `$history.0`, `$history.1`, etc. - Wrap all responses in structured record with: - `history_index`: 0-based index of result in history - `cwd`: current working directory after command - `output`: command output (possibly truncated) - Truncate large outputs (>10k chars by default) and reference history - Configurable threshold via `NU_MCP_OUTPUT_TRUNCATE` env var - Remove moka caching (incompatible with history tracking) - Update instructions.md with history documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.5 <[email protected]>
1 parent bfc594e commit 11d71fe

File tree

6 files changed

+405
-96
lines changed

6 files changed

+405
-96
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/nu-mcp/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
2424
bytes = { workspace = true }
2525
indoc = "2.0.6"
2626
nuon = { path = "../nuon", version = "0.109.2" }
27+
chrono = { workspace = true }
2728

2829
[features]
2930
default = []

0 commit comments

Comments
 (0)