Skip to content

Commit 89d35d2

Browse files
ianhiclaude
andcommitted
Add report_issue tests and update tool counts in docs
- Add 45 tests covering input coercion, JSONL safety (special chars, injection attempts, tracebacks), file I/O, rotation, and validation - Update tool count from 53/54 to 55 in CLAUDE.md, README.md, and docs - Add report_issue to CLAUDE.md tool table - Add report_issue section to collaboration docs page Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 34422fb commit 89d35d2

File tree

6 files changed

+600
-6
lines changed

6 files changed

+600
-6
lines changed

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A TypeScript MCP server that connects to JupyterLab's real-time collaboration sy
1515
```
1616
src/
1717
├── index.ts # Thin MCP server entry point (dispatches to handlers)
18-
├── handlers/ # All 54 tool handlers, organized by category
18+
├── handlers/ # All 55 tool handlers, organized by category
1919
│ ├── connection.ts # connect_jupyter, list_files, list_notebooks, list_kernels, open/create/rename_notebook
2020
│ ├── cell-read.ts # get_notebook_content, get_notebook_outline, search_notebook, replace_in_notebook
2121
│ ├── cell-write.ts # insert_cell, update_cell, delete_cell(s), change_cell_type, copy/move_cells, batch ops
@@ -24,7 +24,7 @@ src/
2424
│ ├── kernel-lsp.ts # kernel status/variables/interrupt/restart, diagnostics, hover_info, rename_symbol, diff/rename_notebook
2525
│ └── collab.ts # get_user_focus, cell history, notebook changes, recover_cell, snapshots, locks
2626
├── connection.ts # JupyterLab connection state, config, session management, kernel execution
27-
├── schemas.ts # Tool schema definitions (all 53 tools)
27+
├── schemas.ts # Tool schema definitions (all 55 tools)
2828
├── tool-helpers.ts # Shared handler patterns (getNotebookCells, resolveIndexParam, etc.)
2929
├── helpers.ts # Shared utilities (cell extraction, diffing, output formatting)
3030
├── notebook-fs.ts # Filesystem backend (read/write .ipynb without JupyterLab)
@@ -93,6 +93,7 @@ src/
9393
| `lock_cells` | Acquire advisory locks on cells |
9494
| `unlock_cells` | Release advisory locks |
9595
| `list_locks` | List active cell locks |
96+
| `report_issue` | Submit a feedback report (persisted to JSONL) |
9697

9798
### Cell IDs (Stable Addressing)
9899

README.md

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Claude Code ←—stdio—→ MCP Server ←—y-websocket—→ JupyterLab
1111
Claude Code can already edit files, but notebooks are special — they have cells, kernels, outputs, and a live browser UI. This MCP server bridges the gap:
1212

1313
- **Real-time sync** — edits appear instantly in JupyterLab via y-websocket
14-
- **53 tools** — read, edit, execute, search, diff, tag, lock, snapshot, and more
14+
- **55 tools** — read, edit, execute, search, diff, tag, lock, snapshot, and more
1515
- **Cell ID addressing** — stable references that survive insertions and deletions
1616
- **Multi-agent ready** — cell locking, change tracking, and per-agent attribution
1717
- **Context-efficient** — filter by cell type, skip outputs, limit images
@@ -73,6 +73,52 @@ The docs site has detailed tool reference pages, parameter tables, examples, and
7373

7474
See also [datalayer/jupyter-mcp-server](https://github.com/datalayer/jupyter-mcp-server) — a Python-based alternative with Streamable HTTP transport and streaming execution. See the [comparison page](https://ianhi.github.io/jupyterlab-collab-mcp/comparison/) for detailed differences.
7575

76+
## Development
77+
78+
### Setup
79+
80+
```bash
81+
git clone https://github.com/ianhi/jupyterlab-collab-mcp.git
82+
cd jupyterlab-collab-mcp
83+
npm install
84+
```
85+
86+
### Dev workflow
87+
88+
Point the MCP server at your local build and run the TypeScript compiler in watch mode:
89+
90+
```bash
91+
claude mcp add -s user jupyter -- node $PWD/dist/index.js
92+
npm run build # initial build
93+
npm run watch # recompile on file changes (run in a separate terminal)
94+
```
95+
96+
After each recompile, run `/mcp` in Claude Code to reconnect to the updated server. No need to remove and re-add the MCP config.
97+
98+
> **Why not `tsx --watch`?** MCP servers are long-running stdio processes. `tsx --watch` detects the server as "completed" and kills it, breaking the connection.
99+
100+
### Build + test
101+
102+
```bash
103+
npm run build # compile TypeScript to dist/
104+
npm run watch # same, but recompile on changes
105+
npm test # run unit tests (vitest)
106+
npm run test:watch # run tests in watch mode
107+
```
108+
109+
### Integration testing
110+
111+
Requires a running JupyterLab with `jupyter-collaboration`:
112+
113+
```bash
114+
jlabx # start JupyterLab (or jupyter lab)
115+
JUPYTER_TOKEN=<token> npm run test:integration # run src/test.ts against it
116+
```
117+
118+
### After changing tool schemas
119+
120+
If you add/remove tools or change their parameters, run `/mcp` in Claude Code to reconnect. The server caches tool definitions at startup, so a reconnect is needed for schema changes to take effect.
121+
76122
## License
77123

78124
BSD-3-Clause

docs/src/content/docs/comparison.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ get_user_focus(path) → { focusedCell: 3, cursorPosition: 42 }
5959

6060
Cell locking, change tracking, named snapshots, and per-agent attribution make it safe to run multiple agents on the same notebook. See the [Multi-Agent Guide](../agents/multi-agent/).
6161

62-
### 53 tools
62+
### 55 tools
6363

6464
Comprehensive coverage: batch operations, cross-notebook copy/move, cell ID addressing, metadata/tags, diagnostics, symbol rename, and more.
6565

docs/src/content/docs/tools/collaboration.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,25 @@ Shows which cells were added, deleted, modified, or unchanged. Modified cells in
185185

186186
---
187187

188+
## Issue reporting
189+
190+
### report_issue
191+
192+
Submit a feedback report about a tool bug, hang, missing feature, or general observation. Reports are persisted to a JSONL file (`~/.jupyter-mcp-reports.jsonl`) for developer review.
193+
194+
| Parameter | Type | Required | Description |
195+
|-----------|------|----------|-------------|
196+
| `category` | string | Yes | One of: `tool_bug`, `hang`, `missing_feature`, `observation`, `user_feedback` |
197+
| `summary` | string | Yes | One-line description |
198+
| `tool_name` | string | No | Which MCP tool was involved |
199+
| `path` | string | No | Notebook path |
200+
| `details` | string | No | Error messages or reproduction steps |
201+
202+
**Notes:**
203+
- All inputs are defensively coerced to strings and truncated (summary: 500 chars, details: 2000 chars) to keep writes atomic
204+
- The reports file is automatically rotated when it exceeds 1MB
205+
- Safe for concurrent writes from multiple agents (uses `O_APPEND`)
206+
207+
---
208+
188209
**See also:** [Metadata & tags](../metadata/), [Kernel & analysis tools](../kernel/)

docs/src/content/docs/tools/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
title: Tool Overview
3-
description: All 54 MCP tools organized by category.
3+
description: All 55 MCP tools organized by category.
44
---
55

6-
The MCP server provides 54 tools for working with Jupyter notebooks. Tools are organized into categories below — click through for full parameter documentation and examples.
6+
The MCP server provides 55 tools for working with Jupyter notebooks. Tools are organized into categories below — click through for full parameter documentation and examples.
77

88
## Categories
99

0 commit comments

Comments
 (0)