xmcp 1.4.0 → 1.5.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/client/managed.d.ts +23 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +77 -0
- package/dist/config/index.d.ts +102 -29
- package/dist/config/schemas/components.d.ts +54 -0
- package/dist/config/schemas/index.d.ts +1 -0
- package/dist/config.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/runtime/adapter-express.js +16 -16
- package/dist/runtime/adapter-fastify.js +16 -16
- package/dist/runtime/adapter-nestjs.js +10 -10
- package/dist/runtime/adapter-nextjs.js +15 -15
- package/dist/runtime/adapter-tanstack-cloudflare.js +15 -15
- package/dist/runtime/adapter-tanstack.js +15 -15
- package/dist/runtime/cloudflare-worker.js +17 -17
- package/dist/runtime/http.js +16 -16
- package/dist/runtime/stdio.js +12 -12
- package/dist/runtime/utils/component-visibility.d.ts +10 -0
- package/dist/runtime/utils/execution-logger.d.ts +7 -0
- package/dist/runtime/utils/resources.d.ts +2 -2
- package/dist/runtime/utils/server.d.ts +6 -6
- package/dist/runtime/vercel.js +22 -22
- package/package.json +12 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ComponentsConfig } from "@/config";
|
|
2
|
+
import type { ComponentMetadata } from "@/types/component";
|
|
3
|
+
type NamedComponentMetadata = ComponentMetadata & {
|
|
4
|
+
name?: string;
|
|
5
|
+
};
|
|
6
|
+
/** Filter before registration so generated UI resources follow their owning tool. */
|
|
7
|
+
export declare function filterComponents<T extends {
|
|
8
|
+
metadata?: NamedComponentMetadata;
|
|
9
|
+
}>(modules: Map<string, T>, rules?: ComponentsConfig): Map<string, T>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ResourceTemplate } from "@modelcontextprotocol/server";
|
|
2
|
+
import type { McpMiddleware } from "../../types/mcp-middleware";
|
|
3
|
+
/** Internal middleware shared by all transports. No user payloads reach the sink. */
|
|
4
|
+
export declare function createExecutionLogger(write?: (line: string) => void): {
|
|
5
|
+
middleware: McpMiddleware;
|
|
6
|
+
registerResource(name: string, uri: string | ResourceTemplate): void;
|
|
7
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/server";
|
|
1
|
+
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/server";
|
|
2
2
|
import { ResourceFile } from "./server";
|
|
3
3
|
/** Loads resources and injects them into the server */
|
|
4
|
-
export declare function addResourcesToServer(server: McpServer, resourcesModules: Map<string, ResourceFile
|
|
4
|
+
export declare function addResourcesToServer(server: McpServer, resourcesModules: Map<string, ResourceFile>, onRegister?: (name: string, uri: string | ResourceTemplate) => void): McpServer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ToolMetadata } from "@/types/tool";
|
|
1
|
+
import { Implementation, McpServer } from "@modelcontextprotocol/server";
|
|
2
|
+
import { ZodRawShape } from "zod/v3";
|
|
4
3
|
import { PromptMetadata } from "@/types/prompt";
|
|
5
|
-
import {
|
|
4
|
+
import { ResourceCompletions, ResourceMetadata } from "@/types/resource";
|
|
5
|
+
import { ToolMetadata } from "@/types/tool";
|
|
6
|
+
import { PromptArgsRawShape } from "./prompts";
|
|
6
7
|
import { UserPromptHandler } from "./transformers/prompt";
|
|
7
8
|
import { UserResourceHandler } from "./transformers/resource";
|
|
8
|
-
import {
|
|
9
|
-
import { ResourceMetadata, ResourceCompletions } from "@/types/resource";
|
|
9
|
+
import { UserToolHandler } from "./transformers/tool";
|
|
10
10
|
export type ToolFile = {
|
|
11
11
|
metadata: ToolMetadata;
|
|
12
12
|
schema: ZodRawShape;
|