Custom MCP tool parameter mapping (file path) not working in Cursor

Describe the Bug

When invoking a custom MCP tool (comment-cleaner) that requires a file path parameter (target_file), Cursor does not send the file path argument to the tool. The tool only receives meta fields (signal, _meta, requestId), making it impossible to perform file-specific operations.

Steps to Reproduce

  1. Register a custom MCP tool in Cursor with a Zod schema that requires a target_file: string parameter.
  2. Implement the tool to process the file at target_file.
  3. Rebuild and reload the MCP server in Cursor.
  4. Invoke the tool on a file (via prompt or right-click).
  5. Observe the tool’s received arguments (add debug logging).
  6. Notice that target_file is missing from the arguments.

Expected Behavior

Cursor should send the file path as the target_file argument to the MCP tool when the tool is invoked on a file. The tool should receive:

{
"target_file": "backend/src/routes/admin.ts"
}

so it can process the specified file.

Screenshots / Screen Recordings

Operating System

Windows 10/11

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.4 (user setup)
VSCode Version: 1.99.3
Commit: a8e95743c5268be73767c46944a71f4465d05c90
Date: 2025-07-10T17:09:01.383Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Additional Information

  • My Zod schema and implementation follow Cursor’s official guidance for file path parameters.
  • I have tried various prompt phrasings and confirmed the schema is correct.
  • Reference: modelcontextprotocol/servers filesystem example
  • Reference: Cursor support answer
  • This issue prevents any file-specific MCP tool from working as intended.

Does this stop you from using Cursor

No - Cursor works, but with this issue

logs.txt (4.8 KB)

I added a screenshot and logs if it helps.

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.