Skip to content

Connect agents with MCP

xtralab runs a Model Context Protocol (MCP) server inside JupyterLab, from jupyter-server-mcp. An agent that connects to it can run JupyterLab commands: for example, open files, run notebook cells, and read notebooks.

The xtralab plugin registers the MCP server with Claude Code and installs the agent skills.

  1. Install uv. The plugin starts the MCP proxy with uvx.

  2. Add the marketplace and install the plugin:

    Terminal window
    claude plugin marketplace add jtpio/xtralab
    claude plugin install xtralab@xtralab
  3. Start xtralab, then start a new Claude Code session in the same folder. The agent loads the jupyter server when the session starts.

The proxy connects to the xtralab server whose folder contains the folder of the session. It does not connect to a server of another project, so agent sessions in different projects do not interfere with each other.

xtralab runs in Start the agent in
A browser tab An xtralab terminal, or a different terminal in the project folder or under it
The desktop app An xtralab terminal

To connect from a folder outside the project on purpose, set the URL of the MCP server before you start the agent. The MCP server has its own port, not the port of the JupyterLab URL. xtralab list shows it on the MCP line of the project folder:

Terminal window
JUPYTER_SERVER_MCP_URL=http://localhost:56978/mcp claude

Use this procedure for the other agents, or when uv is not installed.

  1. Open a terminal in xtralab.

  2. Run the command for your agent:

    Terminal window
    claude mcp add jupyter -- jupyter-server-mcp-proxy
  3. Start a new agent session. The agent loads the jupyter server when the session starts.

Register the server one time for each agent. The registration continues to work after JupyterLab restarts.

The launcher shows the same commands for the installed agents, with a Copy button.

Goose, OpenCode, Kiro, Mistral Vibe, and Antigravity do not have an mcp add command. Add a stdio MCP server to the configuration of the agent, with the command jupyter-server-mcp-proxy. See the jupyter-server-mcp README for other clients.

Tool Description
list_all_commands Lists the JupyterLab commands, with an optional query
execute_command Runs a JupyterLab command with arguments

The tools come from jupyterlab-commands-toolkit. The guided-code-walkthrough skill uses them to drive the app.