mcp-90-mre
A minimal Model Context Protocol server that replicates a bug with the Claude Desktop app's MCP implementation. Specifically, using allOf or anyOf with an object doesn't appear to work correctly.
Also see discussion #90 on the model context protocol.
https://github.com/user-attachments/assets/e22b0d06-f463-4c74-a081-cb0a631cb5e9
Usage
To use this server with the Claude Desktop app, first clone this repository, install deps (with npm install) and build the repo (with npm run build).
Then, add the following configuration to the "mcpServers" section of your claude_desktop_config.json:
{
"mcpServers": {
"postgres": {
"command": "node",
"args": [
"/path/to/mcp-90-mre/dist/index.js"
]
}
}
}
Components
Tools
-
format_hello (Currently not working)
- Format a hello message
- Input parameters:
obj:allOf:- Base object with
timeOfDay(string) - Either:
- Group type:
{ type: "group", people: string[] } - Individual type:
{ type: "individual", person: string }
- Group type:
- Base object with
-
format_goodbye (Currently not working)
- Format a goodbye message
- Input parameters:
obj:anyOf:- Group type:
{ timeOfDay: string, type: "group", people: string[] } - Individual type:
{ timeOfDay: string, type: "individual", person: string }
- Group type:
-
format_sorry (Working)
- Format a sorry message
- Uses a nested object containing a union, which appears to work correctly
- Input parameters:
obj: Object containing:nested:anyOf:- Group type:
{ timeOfDay: string, type: "group", people: string[] } - Individual type:
{ timeOfDay: string, type: "individual", person: string }
- Group type:
Bug Description
The server implements three different approaches to combining object types:
format_hellousesallOfto combine a base object with a discriminated unionformat_goodbyeuses a direct union of complete objectsformat_sorryuses a nested object containing a union
Currently, only the third approach (format_sorry) works correctly in the Claude Desktop app. Both format_hello and format_goodbye fail to validate input properly, suggesting an issue with how the Claude Desktop app handles certain JSON Schema constructs.
Contributing
Pull requests are welcomed on GitHub! To get started:
- Install Git and Node.js
- Clone the repository
- Install dependencies with
npm install - Run
npm run testto run tests - Build with
npm run build
- You can use
npm run build:watchto automatically build after editingsrc/index.ts. This means you can hit save, reload Claude Desktop (with Ctrl/Cmd+R), and the changes apply.
