vscode-notebook-mcp
vscode-notebook-mcp
VS Codeエディタ内のJupyterノートブックをMCP互換のAIエージェント(Claude Codeなど)に公開するVS Code拡張機能です。エージェントは、VS Codeが使用しているのと同じカーネルに対して、セルの読み取り、編集、実行を行います。
ステータス: プレアルファ版、個人開発プロジェクト。ゼロから構築されており、フォークではありません。
ツール (12)
探索
ツール | 説明 |
| URI、ファイル名、セル数、アクティブなノートブックを含む、開いているすべてのノートブックを一覧表示 |
| インデックス、種類、言語、プレビュー、実行状態を含むセルを一覧表示 |
| セルの完全なソース |
| セルの出力(テキスト、エラー、base64形式の画像) |
セル操作
ツール | 説明 |
| 任意の場所にコードセルまたはマークダウンセルを挿入。オプションで実行可能 |
| 既存のセルの内容を置換 |
| インデックスを指定してセルを削除 |
実行
ツール | 説明 |
| 既存のコードセルを実行し、出力を返す |
| 1つのセルの出力をクリア |
| すべてのセルの出力をクリア |
カーネル
ツール | 説明 |
| 言語、ステータス、ノートブックURI |
|
|
すべてのツールは、オプションの notebook_uri(省略時はアクティブなノートブックエディタを使用)および response_format("markdown" または "json")を受け付けます。
Related MCP server: lsp-mcp
セットアップ
まだインストールしていない場合は、VS Codeに Jupyter拡張機能 をインストールしてください。
この拡張機能をビルドして実行します:
npm install npm run build次に、このフォルダをVS Codeで開き、F5キーを押して、拡張機能が読み込まれた「拡張機能開発ホスト」を起動します。
MCPクライアントの設定に追加します:
{ "mcpServers": { "notebook": { "url": "http://127.0.0.1:49777/mcp" } } }拡張機能開発ホストで
.ipynbファイルを開きます。ステータスバーにある🪐 :49777インジケーターを確認してください。
設定
設定 | デフォルト | 説明 |
|
| 優先ポート。使用中の場合は自動的にインクリメントされます(最大+99)。 |
コマンド
Notebook MCP: Restart ServerNotebook MCP: Show Server Info
アーキテクチャ
┌─────────────────────────────────────────────────────────┐
│ VS Code window │
│ │
│ ┌───────────────────────────────────────────────────┐ │
│ │ Jupyter extension (ms-toolsai.jupyter) │ │
│ │ │ │
│ │ Notebook document ◄──► Kernel ──► Outputs │ │
│ └───────────────────────────────────────────────────┘ │
│ ▲ │
│ │ vscode.NotebookEdit, │
│ │ notebook.cell.execute, │
│ │ jupyter.kernels.getKernel │
│ │ │
│ ┌───────────────────────┴───────────────────────────┐ │
│ │ This extension │ │
│ │ │ │
│ │ HTTP server :49777 ──► MCP tools (12) │ │
│ │ (StreamableHTTPServerTransport) │ │
│ └───────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────┘
│ HTTP (MCP protocol)
▼
┌───────────────────────────────┐
│ AI agent │
│ (Claude Code, Cursor, etc.) │
└───────────────────────────────┘実装上の注意
書き込みは
vscode.NotebookEdit+vscode.WorkspaceEditを経由し、元に戻す/やり直しを保持します。実行は
notebook.cell.executeをディスパッチし、cell.executionSummary.successがboolean値になるまでポーリングして待機します(VS Codeは実行開始直後にサマリーを作成しますが、successはカーネルが終了したときにのみbooleanになります)。挿入されたセルにはメタデータIDがタグ付けされるため、他の同時編集によってインデックスがずれた後でも、エグゼキューターがそれらを再検索できます。
マルチノートブック: すべてのツールが
notebook_uriを受け付けます。解決方法:明示的なURI →vscode.workspace.notebookDocuments内で検索(または開く)。それ以外の場合はvscode.window.activeNotebookEditorにフォールバックします。
開発
npm install
npm run build # esbuild bundle
npm run watch # rebuild on change
npm run typecheck # tsc --noEmit
npm test # vitest (no tests yet)VS Codeで F5 を押して、拡張機能開発ホストを起動します。
参考文献
このプロジェクトと同様の他のプロジェクト:
datalayer/jupyter-mcp-server — HTTP/WebSocket経由で実行中のJupyterサーバーと通信するMCPサーバー。
olavocarvalho/vscode-runtime-notebook-mcp — このプロジェクトと同様のアーキテクチャ(VS Code Notebook API + 埋め込みHTTP MCPサーバー)。
私は学習のためにこれをゼロから構築しました。そのため、設計を微調整し、新しい機能を開発する余地があります。
ライセンス
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Read and write your Fresh Jots notes from Claude, Cursor, and any MCP client.
System-of-record notebook for AI coding agents: pages, datastores, tasks, skills over MCP.
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read, edit, execute cells, and capture outputs from Jupyter notebooks directly within VS Code or Cursor via the Model Context Protocol.6 npm16MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with VS Code's language server protocol features (definitions, references, diagnostics) and debugger (breakpoints, stepping, variable inspection) via an MCP server.9 npm1MIT
- AlicenseNot gradedqualityAmaintenanceVS Code extension that bridges local Jupyter Notebooks with AI Agents via MCP, enabling direct control of the active notebook tab.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables external agents to run, edit, create, and manage the Jupyter notebook the user is actively editing in VS Code, headlessly and without approval dialogs. Works with any MCP client and is Jupyter-optional for document operations.1MIT