@tigerdata/mcp-boilerplate 1.0.2 → 1.1.0
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/dist/skills/types.js +2 -2
- package/dist/types.d.ts +5 -4
- package/package.json +6 -3
package/dist/skills/types.js
CHANGED
|
@@ -34,7 +34,7 @@ export const zSkillCfg = z.discriminatedUnion('type', [
|
|
|
34
34
|
zGitHubSkillCfg,
|
|
35
35
|
zGitHubCollectionSkillCfg,
|
|
36
36
|
]);
|
|
37
|
-
export const zSkillCfgMap = z.record(zSkillCfg);
|
|
37
|
+
export const zSkillCfgMap = z.record(z.string(), zSkillCfg);
|
|
38
38
|
export const zSkillMatter = z.object({
|
|
39
39
|
name: z.string().trim().min(1),
|
|
40
40
|
description: z.string(),
|
|
@@ -42,7 +42,7 @@ export const zSkillMatter = z.object({
|
|
|
42
42
|
export const zLocalSkill = zSkillMatter.extend(zLocalSkillCfg.shape);
|
|
43
43
|
export const zGitHubSkill = zSkillMatter.extend(zGitHubSkillCfg.shape);
|
|
44
44
|
export const zSkill = z.discriminatedUnion('type', [zLocalSkill, zGitHubSkill]);
|
|
45
|
-
export const zSkillMap = z.record(zSkill);
|
|
45
|
+
export const zSkillMap = z.record(z.string(), zSkill);
|
|
46
46
|
export const zViewSkillInputSchema = {
|
|
47
47
|
skill_name: z
|
|
48
48
|
.string()
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { CompleteResourceTemplateCallback, ListResourcesCallback, ReadResourceCallback, ReadResourceTemplateCallback, ResourceMetadata } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
2
|
import type { GetPromptResult, ToolAnnotations } from '@modelcontextprotocol/sdk/types.js';
|
|
3
3
|
import type { Router } from 'express';
|
|
4
|
-
import type { ZodRawShape,
|
|
4
|
+
import type { ZodRawShape, z } from 'zod';
|
|
5
|
+
type ObjectOutput<T extends ZodRawShape> = z.infer<z.ZodObject<T>>;
|
|
5
6
|
export type BaseToolConfig = {
|
|
6
7
|
title?: string;
|
|
7
8
|
description?: string;
|
|
@@ -40,8 +41,8 @@ export type ToolConfig<InputArgs extends ZodRawShape, OutputArgs extends ZodRawS
|
|
|
40
41
|
};
|
|
41
42
|
export interface ApiDefinition<InputArgs extends ZodRawShape, OutputArgs extends ZodRawShape, SimplifiedOutputArgs = OutputArgs> extends BaseApiDefinition {
|
|
42
43
|
config: ToolConfig<InputArgs, OutputArgs>;
|
|
43
|
-
fn(args:
|
|
44
|
-
pickResult?(result:
|
|
44
|
+
fn(args: ObjectOutput<InputArgs>): Promise<ObjectOutput<OutputArgs>>;
|
|
45
|
+
pickResult?(result: ObjectOutput<OutputArgs>): SimplifiedOutputArgs;
|
|
45
46
|
}
|
|
46
47
|
export type ApiFactory<Context extends Record<string, unknown>, Input extends ZodRawShape, Output extends ZodRawShape, RestOutput = Output> = (ctx: Context, featureFlags: McpFeatureFlags) => ApiDefinition<Input, Output, RestOutput> | Promise<ApiDefinition<Input, Output, RestOutput>>;
|
|
47
48
|
export type RouterFactoryResult = [Router, () => void | Promise<void>];
|
|
@@ -52,7 +53,7 @@ export type PromptConfig<InputArgs extends ZodRawShape> = {
|
|
|
52
53
|
};
|
|
53
54
|
export interface PromptDefinition<InputArgs extends ZodRawShape> extends BasePromptDefinition {
|
|
54
55
|
config: PromptConfig<InputArgs>;
|
|
55
|
-
fn(args:
|
|
56
|
+
fn(args: ObjectOutput<InputArgs>): Promise<GetPromptResult>;
|
|
56
57
|
}
|
|
57
58
|
export type PromptFactory<Context extends Record<string, unknown>, Input extends ZodRawShape> = (ctx: Context, featureFlags: McpFeatureFlags) => PromptDefinition<Input>;
|
|
58
59
|
export interface TemplatedResourceDefinition {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tigerdata/mcp-boilerplate",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "MCP boilerplate code for Node.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "TigerData",
|
|
@@ -54,11 +54,14 @@
|
|
|
54
54
|
"express": "^5.2.1",
|
|
55
55
|
"gray-matter": "^4.0.3",
|
|
56
56
|
"raw-body": "^3.0.2",
|
|
57
|
-
"yaml": "^2.8.2"
|
|
58
|
-
|
|
57
|
+
"yaml": "^2.8.2"
|
|
58
|
+
},
|
|
59
|
+
"peerDependencies": {
|
|
60
|
+
"zod": "^3.25 || ^4.0"
|
|
59
61
|
},
|
|
60
62
|
"devDependencies": {
|
|
61
63
|
"@biomejs/biome": "^2.3.11",
|
|
64
|
+
"zod": "^3.25.0",
|
|
62
65
|
"@octokit/rest": "^22.0.1",
|
|
63
66
|
"@types/bun": "^1.3.5",
|
|
64
67
|
"@types/express": "^5.0.6",
|