pi-web icon indicating copy to clipboard operation
pi-web copied to clipboard

bug: 当我使用pi-mcp-adapter时报错"MCP not initialized"

Open monkeycode-ai opened this issue 5 months ago • 1 comments

Describe the bug

When using pi-mcp-adapter with pi-web, it errors with "MCP not initialized".

To Reproduce

  1. Start a new pi-web session with pi-mcp-adapter extension installed
  2. Trigger a tool call or command that depends on the MCP adapter
  3. Observe the error: "MCP not initialized"

Expected behavior

pi-mcp-adapter should initialize correctly when a session starts.

Root Cause

pi-web's AgentSessionWrapper only called extensionRunner.setUIContext() during session creation, but never invoked AgentSession.bindExtensions(). Since createAgentSession() does not auto-emit session_start, extensions that rely on the session_start event (like pi-mcp-adapter) never initialized.

Fix

Fixed in https://github.com/lclichen/pi-web/pull/2 by dispatching session_start to the extension runtime after session creation.

monkeycode-ai avatar Jul 01 '26 04:07 monkeycode-ai

#104

agegr avatar Jul 02 '26 07:07 agegr