File resource read errors expose absolute server paths to MCP clients

Author: twishabansalCreated Oct 1, 2026Updated Oct 1, 2026
Labelstype: bugpriority: p2

Prerequisites

  • I've searched the current open issues
  • I've updated to the latest version of Toolbox

Toolbox version

v1.13.1 (also on main @ 912189f)

Environment

Any OS. Any transport that serves resources/read.

Client

Any MCP client. Reproduces with curl.

Expected Behavior

The client gets a short error that names the resource or URI. The full error, with paths, goes to the server log. Missing files still return INVALID_PARAMS.

Current Behavior

The client gets absolute server paths:

 

failed to read resource: failed to open file "/srv/toolbox/docs/q.md": permission denied

Steps to reproduce?

  1. Configure a file resource and start Toolbox.
  2. chmod 000 the file.
  3. Call resources/read with its URI.
  4. The error message contains the file's absolute path.

Additional Details

  • Suggested fix: sanitise in internal/resources/file, not per handler, and keep errors.Is(err, fs.ErrNotExist) working. #4050 tried a skills-only fix and dropped it.