Skip to content

[Bug] onboard_developer MCP prompt fails: messages[0] must be Message or str, got dict #499

@janepark1248

Description

@janepark1248

Bug Report

Version: 2.3.3
Environment: macOS, Claude Code CLI

Description

Running the /code-review-graph:onboard_developer slash command in Claude Code fails with the following error:

McpError: MCP error 0: Error rendering prompt 'onboard_developer': messages[0] must be Message or str, got dict.
Use Message({'role': 'user', 'content': '...'}) to wrap the value.

Steps to Reproduce

  1. Install code-review-graph 2.3.3
  2. Open Claude Code with the MCP server configured
  3. Run /code-review-graph:onboard_developer
  4. Error is thrown immediately

Root Cause (suspected)

The onboard_developer prompt handler appears to return a raw dict instead of a Message object (or str). The MCP protocol requires prompt handlers to return a Message object or string, not a plain dict.

The error message itself suggests the fix:

# Current (broken)
return {'role': 'user', 'content': '...'}

# Expected fix
return Message({'role': 'user', 'content': '...'})

Impact

The onboard_developer slash command is completely unusable. Other MCP tools (e.g. semantic_search_nodes, get_architecture_overview, detect_changes) work fine via direct tool calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions