-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi @admk! First, thank you for creating sembr and making it accessible via MCP Server - this is a very useful tool for applying semantic line breaks programmatically.
Issue Description
I've been testing the MCP server integration with both Zed Editor and Claude Desktop, and I've discovered that neither client currently supports the structured_content field introduced in the MCP spec version 6/18/2025. Both clients only display the content field, which means clients only see the summary message ("Performed semantic line breaks to N lines") rather than the actual wrapped text.
Current Behaviour
The tool correctly returns both fields as per the FastMCP specification:
content: Contains the human-readable summarystructured_content: Contains the actual wrapped text in theoutputfield
However, since most MCP clients haven't yet implemented support for structured_content, the wrapped text remains inaccessible to users.
Proposed Solution
According to the MCP specification, tools that return structured content should follow this guidance:
"For backwards compatibility, a tool that returns structured content SHOULD also return functionally equivalent unstructured content. (For example, serialized JSON can be returned in a TextContent block.)"
Could you update the tool to include the wrapped text in the content field alongside the summary? This would make it compliant with the MCP specification's backward compatibility recommendation.
For example:
# Current code:
return ToolResult(
content=[TextContent(type="text", text=readable)],
structured_content={"success": True, "output": wrapped_text})
# Suggested change:
return ToolResult(
content=[TextContent(type="text", text=f"{readable}\n\n{wrapped_text}")],
structured_content={"success": True, "output": wrapped_text})This simply appends the wrapped text to the existing readable summary, ensuring backward compatibility without losing any existing functionality.
Context
This appears to be a widespread compatibility issue affecting various MCP integrations. The research I found indicates that:
- Claude Desktop currently ignores
structured_contententirely - Zed Editor's MCP integration doesn't parse structured content
- Other tools like langchain-mcp-adapters face similar limitations
Alternative Approaches
I originally thought of applying a command-line flag for legacy support, like --legacy-client-support or --include-output-in-content that would modify the tool's behaviour to include the wrapped text directly in the content field alongside the summary message.
However, since reading the MCP spec, I think the better solution is to follow the official MCP backward compatibility guidelines. This would ensure it works with both legacy and modern MCP clients.
Thanks again for this excellent tool!