MCP server for editing Jupyter notebooks
Project description
Notebook MCP Server
v0.1.0
Jupyter 노트북(.ipynb) 파일을 편집할 수 있는 MCP(Model Context Protocol) 서버입니다.
설치
git clone https://github.com/CuriousN006/notebook-mcp-server.git
cd notebook-mcp-server
pip install -e .
또는 uv 사용 시:
cd notebook-mcp-server
uv pip install -e .
사용법
직접 실행
python -m notebook_mcp.server
Antigravity/VS Code에 등록
MCP 설정 파일에 다음을 추가하세요:
{
"mcpServers": {
"notebook-editor": {
"command": "python",
"args": ["-m", "notebook_mcp.server"],
"env": {
"PYTHONPATH": "/path/to/notebook-mcp-server/src"
}
}
}
}
제공 도구
| 도구명 | 설명 |
|---|---|
read_notebook |
노트북 전체 구조 읽기 |
read_cell |
특정 셀 내용 읽기 |
read_cell_output |
셀 출력 상세 조회 (이미지 포함 - LLM이 직접 볼 수 있음!) |
add_cell |
새 셀 추가 |
update_cell |
셀 내용 수정 |
delete_cell |
셀 삭제 |
move_cell |
셀 위치 이동 |
duplicate_cell |
셀을 복제하여 바로 아래에 삽입 |
change_cell_type |
셀 타입 변경 (code ↔ markdown) |
get_cell_context |
특정 셀과 주변 셀들의 컨텍스트를 JSON으로 반환 |
get_notebook_variables |
노트북의 import, 변수, 함수, 클래스 추출 |
search_notebook |
노트북 전체에서 텍스트 검색 (정규식 지원) |
replace_in_notebook |
노트북 전체에서 텍스트 일괄 교체 (미리보기 지원) |
update_notebook_metadata |
노트북 메타데이터 수정 |
update_cell_metadata |
셀 메타데이터 수정 |
💡 이미지 출력 지원:
read_cell_output은 matplotlib 그래프 등 이미지 출력을 MCPImageContent로 반환합니다. LLM이 그래프를 직접 보고 분석할 수 있습니다! (지원 형식: PNG, JPEG, GIF, WebP)
AI 시스템 프롬프트 (권장)
AI 어시스턴트가 이 MCP 서버를 올바르게 사용하도록 다음 내용을 시스템 프롬프트에 추가하세요:
- .ipynb 형식 노트북 파일은 `notebook-editor` MCP 서버를 통해 직접 수정합니다.
- 노트북 경로는 반드시 절대 경로로 지정하세요 (예: `/path/to/notebook.ipynb`)
- ⚠️ **주의사항**: 노트북 수정 전에 VS Code에서 해당 파일이 **저장된 상태**인지 확인하세요.
- 셀 실행 후 저장하지 않은 상태에서 MCP로 수정하면, VS Code가 덮어써서 수정이 유실될 수 있습니다.
- 수정 요청 시 사용자에게 "파일을 저장(Ctrl+S)했는지" 먼저 확인해주세요.
라이선스
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file notebook_mcp_server-0.1.0.tar.gz.
File metadata
- Download URL: notebook_mcp_server-0.1.0.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e9e97c61813728a851fb30aa124f93641bda24669ac9d9822e59164dbea905b
|
|
| MD5 |
fe26a033c729d5c0d454baeb6a176201
|
|
| BLAKE2b-256 |
5849a37b9354ca6ce1e3ddbdd3834e3cc47cd025afd1633975633e70c03c4b28
|
File details
Details for the file notebook_mcp_server-0.1.0-py3-none-any.whl.
File metadata
- Download URL: notebook_mcp_server-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67a91c3035a8c48eb2b407cab238055c92f7f6f62bebff91dcf90bda9f4c3dde
|
|
| MD5 |
ffa1d06a7057b68598b23a563bbb14ea
|
|
| BLAKE2b-256 |
5896b15a3ce6626fd4567d4e8d0a592e5bbd3b22a0b489ef6b2c1c11be554aed
|