-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystemReference implementation for the Filesystem MCP server - src/filesystem
Description
Description
The directory_tree tool returns structured content (array of content blocks) while Claude Code's MCP client expects a plain string for the content field. This causes a validation error when using the tool.
Error Message
MCP error -32602: Output validation error: Invalid structured content for tool directory_tree: [
{
"expected": "string",
"code": "invalid_type",
"path": [
"content"
],
"message": "Invalid input: expected string, received array"
}
]
Reproduction
- Configure filesystem MCP server in Claude Code
- Call
directory_treetool with any valid path - Observe validation error
Analysis
list_directoryreturns:{"content": "string here"}✅ worksdirectory_treereturns:{"content": [{"type": "text", "text": "..."}]}❌ fails validation
Tested versions:
2025.11.25(latest) - fails2025.8.21- fails2025.7.29- fails2025.1.14- fails0.6.2- tool doesn't exist
All date-based versions return the array format for directory_tree.
Expected Behavior
Either:
directory_treeshould return string content likelist_directorydoes- Or Claude Code's validation schema should be updated to accept structured content arrays
Environment
- OS: Linux (WSL2)
- Node: via npx
- Claude Code: latest
- @modelcontextprotocol/server-filesystem: 2025.11.25
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingserver-filesystemReference implementation for the Filesystem MCP server - src/filesystemReference implementation for the Filesystem MCP server - src/filesystem