modelcontextprotocol / modelcontextprotocol/servers

Filesystem MCP: move_file tool returns array instead of string (Error -32602)

Open Beginner friendly
#3,093 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
90.5k
Forks
11.7k
Avg merge
2d 2h
Merged PRs (30d)
5

Description

Filesystem MCP: move_file tool returns array instead of string (Error -32602)

Summary

When executing the move_file tool from @modelcontextprotocol/server-filesystem, error code -32602 (Invalid params) occurs.

Root Cause: The tool returns an array instead of a string, causing MCP protocol validation to fail.

Error Details

Error Code: -32602 (JSON-RPC Invalid params)

Error Message:
Output validation error: Invalid structured content for tool move_file: [
{
"expected": "string",
"code": "invalid_type",
"path": ["content"],
"message": "Invalid input: expected string, received array"
}
]

Problem Location: The content field is an array (should be a string)

Steps to Reproduce

  1. Configure @modelcontextprotocol/server-filesystem as an MCP server
  2. Call the move_file tool with:
    • source: Source file path
    • destination: Destination file path
  3. Error occurs

Example:
{
"source": "C:\path\to\file.txt",
"destination": "C:\path\to\new\file.txt"
}

Expected Behavior

The move_file tool should return a string message when file movement succeeds.

Example:
"Successfully moved file from source to destination"

Actual Behavior

The move_file tool returns an array, causing MCP protocol validation to fail.

Environment

OS: Windows 10 (build 26100)
Node.js: 22.21.1 (Built-in Claude Desktop)
Package: @modelcontextprotocol/server-filesystem@latest
MCP Client: Claude Desktop 1.0.1307

Log Excerpts

Request:
2025-11-30T09:57:51.155Z [filesystem] [info] Message from client:
{
"method": "tools/call",
"params": {
"name": "move_file",
"arguments": {
"source": "C:\Users\skiku\Documents\MCP_Learning\chapter01\test1.txt",
"destination": "C:\Users\skiku\Documents\MCP_Learning\chapter01\テストファイル\test1.txt"
}
},
"jsonrpc": "2.0",
"id": 26
}

Response (Error):
2025-11-30T09:57:51.174Z [filesystem] [info] Message from server:
{
"jsonrpc": "2.0",
"id": 26,
"result": {
"content": [{
"type": "text",
"text": "MCP error -32602: Output validation error: Invalid structured content for tool move_file: ..."
}],
"isError": true
}
}

Additional Information

  • Other file operation tools (read_file, write_file, create_directory, etc.) work correctly
  • The move_file tool appears in the available tools list but fails at runtime
  • This issue prevents file movement functionality from being used

Related Issues

I checked GitHub Issues but found no known problems related to the move_file tool. This appears to be an unreported bug.

Suggested Labels

  • bug
  • server-filesystem
  • schema-validation

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied move_file call, then locate the move_file implementation and its output schema in the server-filesystem package. Confirm the successful result is a string and rerun the same MCP request to verify output validation passes without error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.