Skip to content

filesystem: normalize text structuredContent shape#3588

Open
davidahmann wants to merge 1 commit intomodelcontextprotocol:mainfrom
davidahmann:codex/issue-3587-fs-structured-content-schema
Open

filesystem: normalize text structuredContent shape#3588
davidahmann wants to merge 1 commit intomodelcontextprotocol:mainfrom
davidahmann:codex/issue-3587-fs-structured-content-schema

Conversation

@davidahmann
Copy link

Description

Normalize the filesystem server's text-returning tools so structuredContent always matches the declared { content: string } schema without extra keys. This keeps the tool response contract deterministic for MCP clients.

Publishing Your Server

Note: We are no longer accepting PRs to add servers to the README. Instead, please publish your server to the MCP Server Registry to make it discoverable to the MCP ecosystem.

To publish your server, follow the quickstart guide. You can browse published servers at https://registry.modelcontextprotocol.io/.

Server Details

  • Server: filesystem
  • Changes to: tools

Motivation and Context

The filesystem server mixed ad hoc text results with slightly different structuredContent shapes, which makes schema consumers rely on incidental fields instead of the advertised output contract. This change centralizes the text result shape and adds regression coverage that the representative text tools only return structuredContent.content.

How Has This Been Tested?

  • pnpm --filter @modelcontextprotocol/server-filesystem test -- structured-content.test.ts

Breaking Changes

No. Tool schemas stay the same; this only removes extra undocumented keys from text tool results.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Protocol Documentation
  • My changes follows MCP security best practices
  • I have updated the server's README accordingly
  • I have tested this with an LLM client
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have documented all environment variables and configuration options

Additional context

Closes #3587.

@davidahmann
Copy link
Author

davidahmann commented Mar 15, 2026

Validation on this branch:

  • pnpm --filter @modelcontextprotocol/server-filesystem test -- structured-content.test.ts

Initial CI after push:

  • detect-packages for Python and TypeScript ✅
  • Test filesystem in progress
  • unrelated Python lanes (Test fetch, Test git, Test time) also in progress at PR creation time

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

@davidahmann
Copy link
Author

davidahmann commented Mar 15, 2026

CI triage update:

  • Build fetch failed in the Python workflow before any package-specific build/test step ran.
  • First concrete error from the failed step: The lockfile at uv.lock needs to be updated, but --locked was provided. To update the lockfile, run uv lock.
  • Build git and Build time were then canceled by fail-fast.
  • TypeScript lanes, including Test filesystem and Build filesystem, completed successfully.

Classifying this as a baseline/environment mismatch in the repo's Python lane rather than a regression from the filesystem structured-content change.

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.

filesystem: lock structured-content response shape for text tools

1 participant