Feature: Allow hooks to invoke MCP tools (or add post-init hook phase)

Resolved 💬 3 comments Opened Feb 16, 2026 by jakespencer6596-debug Closed Feb 20, 2026

Problem

SessionStart hooks can only execute Bash commands. MCP tools (like mcp__claude-in-chrome__*) are only available during live conversation turns — they're Claude tool calls, not shell commands or binaries.

There is no bridge between the two. This means it's impossible to automate any MCP-dependent setup on session start.

Real-world example

I run OpenClaw, an AI assistant with a web dashboard at http://127.0.0.1:18789/. I want the dashboard to auto-open in the MCP tab group (via Claude-in-Chrome) when a Claude Code session starts.

What I've tried (all fail):

  • SessionStart Bash hook → Can open Chrome, but only as a regular tab. No access to MCP tab group.
  • CLAUDE.md instructions → Claude reads them and can open the dashboard via MCP tools, but only after the first user message. Not automatic.
  • /start skill → Works, but requires manual invocation every session.

The dashboard opens correctly when MCP tools are explicitly invoked mid-conversation. The problem is there's no way to trigger MCP tool calls before or at the start of a session without user interaction.

Proposed Solutions (any one would work)

Option A: MCP hook type

Allow hooks to specify type: "mcp" alongside the existing type: "command", enabling MCP tool calls as hook actions:

{
  "hooks": {
    "SessionStart": [{
      "type": "mcp",
      "server": "claude-in-chrome",
      "tool": "navigate",
      "params": { "url": "http://127.0.0.1:18789/" }
    }]
  }
}

Option B: Post-init conversation phase

Add a hook phase that fires after MCP servers are connected but before the user's first message — allowing Claude to execute a startup prompt that has full tool access.

Option C: Auto-execute first-turn instructions

Allow CLAUDE.md or settings to specify a "startup prompt" that Claude executes automatically (with full tool access) before waiting for user input. Something like:

{
  "hooks": {
    "SessionStart": [{
      "type": "prompt",
      "message": "Open the dashboard in the MCP tab group"
    }]
  }
}

Why this matters

MCP tools are powerful but currently sandboxed to reactive use only. Any workflow that depends on MCP for session setup requires manual intervention every time, which defeats the purpose of automation. This limitation affects anyone using MCP servers (browser automation, database connections, external service setup) who wants repeatable session initialization.

Environment

  • Claude Code (CLI)
  • Windows 11 + Git Bash
  • MCP server: Claude-in-Chrome
  • Claude Opus 4.6

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗