@toolsdk.ai/registry 1.0.97 → 1.0.99
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/README.md +2 -0
- package/dist/api/index.d.ts +2 -2
- package/dist/api/index.js +16 -2
- package/dist/api/package-handler.d.ts +18 -18
- package/dist/api/package-handler.js +21 -44
- package/dist/api/package-route.d.ts +2 -2
- package/dist/api/package-route.js +67 -32
- package/dist/api/package-so.d.ts +1 -203
- package/dist/api/package-so.js +1 -1
- package/dist/api/package.test.js +1 -2
- package/dist/helper.d.ts +1 -1
- package/dist/helper.js +3 -1
- package/dist/schema.d.ts +617 -15
- package/dist/schema.js +82 -8
- package/dist/types.d.ts +11 -1
- package/dist/utils.d.ts +21 -0
- package/dist/utils.js +57 -0
- package/package.json +4 -2
package/dist/schema.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
2
|
export const PackageKeySchema = z.string();
|
|
3
3
|
export const HostingBlackListSchema = z.array(PackageKeySchema);
|
|
4
4
|
export const FeaturedListSchema = z.array(PackageKeySchema);
|
|
@@ -17,9 +17,18 @@ export const MCPServerPackageConfigSchema = z.object({
|
|
|
17
17
|
type: z.literal('mcp-server'),
|
|
18
18
|
runtime: z.enum(['node', 'python', 'java', 'go']),
|
|
19
19
|
packageName: z.string().describe('Name of the node, python, java package '),
|
|
20
|
-
packageVersion: z
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
packageVersion: z
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('Version of the package, if not provided then it will use latest version'),
|
|
24
|
+
bin: z
|
|
25
|
+
.string()
|
|
26
|
+
.optional()
|
|
27
|
+
.describe('Binary Command to run the MCP server, if not provided then it will use the package name'),
|
|
28
|
+
binArgs: z
|
|
29
|
+
.array(z.string())
|
|
30
|
+
.optional()
|
|
31
|
+
.describe('Binary Arguments to pass to the command, if not provided then it will use an empty array'),
|
|
23
32
|
// if no custom key then would use name
|
|
24
33
|
key: z.string().optional().describe('Unique key for url and slug'),
|
|
25
34
|
name: z.string().optional().describe('Custom name for display, if empty then it will use the package name'),
|
|
@@ -27,8 +36,11 @@ export const MCPServerPackageConfigSchema = z.object({
|
|
|
27
36
|
readme: z.string().optional().describe('URL to the README file, if not provided then it will use the package URL'),
|
|
28
37
|
url: z.string().optional(),
|
|
29
38
|
license: z.string().optional().describe('Open source license lie MIT, AGPL, GPL, etc'),
|
|
30
|
-
logo: z
|
|
31
|
-
|
|
39
|
+
logo: z
|
|
40
|
+
.string()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('URL to custom logo image, if undefined and the URL is Github, then it will use the Github logo'),
|
|
43
|
+
author: z.string().optional().describe("Author name of the ToolSDK.ai's developer ID"),
|
|
32
44
|
env: z
|
|
33
45
|
.record(z.object({
|
|
34
46
|
description: z.string(),
|
|
@@ -48,8 +60,70 @@ export const PackagesListSchema = z.record(z.object({
|
|
|
48
60
|
category: z.string().optional(),
|
|
49
61
|
path: z.string(),
|
|
50
62
|
validated: z.boolean().optional(),
|
|
51
|
-
tools: z
|
|
63
|
+
tools: z
|
|
64
|
+
.record(z.object({
|
|
52
65
|
name: z.string().optional(),
|
|
53
66
|
description: z.string().optional(),
|
|
54
|
-
}))
|
|
67
|
+
}))
|
|
68
|
+
.optional(),
|
|
55
69
|
}));
|
|
70
|
+
export const BaseResponseSchema = z.object({
|
|
71
|
+
success: z.boolean(),
|
|
72
|
+
code: z.number(),
|
|
73
|
+
message: z.string(),
|
|
74
|
+
});
|
|
75
|
+
export const ErrorResponseSchema = BaseResponseSchema.omit({ success: true }).extend({
|
|
76
|
+
success: z.literal(false),
|
|
77
|
+
});
|
|
78
|
+
export const FeaturedResponseSchema = BaseResponseSchema.extend({
|
|
79
|
+
data: z.array(z.string()).optional(),
|
|
80
|
+
});
|
|
81
|
+
export const CategoriesResponseSchema = BaseResponseSchema.extend({
|
|
82
|
+
data: z.array(CategoryConfigSchema).optional(),
|
|
83
|
+
});
|
|
84
|
+
export const PackagesListResponseSchema = BaseResponseSchema.extend({
|
|
85
|
+
data: PackagesListSchema.optional(),
|
|
86
|
+
});
|
|
87
|
+
export const PackageDetailDataSchema = MCPServerPackageConfigSchema.extend({
|
|
88
|
+
tools: z
|
|
89
|
+
.array(z.object({
|
|
90
|
+
name: z.string(),
|
|
91
|
+
description: z.string().optional(),
|
|
92
|
+
inputSchema: z
|
|
93
|
+
.object({
|
|
94
|
+
type: z.string(),
|
|
95
|
+
properties: z.record(z.unknown()).optional(),
|
|
96
|
+
required: z.array(z.string()).optional(),
|
|
97
|
+
})
|
|
98
|
+
.optional(),
|
|
99
|
+
}))
|
|
100
|
+
.optional(),
|
|
101
|
+
});
|
|
102
|
+
export const PackageDetailResponseSchema = BaseResponseSchema.extend({
|
|
103
|
+
data: PackageDetailDataSchema.optional(),
|
|
104
|
+
});
|
|
105
|
+
export const ToolDataSchema = z.object({
|
|
106
|
+
name: z.string(),
|
|
107
|
+
description: z.string().optional(),
|
|
108
|
+
inputSchema: z
|
|
109
|
+
.object({
|
|
110
|
+
type: z.string(),
|
|
111
|
+
properties: z.record(z.unknown()).optional(),
|
|
112
|
+
required: z.array(z.string()).optional(),
|
|
113
|
+
})
|
|
114
|
+
.optional(),
|
|
115
|
+
});
|
|
116
|
+
export const ToolsResponseSchema = BaseResponseSchema.extend({
|
|
117
|
+
data: z.array(ToolDataSchema).optional(),
|
|
118
|
+
});
|
|
119
|
+
export const ExecuteToolResponseSchema = BaseResponseSchema.extend({
|
|
120
|
+
data: z.unknown().optional(),
|
|
121
|
+
});
|
|
122
|
+
export const createSuccessResponseSchema = (dataSchema) => {
|
|
123
|
+
return BaseResponseSchema.extend({
|
|
124
|
+
data: dataSchema.optional(),
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
export const packageNameQuerySchema = z.object({
|
|
128
|
+
packageName: z.string().optional(),
|
|
129
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import type { CategoryConfigSchema, PackageConfigSchema, MCPServerPackageConfigSchema, PackagesListSchema, ToolExecuteSchema } from './schema';
|
|
2
|
+
import type { CategoryConfigSchema, PackageConfigSchema, MCPServerPackageConfigSchema, PackagesListSchema, ToolExecuteSchema, BaseResponseSchema, FeaturedResponseSchema, CategoriesResponseSchema, PackagesListResponseSchema, PackageDetailDataSchema, PackageDetailResponseSchema, ToolDataSchema, ToolsResponseSchema, ExecuteToolResponseSchema, ErrorResponseSchema } from './schema';
|
|
3
3
|
import type { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
4
4
|
export type MCPServerPackageConfig = z.infer<typeof MCPServerPackageConfigSchema>;
|
|
5
5
|
export type PackageConfig = z.infer<typeof PackageConfigSchema>;
|
|
@@ -15,3 +15,13 @@ export interface Response<T> {
|
|
|
15
15
|
export type MCPServerPackageConfigWithTools = MCPServerPackageConfig & {
|
|
16
16
|
tools?: Tool[];
|
|
17
17
|
};
|
|
18
|
+
export type BaseResponse = z.infer<typeof BaseResponseSchema>;
|
|
19
|
+
export type FeaturedResponse = z.infer<typeof FeaturedResponseSchema>;
|
|
20
|
+
export type CategoriesResponse = z.infer<typeof CategoriesResponseSchema>;
|
|
21
|
+
export type PackagesListResponse = z.infer<typeof PackagesListResponseSchema>;
|
|
22
|
+
export type PackageDetailData = z.infer<typeof PackageDetailDataSchema>;
|
|
23
|
+
export type PackageDetailResponse = z.infer<typeof PackageDetailResponseSchema>;
|
|
24
|
+
export type ToolData = z.infer<typeof ToolDataSchema>;
|
|
25
|
+
export type ToolsResponse = z.infer<typeof ToolsResponseSchema>;
|
|
26
|
+
export type ExecuteToolResponse = z.infer<typeof ExecuteToolResponseSchema>;
|
|
27
|
+
export type ErrorResponse = z.infer<typeof ErrorResponseSchema>;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from '@hono/zod-openapi';
|
|
2
|
+
import type { Response } from './types';
|
|
3
|
+
export declare const createResponse: <T>(data: T, options?: {
|
|
4
|
+
success?: boolean;
|
|
5
|
+
code?: number;
|
|
6
|
+
message?: string;
|
|
7
|
+
}) => Response<T>;
|
|
8
|
+
export declare const createErrorResponse: (message: string, code?: number) => {
|
|
9
|
+
success: boolean;
|
|
10
|
+
code: number;
|
|
11
|
+
message: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const createRouteResponses: <T extends z.ZodTypeAny>(successSchema: T, options?: {
|
|
14
|
+
successDescription?: string;
|
|
15
|
+
includeErrorResponses?: boolean;
|
|
16
|
+
}) => Record<number, {
|
|
17
|
+
content: Record<string, {
|
|
18
|
+
schema: z.ZodTypeAny;
|
|
19
|
+
}>;
|
|
20
|
+
description: string;
|
|
21
|
+
}>;
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ErrorResponseSchema } from './schema';
|
|
2
|
+
export const createResponse = (data, options) => {
|
|
3
|
+
const { success = true, code = 200, message = 'Success' } = options || {};
|
|
4
|
+
return {
|
|
5
|
+
success,
|
|
6
|
+
code,
|
|
7
|
+
message,
|
|
8
|
+
data,
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export const createErrorResponse = (message, code = 400) => {
|
|
12
|
+
return {
|
|
13
|
+
success: false,
|
|
14
|
+
code,
|
|
15
|
+
message,
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export const createRouteResponses = (successSchema, options) => {
|
|
19
|
+
const { successDescription = 'Success', includeErrorResponses = false } = options || {};
|
|
20
|
+
const responses = {
|
|
21
|
+
200: {
|
|
22
|
+
content: {
|
|
23
|
+
'application/json': {
|
|
24
|
+
schema: successSchema,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
description: successDescription,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
if (includeErrorResponses) {
|
|
31
|
+
responses[400] = {
|
|
32
|
+
content: {
|
|
33
|
+
'application/json': {
|
|
34
|
+
schema: ErrorResponseSchema,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
description: 'Bad Request',
|
|
38
|
+
};
|
|
39
|
+
responses[404] = {
|
|
40
|
+
content: {
|
|
41
|
+
'application/json': {
|
|
42
|
+
schema: ErrorResponseSchema,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
description: 'Not Found',
|
|
46
|
+
};
|
|
47
|
+
responses[500] = {
|
|
48
|
+
content: {
|
|
49
|
+
'application/json': {
|
|
50
|
+
schema: ErrorResponseSchema,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
description: 'Internal Server Error',
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
return responses;
|
|
57
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toolsdk.ai/registry",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.99",
|
|
4
4
|
"description": "An Open, Structured, and Standard Registry for MCP Servers and Packages.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./config/*": "./config/*",
|
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
32
32
|
"@hono/node-server": "1.15.0",
|
|
33
|
+
"@hono/swagger-ui": "^0.5.2",
|
|
34
|
+
"@hono/zod-openapi": "^0.16.4",
|
|
33
35
|
"lodash": "^4.17.21",
|
|
34
|
-
"zod": "^3.
|
|
36
|
+
"zod": "^3.25.67",
|
|
35
37
|
"axios": "^1.9.0",
|
|
36
38
|
"hono": "4.8.3",
|
|
37
39
|
"semver": "^7.5.4",
|