Bug
All five prompt functions in prompts.py return list[dict] (e.g., [{"role": "user", "content": "..."}]), but fastmcp >= 3.x requires each item in the list to be a Message object or str.
Version: code-review-graph 2.3.3, fastmcp 3.3.1
Error
Calling any MCP prompt (e.g., architecture_map) throws:
McpError: MCP error 0: Error rendering prompt 'architecture_map':
messages[0] must be Message or str, got dict.
Use Message({'role': 'user', 'content': '...'}) to wrap the value.
The error originates from fastmcp/prompts/base.py line ~310, where the _resolve method iterates the returned list and only accepts Message or str instances.
Root Cause
prompts.py returns plain dicts:
def architecture_map_prompt() -> list[dict]:
return [
{
"role": "user",
"content": "...",
}
]
This worked with older fastmcp versions that accepted raw dicts, but fastmcp 3.x tightened the contract.
Fix
Import Message from fastmcp and wrap each dict:
from fastmcp.prompts import Message
def architecture_map_prompt() -> list[Message]:
return [
Message("...", role="user")
]
Same change needed for all five functions: review_changes_prompt, architecture_map_prompt, debug_issue_prompt, onboard_developer_prompt, pre_merge_check_prompt — plus the corresponding wrapper functions in main.py.
Bug
All five prompt functions in
prompts.pyreturnlist[dict](e.g.,[{"role": "user", "content": "..."}]), butfastmcp>= 3.x requires each item in the list to be aMessageobject orstr.Version: code-review-graph 2.3.3, fastmcp 3.3.1
Error
Calling any MCP prompt (e.g.,
architecture_map) throws:The error originates from
fastmcp/prompts/base.pyline ~310, where the_resolvemethod iterates the returned list and only acceptsMessageorstrinstances.Root Cause
prompts.pyreturns plain dicts:This worked with older fastmcp versions that accepted raw dicts, but fastmcp 3.x tightened the contract.
Fix
Import
Messagefrom fastmcp and wrap each dict:Same change needed for all five functions:
review_changes_prompt,architecture_map_prompt,debug_issue_prompt,onboard_developer_prompt,pre_merge_check_prompt— plus the corresponding wrapper functions inmain.py.