Metadata-Version: 2.4
Name: notebook-mcp
Version: 0.1.0
Summary: MCP server that provides notebook-aware context and analysis for .ipynb files
License-Expression: MIT
Project-URL: Homepage, https://github.com/your-org/notebook-mcp
Project-URL: Repository, https://github.com/your-org/notebook-mcp
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mcp>=1.0.0
Requires-Dist: nbformat>=5.10.4
Requires-Dist: pydantic>=2.7.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: networkx>=3.3
Requires-Dist: websockets>=12.0
Provides-Extra: dev
Requires-Dist: pytest>=8.2.0; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Requires-Dist: build>=1.2.1; extra == "dev"
Requires-Dist: twine>=5.1.0; extra == "dev"
Dynamic: license-file

# notebook-mcp

MCP server that provides notebook-aware context and analysis for `.ipynb` files.

## Features

- Offline notebook analysis (no kernel required)
  - Strip outputs (optional)
  - Stable cell indexing
  - AST-based `defines` / `uses`
  - Best-effort dependency graph
  - Focused context slicing for a target cell
  - Export notebook to a deterministic Python script (best-effort)

- Optional Jupyter Server adapter (HTTP)
  - List active sessions
  - Inspect kernel metadata

## Install (dev)

```bash
python -m pip install -e ".[dev]"
```

## Distribution

### Publish Python package (PyPI)

1. Build:

```bash
python -m pip install -e ".[dev]"
python -m build
```

2. Upload:

```bash
python -m twine upload dist/*
```

### Publish NPM wrapper

The Node wrapper lives in `npm/` and publishes as a scoped package.

```bash
cd npm
npm publish --access public
```

## Run (stdio transport; best for IDE agents)

```bash
notebook-mcp
```

## Run (streamable HTTP transport)

```bash
set MCP_TRANSPORT=streamable-http
set MCP_HOST=127.0.0.1
set MCP_PORT=8000
notebook-mcp
```

## Jupyter Server adapter

Set env vars:

- `JUPYTER_BASE_URL` e.g. `http://127.0.0.1:8888`
- `JUPYTER_TOKEN` (if required)

## Notes

- Dependency graph and stale detection are best-effort offline. Truthful execution/runtime state requires kernel messaging.
