feat(mcp): convert TypeScript classes to MCP tools.#1743
Merged
samchon merged 5 commits intofeat/monorepofrom Feb 21, 2026
Merged
feat(mcp): convert TypeScript classes to MCP tools.#1743samchon merged 5 commits intofeat/monorepofrom
samchon merged 5 commits intofeat/monorepofrom
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new @typia/mcp package that registers typia LLM controllers (class-based and OpenAPI/HTTP-based) as MCP tools, with typia-powered argument validation feedback suitable for LLM auto-correction.
Changes:
- Introduces
@typia/mcpwithregisterMcpControllers()and an internal registrar that wires MCPtools/list+tools/call. - Adds
IHttpLlmControllerandHttpLlm.controller()to treat OpenAPI operations as tool controllers. - Updates
stringifyValidationFailure()formatting to wrap annotated JSON output in Markdown code fences.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds dependency graph entries for the new MCP package and MCP SDK dependencies. |
| packages/utils/src/utils/stringifyValidationFailure.ts | Wrapes validation feedback in Markdown code blocks and improves output structure. |
| packages/utils/src/http/HttpLlm.ts | Adds HttpLlm.controller() and adjusts HttpLlm.application() typing. |
| packages/mcp/package.json | Defines the new @typia/mcp package metadata and dependencies. |
| packages/mcp/tsconfig.json | Adds TypeScript build configuration for the new package. |
| packages/mcp/src/index.ts | Exposes registerMcpControllers() public API. |
| packages/mcp/src/internal/McpControllerRegistrar.ts | Implements MCP tool registration/listing/calling and typia validation feedback. |
| packages/interface/src/http/IHttpLlmController.ts | Defines HTTP/OpenAPI controller shape for tool registration. |
| packages/interface/src/http/index.ts | Re-exports IHttpLlmController. |
| packages/interface/src/schema/ILlmController.ts | Updates documentation to include MCP registration examples. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
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.
This pull request introduces a new MCP integration package for typia, enabling seamless registration of both TypeScript class-based and OpenAPI-based LLM function controllers as MCP tools. The changes provide robust validation feedback for LLM function calls, simplify controller creation, and ensure compatibility with MCP servers. The most important changes are grouped below.
MCP Integration and Controller Registration
@typia/mcpwith configuration, dependencies, and build scripts, providing MCP integration for typia and supporting both class and HTTP controllers. (packages/mcp/package.json,packages/mcp/tsconfig.json,pnpm-lock.yaml) [1] [2] [3]registerMcpControllersfunction inpackages/mcp/src/index.tsto register controllers as MCP tools and provide validation feedback for LLM function calls. (packages/mcp/src/index.ts)McpControllerRegistrarinternal module to handle tool registration, tool call routing, validation, and integration with MCP server tool handlers. (packages/mcp/src/internal/McpControllerRegistrar.ts)HTTP Controller and OpenAPI Support
IHttpLlmControllerinterface for HTTP-based LLM controllers, allowing OpenAPI operations to be registered as LLM function calling tools. (packages/interface/src/http/IHttpLlmController.ts,packages/interface/src/http/index.ts) [1] [2]HttpLlm.controllerfunction to compose HTTP LLM controllers from OpenAPI documents, simplifying MCP tool registration for API endpoints. (packages/utils/src/http/HttpLlm.ts) [1] [2] [3] [4]Documentation and Validation Feedback
ILlmControllerandIHttpLlmController, clarifying usage for class-based and OpenAPI-based controllers and their registration process. (packages/interface/src/schema/ILlmController.ts,packages/interface/src/http/IHttpLlmController.ts) [1] [2]stringifyValidationFailureoutput to wrap annotated JSON in a markdown code block, making validation feedback clearer for LLM auto-correction. (packages/utils/src/utils/stringifyValidationFailure.ts)