Skip to content

Add structured filesystem startup validation errors#3513

Open
davidahmann wants to merge 1 commit intomodelcontextprotocol:mainfrom
davidahmann:codex/issue-3512-fs-startup-errors
Open

Add structured filesystem startup validation errors#3513
davidahmann wants to merge 1 commit intomodelcontextprotocol:mainfrom
davidahmann:codex/issue-3512-fs-startup-errors

Conversation

@davidahmann
Copy link

Problem
Filesystem server startup failures for missing or invalid roots were only emitted as free-form stderr text, which makes automated classification and audit receipts brittle.

Why now
Issue #3512 asked for a machine-readable startup taxonomy. Operators need stable error codes when validating fail-closed root configuration in CI and wrapper processes.

What changed

  • emit structured JSON-line startup validation events alongside existing human-readable stderr
  • cover argv validation failures for inaccessible paths, non-directories, and "no accessible directories"
  • reuse the structured emission for MCP roots validation paths

Validation

  • npm run --workspace @modelcontextprotocol/server-filesystem build
  • npm run --workspace @modelcontextprotocol/server-filesystem test -- __tests__/startup-validation.test.ts

Refs #3512

@davidahmann
Copy link
Author

User impact: Wrapper processes can now classify filesystem startup failures deterministically instead of scraping only free-form stderr.
Change: The filesystem server now emits structured JSON-line startup validation events alongside the existing human-readable messages and covers the argv validation cases in tests.
Validation:

  • npm run --workspace @modelcontextprotocol/server-filesystem build passed
  • npm run --workspace @modelcontextprotocol/server-filesystem test -- __tests__/startup-validation.test.ts passed

Inspired by research context: CAISI publishes independent, reproducible AI agent governance research: https://caisi.dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant