Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions jupyter_mcp_server/jupyter_extension/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,23 +168,25 @@ async def post(self):
search_query = ",".join(allowed_jupyter_tools)
logger.info(f"Searching jupyter-mcp-tools with query: '{search_query}' (allowed_tools: {allowed_jupyter_tools})")

# Query for notebook-related tools with broader search term
# Query for notebook-related tools with shorter timeout
# Note: jupyter-mcp-tools requires JupyterLab frontend to load and register tools via WebSocket
jupyter_tools_data = await get_tools(
base_url=base_url,
token=token,
query=search_query,
enabled_only=False
enabled_only=False,
wait_timeout=5 # Shorter timeout - if frontend isn't loaded, don't wait long
)
logger.info(f"Query returned {len(jupyter_tools_data)} tools")

# Use the tools directly since query should return only what we want
for tool in jupyter_tools_data:
logger.info(f"Found tool: {tool.get('id', '')}")
except Exception as e:
logger.warning(f"Failed to load jupyter-mcp-tools: {e}")
logger.warning(f"Failed to load jupyter-mcp-tools (this is normal if JupyterLab frontend is not loaded): {e}")
jupyter_tools_data = []

logger.info(f"Successfully loaded {len(jupyter_tools_data)} specific jupyter-mcp-tools")
logger.info(f"Successfully loaded {len(jupyter_tools_data)} specific jupyter-mcp-tools (requires JupyterLab frontend)")
else:
# JupyterLab mode disabled, don't load any jupyter-mcp-tools
jupyter_tools_data = []
Expand Down
Loading