nteract
raw JSON → 2.3.1 verified Sat May 09 auth: no python
nteract provides an MCP (Model Context Protocol) server that brings AI agents into Jupyter notebooks. It allows LLMs like Claude, ChatGPT, Gemini, and OpenCode to execute code, read outputs, and interact with notebook environments. Version 2.3.1 requires Python >=3.10. Release cadence is irregular, with recent updates focused on MCP protocol support.
pip install nteract Common errors
error ModuleNotFoundError: No module named 'nteract.mcp_server' ↓
cause An older version of nteract (<2.0.0) is installed, or the package is not installed.
fix
Upgrade nteract: pip install --upgrade nteract (requires Python >=3.10).
error OSError: [Errno 98] Address already in use ↓
cause The default port 8000 is occupied by another process.
fix
Kill the process using port 8000, or set environment variable MCP_PORT to a different port.
error RuntimeError: API key not configured ↓
cause The required environment variable (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY) is not set.
fix
Export the appropriate API key before running the server: export ANTHROPIC_API_KEY='your-key'
Warnings
breaking nteract v2.x drops support for Python <3.10. Upgrade your Python environment. ↓
fix Ensure Python >=3.10 is installed before upgrading.
deprecated The old nteract 'kernel' and 'comm' modules (from v1.x) are removed. Use nteract.mcp_server for AI integration. ↓
fix Replace imports like 'from nteract.kernel import ...' with 'from nteract.mcp_server import ...'.
gotcha The MCP server requires environment variables for API keys (e.g., ANTHROPIC_API_KEY, OPENAI_API_KEY). Failing to set them causes silent hangs. ↓
fix Set the required API key before calling run_server().
gotcha By default, the server binds to localhost:8000. If that port is in use, the startup will fail with an address-in-use error. ↓
fix Pass a custom port via the MCP_PORT environment variable or modify the server configuration.
Imports
- mcp_server wrong
from nteract import servercorrectimport nteract.mcp_server
Quickstart
import os
from nteract.mcp_server import run_server
# Ensure API key is set in environment
api_key = os.environ.get('ANTHROPIC_API_KEY', '')
if not api_key:
print("Please set ANTHROPIC_API_KEY environment variable")
else:
run_server()