From d4164593c879cf81ff1f0eff02f30de40da2b3aa Mon Sep 17 00:00:00 2001 From: Erik Gaasedelen Date: Wed, 29 Jul 2026 09:20:58 -0700 Subject: [PATCH] fixes #21 Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01HEzsvsrhD291xoipP6X9KC --- clikernel/base.py | 3 ++- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clikernel/base.py b/clikernel/base.py index 0d92df7..fab4a90 100644 --- a/clikernel/base.py +++ b/clikernel/base.py @@ -223,7 +223,8 @@ def _shutdown(signum, frame): async def _serve(w, name, docs, instructions=None, eager=False): - from mcp.server.fastmcp import FastMCP + try: from mcp.server.mcpserver import MCPServer as FastMCP # mcp>=2 renamed FastMCP + except ImportError: from mcp.server.fastmcp import FastMCP # mcp 1.x # When `eager`, start the worker before building the server so its banner (including startup output) is # forwarded as the `instructions` field -- read once, at initialize; a later restart won't refresh what the # client sees. Otherwise the worker stays unlaunched until first use and `instructions` is the static text. diff --git a/pyproject.toml b/pyproject.toml index 68b7199..e4a0b2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "ipython>=9.15.0", "execnb>=0.2.9", "fastcore", - "mcp", + "mcp>=1.2", ] [project.optional-dependencies]