@typia/mcp 12.0.0-dev.20260316 → 12.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +69 -69
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Jeongho Nam
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Jeongho Nam
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
# `@typia/mcp`
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
[](https://github.com/samchon/typia/blob/master/LICENSE)
|
|
6
|
-
[](https://www.npmjs.com/package/typia)
|
|
7
|
-
[](https://www.npmjs.com/package/typia)
|
|
8
|
-
[](https://github.com/samchon/typia/actions?query=workflow%3Atest)
|
|
9
|
-
[](https://typia.io/docs/)
|
|
10
|
-
[](https://gurubase.io/g/typia)
|
|
11
|
-
[](https://discord.gg/E94XhzrUCZ)
|
|
12
|
-
|
|
13
|
-
[MCP (Model Context Protocol)](https://modelcontextprotocol.io) integration for [`typia`](https://github.com/samchon/typia).
|
|
14
|
-
|
|
15
|
-
Registers typia controllers as MCP tools with automatic validation.
|
|
16
|
-
|
|
17
|
-
## Setup
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npm install @typia/mcp @modelcontextprotocol/sdk
|
|
21
|
-
npm install typia
|
|
22
|
-
npx typia setup
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Usage
|
|
26
|
-
|
|
27
|
-
### From TypeScript class
|
|
28
|
-
|
|
29
|
-
```typescript
|
|
30
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
31
|
-
import { registerMcpControllers } from "@typia/mcp";
|
|
32
|
-
import typia from "typia";
|
|
33
|
-
|
|
34
|
-
const server: McpServer = new McpServer({
|
|
35
|
-
name: "my-server",
|
|
36
|
-
version: "1.0.0",
|
|
37
|
-
});
|
|
38
|
-
registerMcpControllers({
|
|
39
|
-
server,
|
|
40
|
-
controllers: [
|
|
41
|
-
typia.llm.controller<Calculator>("Calculator", new Calculator()),
|
|
42
|
-
],
|
|
43
|
-
});
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### From OpenAPI document
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
import { registerMcpControllers } from "@typia/mcp";
|
|
50
|
-
import { HttpLlm } from "@typia/utils";
|
|
51
|
-
|
|
52
|
-
registerMcpControllers({
|
|
53
|
-
server,
|
|
54
|
-
controllers: [
|
|
55
|
-
HttpLlm.controller({
|
|
56
|
-
name: "petStore",
|
|
57
|
-
document: yourOpenApiDocument,
|
|
58
|
-
connection: { host: "https://api.example.com" },
|
|
59
|
-
}),
|
|
60
|
-
],
|
|
61
|
-
});
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Features
|
|
65
|
-
|
|
66
|
-
- No manual schema definition — generates everything from TypeScript types or OpenAPI
|
|
67
|
-
- Automatic argument validation with LLM-friendly error feedback
|
|
68
|
-
- Supports both class-based (`typia.llm.controller`) and HTTP-based (`HttpLlm.controller`) controllers
|
|
69
|
-
- `preserve` option to coexist with `McpServer.registerTool()`
|
|
1
|
+
# `@typia/mcp`
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://github.com/samchon/typia/blob/master/LICENSE)
|
|
6
|
+
[](https://www.npmjs.com/package/typia)
|
|
7
|
+
[](https://www.npmjs.com/package/typia)
|
|
8
|
+
[](https://github.com/samchon/typia/actions?query=workflow%3Atest)
|
|
9
|
+
[](https://typia.io/docs/)
|
|
10
|
+
[](https://gurubase.io/g/typia)
|
|
11
|
+
[](https://discord.gg/E94XhzrUCZ)
|
|
12
|
+
|
|
13
|
+
[MCP (Model Context Protocol)](https://modelcontextprotocol.io) integration for [`typia`](https://github.com/samchon/typia).
|
|
14
|
+
|
|
15
|
+
Registers typia controllers as MCP tools with automatic validation.
|
|
16
|
+
|
|
17
|
+
## Setup
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npm install @typia/mcp @modelcontextprotocol/sdk
|
|
21
|
+
npm install typia
|
|
22
|
+
npx typia setup
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
### From TypeScript class
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
31
|
+
import { registerMcpControllers } from "@typia/mcp";
|
|
32
|
+
import typia from "typia";
|
|
33
|
+
|
|
34
|
+
const server: McpServer = new McpServer({
|
|
35
|
+
name: "my-server",
|
|
36
|
+
version: "1.0.0",
|
|
37
|
+
});
|
|
38
|
+
registerMcpControllers({
|
|
39
|
+
server,
|
|
40
|
+
controllers: [
|
|
41
|
+
typia.llm.controller<Calculator>("Calculator", new Calculator()),
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### From OpenAPI document
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { registerMcpControllers } from "@typia/mcp";
|
|
50
|
+
import { HttpLlm } from "@typia/utils";
|
|
51
|
+
|
|
52
|
+
registerMcpControllers({
|
|
53
|
+
server,
|
|
54
|
+
controllers: [
|
|
55
|
+
HttpLlm.controller({
|
|
56
|
+
name: "petStore",
|
|
57
|
+
document: yourOpenApiDocument,
|
|
58
|
+
connection: { host: "https://api.example.com" },
|
|
59
|
+
}),
|
|
60
|
+
],
|
|
61
|
+
});
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- No manual schema definition — generates everything from TypeScript types or OpenAPI
|
|
67
|
+
- Automatic argument validation with LLM-friendly error feedback
|
|
68
|
+
- Supports both class-based (`typia.llm.controller`) and HTTP-based (`HttpLlm.controller`) controllers
|
|
69
|
+
- `preserve` option to coexist with `McpServer.registerTool()`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typia/mcp",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.1",
|
|
4
4
|
"description": "MCP (Model Context Protocol) integration for typia",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"homepage": "https://typia.io",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"zod-to-json-schema": ">=3.24.0",
|
|
26
|
-
"@typia/
|
|
27
|
-
"@typia/
|
|
26
|
+
"@typia/interface": "^12.0.1",
|
|
27
|
+
"@typia/utils": "^12.0.1"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@modelcontextprotocol/sdk": ">=1.0.0"
|