Connection & server

connect_to_jupyter

Connect to a Jupyter server dynamically with URL and token.

Connect to a Jupyter server dynamically with URL and token.

This tool allows you to connect to different Jupyter servers without needing to restart the MCP server or modify configuration files. Particularly useful when:

  • Working with multiple Jupyter servers with different ports/tokens
  • Jupyter server token changes dynamically
  • Need to switch between different Jupyter instances

Example usage:

destructive: yes · idempotent: yes · open-world: no

Parameters

ParameterTypeRequiredDefaultDescription
jupyter_urlstringyesJupyter server URL to connect to (e.g., 'http://localhost:8888')
jupyter_tokenstring | nullnonullJupyter server authentication token
document_providerstringno"jupyter"Which backend holds the notebook documents

Output

{
  "properties": {
    "kind": {
      "description": "What this result is — 'cell.read', 'notebooks.list' and so on. Lets a client tell one answer from another without matching prose.",
      "title": "Kind",
      "type": "string"
    },
    "result": {
      "default": null,
      "description": "The answer itself: a message, the rows of a listing, or the outputs of an execution in order.",
      "title": "Result"
    }
  },
  "required": [
    "kind"
  ],
  "type": "object",
  "additionalProperties": true,
  "description": "What every tool of this server answers with.\n\nDeclared so the shape is *advertised* rather than merely produced. A tool\nthat returns structure without saying what it will return leaves a client\nnothing to validate against and the generated reference nothing to show —\nthe call works and the contract is invisible, which is the worst of both.\n\nExtra fields are allowed on purpose. A tool that already answers with a\nmapping keeps its own keys (see :func:`_default_shape`), and those are the\ninteresting part of its answer; forbidding them would mean either\nflattening every tool into one shape or declaring nothing at all.",
  "title": "ToolAnswer"
}

Call it

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "connect_to_jupyter",
    "arguments": {
      "jupyter_url": "<jupyter_url>",
      "jupyter_token": null,
      "document_provider": "jupyter"
    }
  }
}
result = await session.call_tool("connect_to_jupyter", arguments={"jupyter_url": "<jupyter_url>", "jupyter_token": None, "document_provider": "jupyter"})

Source

Registered by the @mcp.tool decorator on connect_to_jupyter in jupyter_mcp_server/server.py.