@nuxtjs/mcp-toolkit 0.5.1 → 0.5.2

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/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mcp-toolkit",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "configKey": "mcp",
5
5
  "docs": "https://mcp-toolkit.nuxt.dev/getting-started/installation",
6
6
  "mcp": "https://mcp-toolkit.nuxt.dev/mcp",
package/dist/module.mjs CHANGED
@@ -7,7 +7,7 @@ import { ROUTES } from '../dist/runtime/server/mcp/constants.js';
7
7
  import { addDevToolsCustomTabs } from '../dist/runtime/server/mcp/devtools/index.js';
8
8
 
9
9
  const name = "@nuxtjs/mcp-toolkit";
10
- const version = "0.5.1";
10
+ const version = "0.5.2";
11
11
 
12
12
  const log = logger.withTag("@nuxtjs/mcp-toolkit");
13
13
  const { resolve } = createResolver(import.meta.url);
@@ -21,6 +21,10 @@ const module$1 = defineNuxtModule({
21
21
  },
22
22
  defaults: defaultMcpConfig,
23
23
  async setup(options, nuxt) {
24
+ if (nuxt.options.nitro.static || nuxt.options._generate) {
25
+ log.warn("@nuxtjs/mcp-toolkit is not compatible with `nuxt generate` as it needs a server to run.");
26
+ return;
27
+ }
24
28
  const resolver = createResolver(import.meta.url);
25
29
  nuxt.options.runtimeConfig.mcp = defu(
26
30
  nuxt.options.runtimeConfig.mcp,
@@ -37,7 +37,7 @@ export interface McpToolDefinition<InputSchema extends ZodRawShape | undefined =
37
37
  * Register a tool from a McpToolDefinition
38
38
  * @internal
39
39
  */
40
- export declare function registerToolFromDefinition<InputSchema extends ZodRawShape | undefined = ZodRawShape, OutputSchema extends ZodRawShape = ZodRawShape>(server: McpServer, tool: McpToolDefinition<InputSchema, OutputSchema>): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
40
+ export declare function registerToolFromDefinition(server: McpServer, tool: McpToolDefinition): import("@modelcontextprotocol/sdk/server/mcp.js").RegisteredTool;
41
41
  /**
42
42
  * Define an MCP tool that will be automatically registered.
43
43
  *
@@ -19,32 +19,15 @@ export function registerToolFromDefinition(server, tool) {
19
19
  cacheOptions
20
20
  );
21
21
  }
22
- if (tool.inputSchema) {
23
- return server.registerTool(
24
- name,
25
- {
26
- title,
27
- description: tool.description,
28
- inputSchema: tool.inputSchema,
29
- outputSchema: tool.outputSchema,
30
- annotations: tool.annotations,
31
- _meta: tool._meta
32
- },
33
- handler
34
- );
35
- } else {
36
- return server.registerTool(
37
- name,
38
- {
39
- title,
40
- description: tool.description,
41
- outputSchema: tool.outputSchema,
42
- annotations: tool.annotations,
43
- _meta: tool._meta
44
- },
45
- handler
46
- );
47
- }
22
+ const options = {
23
+ title,
24
+ description: tool.description,
25
+ inputSchema: tool.inputSchema,
26
+ outputSchema: tool.outputSchema,
27
+ annotations: tool.annotations,
28
+ _meta: tool._meta
29
+ };
30
+ return server.registerTool(name, options, handler);
48
31
  }
49
32
  export function defineMcpTool(definition) {
50
33
  return definition;
@@ -127,7 +127,7 @@ export async function loadDefinitionFiles(paths, options = {}) {
127
127
  const layerFiles = await glob(layerPatterns, {
128
128
  absolute: true,
129
129
  onlyFiles: true,
130
- ignore: options.excludePatterns
130
+ ignore: [...options.excludePatterns || [], "**/*.d.ts"]
131
131
  });
132
132
  const filteredFiles = options.filter ? layerFiles.filter(options.filter) : layerFiles;
133
133
  for (const filePath of filteredFiles) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxtjs/mcp-toolkit",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Create MCP servers directly in your Nuxt application. Define tools, resources, and prompts with a simple and intuitive API.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@clack/prompts": "^0.11.0",
36
- "@modelcontextprotocol/sdk": "^1.23.0",
36
+ "@modelcontextprotocol/sdk": "^1.24.3",
37
37
  "@nuxt/kit": "^4.2.1",
38
38
  "automd": "^0.4.2",
39
39
  "chokidar": "^4.0.3",
@@ -53,18 +53,18 @@
53
53
  }
54
54
  },
55
55
  "devDependencies": {
56
- "@nuxt/devtools": "^3.1.0",
57
- "@nuxt/eslint-config": "^1.10.0",
56
+ "@nuxt/devtools": "^3.1.1",
57
+ "@nuxt/eslint-config": "^1.11.0",
58
58
  "@nuxt/module-builder": "^1.0.2",
59
59
  "@nuxt/schema": "^4.2.1",
60
- "@nuxt/test-utils": "^3.20.1",
60
+ "@nuxt/test-utils": "^3.21.0",
61
61
  "@types/node": "latest",
62
62
  "changelogen": "^0.6.2",
63
63
  "eslint": "^9.39.1",
64
64
  "nuxt": "^4.2.1",
65
65
  "typescript": "~5.9.3",
66
- "vitest": "^4.0.10",
67
- "vue-tsc": "^3.1.4"
66
+ "vitest": "^4.0.15",
67
+ "vue-tsc": "^3.1.7"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public"