docs+chore(filesystem): batch Info findings — read_file deprecation signal + read_media_file docstring - #4047
Closed
yakuphanycl wants to merge 1 commit into
Conversation
…ignal + read_media_file docstring
- read_file: add structured deprecation signal via SDK `_meta` slot
(`{ deprecated: true, replacement: "read_text_file" }`). The human-readable
DEPRECATED notice in title/description already exists; this adds a
programmatic signal that MCP clients can detect without parsing English.
- read_media_file: rewrite description to add when-to-use guidance
(binary files only; for text, use read_text_file — base64 inflates plain
text ~33%) and document the MIME-type fallback behaviour (unknown
extensions silently fall back to application/octet-stream as a generic
blob).
No behavioural change. Pure docstring + metadata edits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two batched Info-level documentation/metadata improvements to
src/filesystem/index.ts, surfaced by an external MCP audit using themcp-auditskill.Per the audit's disclosure SOP, Info-severity findings are batched into a single PR rather than scattered across the tracker. No security impact, no behavioural change.
Findings addressed
F-007 —
read_filelacks structured deprecation signalDefault severity: Info (
SHAPE--class observation)read_filealready carries the human-readable deprecation intitle("Read File (Deprecated)") anddescription("DEPRECATED: Use read_text_file instead."). What's missing is a programmatic signal an MCP client can detect without parsing English from the description.Fix: add the SDK-supported
_metaslot to theregisterToolconfig:The SDK already exposes
_meta?: Record<string, unknown>in theregisterToolconfig object (@modelcontextprotocol/sdk@^1.26.0,server/mcp.d.tsline ~156), so this is purely additive — no SDK upgrade required, no spec deviation. Clients that ignore_metasee no change; clients that opt in get a stable, parseable signal.F-008 —
read_media_filedescription missing when-to-use + MIME fallbackDefault severity: Info (
DISC-003/DISC-004)The current two-line description tells what the tool does but not when an agent should reach for it instead of
read_text_file, and silently elides theapplication/octet-streamfallback for unknown extensions.Fix: rewrite description to add (a) when-to-use guidance — binary content (PNG/JPEG/GIF/WebP/BMP/SVG/MP3/WAV/OGG/FLAC); for plain text use
read_text_filebecause base64 encoding inflates text payloads ~33% with no benefit — and (b) the MIME-fallback note (unknown extensions return as a genericblobwithapplication/octet-stream).Description-only edit. The handler block (lines 267-298 in current source) is untouched.
Why batched
Per disclosure-sop §2, Info-severity findings (documentation, discoverability, metadata) are batched into one PR per upstream repo. Scattering 2 separate issues for non-functional improvements is unfriendly to maintainers.
Diff
7 insertions, 2 deletions in
src/filesystem/index.ts. No new files, no new dependencies, no behavioural change.Test plan
_metais part of the SDK'sregisterToolconfig interface; description change is a pure string concat.read_media_filehandler block (lines 267-298) untouched — only the registration metadata above it changes.upstream/mainat commit4503e2d.Reference
Audit case-study (pending publication on the auditor's side):
wrg-skills/docs/case-studies/filesystem-mcp-2026-04-26.md. This PR is independent of the case-study landing — the canonical evidence is the diff itself.🤖 Generated with Claude Code