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.
Screen.Recording.2024-12-13.mp4
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"
]
}
}
}
-
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:
The server implements three different approaches to combining object types:
format_hello
usesallOf
to combine a base object with a discriminated unionformat_goodbye
uses a direct union of complete objectsformat_sorry
uses 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.
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 test
to run tests - Build with
npm run build
- You can use
npm run build:watch
to automatically build after editingsrc/index.ts
. This means you can hit save, reload Claude Desktop (with Ctrl/Cmd+R), and the changes apply.