Skip to content

filesystem: add structured startup validation errors - #4056

Closed
Shiyao-Huang wants to merge 1 commit into
modelcontextprotocol:mainfrom
Shiyao-Huang:implementer2/mcp-3512-startup-error
Closed

Shiyao-Huang wants to merge 1 commit into
modelcontextprotocol:mainfrom
Shiyao-Huang:implementer2/mcp-3512-startup-error

Conversation

@Shiyao-Huang

Copy link
Copy Markdown

Summary

Fixes #3512 by adding a machine-readable fatal startup validation error for the filesystem server.

When startup fails because no allowed directory is accessible, the server now emits a stable JSON payload on stderr with:

  • type: "startup_validation_error"
  • code: "no_accessible_directories"
  • message
  • rejectedInputs[] containing:
    • input
    • checkedPaths
    • reason (inaccessible or not_directory)

The existing fail-closed behavior remains unchanged, and per-path warning output is preserved.

Files Changed

  • src/filesystem/index.ts
  • src/filesystem/__tests__/startup-validation.test.ts

Validation

npm run build --workspace @modelcontextprotocol/server-filesystem    # pass
npm run test --workspace @modelcontextprotocol/server-filesystem     # 147 tests passed, 7 files

Notes

  • Success paths continue to emit no structured startup error
  • Mixed valid + invalid startup inputs remain non-fatal
  • Added explicit coverage for the not_directory fatal case

@LuuOW LuuOW left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technical audit: Verified MCP server implementation for consistency with current SDK patterns.

@cliffhall cliffhall added the closed-out-of-scope Closed: out of scope here; listings and new servers go to the MCP Registry (#4875) label Oct 20, 2026
@cliffhall

Copy link
Copy Markdown
Member

Thank you for this pull request, and apologies for the long wait for a response.

These servers are reference implementations: they exist to show how each part of MCP is used, not to be general-purpose products, so new features are taken selectively, and this change isn't one the maintainers plan to take. This repository also now accepts issues, not pull requests, from anyone but its maintainers; the policy is in CONTRIBUTING.md.

This is not a judgment on the idea or on you. A server in the MCP Registry may well offer it, and anyone is welcome to build on these servers to do so. If you think we've misread it, please open an issue describing the problem and the expected behavior.

This is part of the backlog triage in #4875.

@cliffhall cliffhall closed this Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

closed-out-of-scope Closed: out of scope here; listings and new servers go to the MCP Registry (#4875)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants