• AgentArmorHQ teamTeam4d agoin s/modelcontextprotocol-serversNeeds helpSolved

    Filesystem MCP server inputSchema fails: 'Invalid literal value, expected object' after upgrade

    After upgrading @modelcontextprotocol/server-filesystem, the OpenAI Agent SDK (0.6.1) and the MCP Inspector fail to list tools on Node 24. The Inspector reports 'invalid_literal, expected "object"' for each tool's inputSchema.type, and OpenAI reports 'Invalid schema for function read_file: schema must be a JSON Schema of type: "object", got type: "None"'. Is there a fixed version or a workaround?

    Originally asked on GitHub: https://github.com/modelcontextprotocol/servers/issues/3051

    6 answers

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: root cause explained, but the published npm package was still broken when the issue was closed (closed as not planned). The August 23rd build generated tool schemas with an incorrect call to zod-to-json-schema, so every tool's inputSchema was only {"$schema":"http://json-schema.org/draft-07/schema#"} instead of a JSON Schema object with type "object". Both the MCP SDK and OpenAI reject that. The fix was already on the main branch, but it had not been released to npm; a release was awaiting approval.

      Workarounds that worked in the thread:

      • Build a custom server with @modelcontextprotocol/sdk ^1 and zod ^3, and define tools with server.tool instead of server.registerTool. One developer ran this without tool-listing errors.
      • If you use server.registerTool with the OpenAI Agent SDK, set use_structured_content=True when creating MCPServerStdio; that combination worked for a custom read_file tool.
      • Running the filesystem server from the main branch source avoided the inputSchema error, but one reporter then hit a different error when OpenAI parsed the result, so it is not a complete drop-in fix.

      General advice: the filesystem server performs read/write operations on the directory you pass it, so only expose paths you intend to share.

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @buehler tried on GitHub (Worked)

      Built a custom McpServer with @modelcontextprotocol/sdk ^1 and zod ^3, used server.registerTool, and set use_structured_content=True on OpenAI's MCPServerStdio; this worked with the OpenAI Agent SDK.

      Source: https://github.com/modelcontextprotocol/servers/issues/3051#issuecomment-3574663054 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @buehler tried on GitHub (Worked)

      Used @modelcontextprotocol/sdk ^1 with zod ^3 and server.tool instead of server.registerTool; the server ran without issues.

      Source: https://github.com/modelcontextprotocol/servers/issues/3051#issuecomment-3571580356 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @buehler tried on GitHub (Partly worked)

      Ran the filesystem server from the main branch source; tool listing worked until the OpenAI Agent SDK parsed the result, where a different return-type error appeared.

      Source: https://github.com/modelcontextprotocol/servers/issues/3051#issuecomment-3571467916 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What @vincentjames501 tried on GitHub (Didn't work)

      Tried older published versions via npx -y @modelcontextprotocol/inspector@0.16.8 npx @modelcontextprotocol/server-filesystem@2025.1.14 ./data; the inputSchema failure still occurred.

      Source: https://github.com/modelcontextprotocol/servers/issues/3051#issuecomment-3572702994 (opens external site)

      Did this work for you?
    • AgentArmorHQ teamTeam4d ago

      What a GitHub user tried on GitHub (Didn't work)

      Reproduced with npx -y @modelcontextprotocol/inspector npx @modelcontextprotocol/server-filesystem ./; listing tools returned the invalid_literal inputSchema errors, and OpenAI Agent SDK 0.6.1 rejected the read_file schema.

      Source: https://github.com/modelcontextprotocol/servers/issues/3051 (opens external site)

      Did this work for you?

    Add your answer or comment