Files
fn_registry/bash/functions/infra/write_mcp_jupyter_config.md
T
egutierrez fd5787c55f chore: auto-commit (43 archivos)
- .mcp.json
- bash/functions/infra/write_mcp_jupyter_config.md
- bash/functions/infra/write_mcp_jupyter_config.sh
- cpp/CMakeLists.txt
- cpp/apps/chart_demo
- cpp/apps/shaders_lab
- cpp/functions/gfx/gl_framebuffer.cpp
- cpp/functions/gfx/gl_framebuffer.h
- cpp/functions/gfx/gl_framebuffer.md
- cpp/functions/gfx/mesh_gpu.md
- ...

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 17:28:47 +02:00

3.1 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path
write_mcp_jupyter_config function bash infra 1.1.0 impure write_mcp_jupyter_config([project_dir: string], [port: int]) -> string Genera o actualiza .mcp.json con la config de jupyter-mcp-server apuntando al console-script del venv local (transport stdio + flags --jupyter-url/--jupyter-token). Merge con jq reemplazando la entrada jupyter entera.
mcp
jupyter
config
setup
infra
notebook
false error_go_core
name desc
project_dir directorio del proyecto Jupyter (default: directorio actual)
name desc
port puerto Jupyter (default: detectado automáticamente)
ruta del archivo .mcp.json generado o actualizado false
bash/functions/infra/write_mcp_jupyter_config.sh

Ejemplo

source write_mcp_jupyter_config.sh
path=$(write_mcp_jupyter_config /home/lucas/fn_registry/analysis/finanzas 8890)
echo "Config MCP en: $path"
# Genera .mcp.json con:
#   "command": ".../.venv/bin/jupyter-mcp-server"
#   "args": ["--transport","stdio","--jupyter-url","http://localhost:8890","--jupyter-token",""]

Cuando usarla

  • Al crear un analysis Jupyter nuevo (la usa el pipeline init_jupyter_analysis).
  • Tras mover/recrear un venv y necesitar regenerar el .mcp.json del analysis.
  • Para reparar un .mcp.json con el comando viejo roto (python -m jupyter_mcp_server.server).

Gotchas

  • NUNCA python -m jupyter_mcp_server.serverserver.py no tiene bloque __main__; el proceso importa y sale 0 y el MCP nunca arranca. El entrypoint real es la CLI (jupyter_mcp_server.CLI:server), expuesta como console-script jupyter-mcp-server. Sin subcomando arranca en stdio por defecto.
  • No usa env vars SERVER_URL/TOKEN. La CLI lee flags --jupyter-url / --jupyter-token (cubren document + runtime). Configs viejas con bloque env quedan inertes.
  • Tolera Jupyter apagado al boot: el MCP responde initialize tras un connect-timeout (~10s) y sirve igual. Arrancar Jupyter despues en :port y los tools se enganchan. No hace falta reiniciar Claude por tener Jupyter caido al inicio.
  • Requiere jupyter-mcp-server instalado en el venv: uv pip install jupyter-mcp-server. La funcion aborta si el console-script no existe.
  • Path atado al venv del analysis: si borras el analysis, ese .mcp.json apunta a un binario inexistente. Para un MCP jupyter global e independiente, el .mcp.json raiz de fn_registry usa el binario del venv canonico python/.venv/bin/jupyter-mcp-server (sobrevive el borrado de cualquier analysis).
  • Merge con jq usa + (shallow) en el mapa de servidores para reemplazar la entrada jupyter entera; * (deep) dejaba keys huerfanas de configs viejas.

Capability growth log

  • v1.1.0 (2026-05-28) — fix comando roto: console-script jupyter-mcp-server + flags stdio en vez de python -m ...server + env vars. Merge + para reemplazar entrada entera. Tag notebook.