fix(mcp): OpenAPI compositors, stdio build, Cursor MCP config, Vitest… - #5
Closed
debankurghosh2061 wants to merge 1 commit into
Closed
fix(mcp): OpenAPI compositors, stdio build, Cursor MCP config, Vitest…#5debankurghosh2061 wants to merge 1 commit into
debankurghosh2061 wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
squallstar
approved these changes
Mar 27, 2026
squallstar
left a comment
Member
There was a problem hiding this comment.
Please make sure you test with the AI chatbot to ensure tools work once deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Request-body fields defined only with OpenAPI
anyOf/oneOf(e.g. bookingpaymenton POST /rates/book) were converted toz.any(), so MCP clients often sent nested objects as JSON strings. LiteAPI then returned 4002 (readObjectStart / payment parse errors).Schema & runtime
src/utils/schema-converter.ts(anyOf/oneOf/allOf→z.union/z.intersection) in:lib/mcp-tools.ts(Next.js HTTP MCP)src/server.ts(stdio MCP)lib/mcp-tools.ts: importopenAPIToZod+OpenAPISchemacasts for typing.run-mcp-server.mjs: importLiteAPIMCPServerfromdist/server.js(index only runsmain()and does not export the class).src/server.ts: remove unusedcreateJSONSchema/openAPIToJSONSchema.Build & TypeScript
tsconfig.stdio.json: emitdist/fromsrc/withNodeNext(stdio Claude/Inspector workflows).package.json:build:stdio→tsc -p tsconfig.stdio.json; scriptstest:unit/test:unit:watch(Vitest).tsconfig.json: excludetest/,vitest.config.tsfrom Next app typecheck.Tests (Vitest, no live API)
test/schema-converter.test.ts:anyOfpayment-style →ZodUnion, basiconeOf/ objects / undefined.test/api-client.test.ts: mockfetch; assert POST body keepspaymentas a nested object (not a string).test/booking-flow.test.ts: loadopenapi-schemas/booking.json; assert/rates/bookpayment→ZodUnionand prebook body requirements.Tooling & repo hygiene
.gitignore:.env.*.local,*.tsbuildinfo,.cursor/debug*.log; dedupe.DS_Store; group.nextwith build artifacts..vscode/launch.json:node --import tsxfor stdio MCP;npm run devfor Next HTTP MCP (replace broken ts-node config)..cursor/mcp.json: project LiteAPI MCP (stdio via tsx,envFile→.env.local)..env.example: template forLITEAPI_API_KEY(copy to.env.local).Documentation
README.md: NPM scripts table; HTTP vs stdio;npm startvs stdio; Cursor.env.local; unit vs integration tests; Inspector usesrun-mcp-server.mjsafterbuild:stdio; project structure (app/,lib/,test/, etc.).Dependencies
devDependencies:vitest(+ lockfile rollup/vitest transitive updates).