xmcp 0.0.17 → 0.0.18

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.
@@ -1,4 +1,5 @@
1
1
  import { CompilerMode } from ".";
2
+ import { XmcpParsedConfig } from "./parse-xmcp-config";
2
3
  interface CompilerContext {
3
4
  /** The mode of the compiler. */
4
5
  mode: CompilerMode;
@@ -13,7 +14,10 @@ interface CompilerContext {
13
14
  toolPaths: Set<string>;
14
15
  /** Whether the middleware is enabled. */
15
16
  hasMiddleware: boolean;
17
+ /** The parsed config. */
18
+ xmcpConfig?: XmcpParsedConfig;
16
19
  }
17
20
  export declare const compilerContext: import("../utils/context").Context<CompilerContext>;
18
21
  export declare const compilerContextProvider: (initialValue: Omit<CompilerContext, "toolPaths" | "hasMiddleware">, callback: () => void) => void;
22
+ export declare const getXmcpConfig: () => XmcpParsedConfig;
19
23
  export {};
@@ -0,0 +1,7 @@
1
+ import { Configuration } from "webpack";
2
+ /**
3
+ * This function will decide is a file is bundled by xmcp compiler or not.
4
+ * We want to avoid building node modules.
5
+ * When using Next.js, we want to avoid building tools/*, since the nexjs compiler will handle that code.
6
+ */
7
+ export declare function getExternals(): Configuration["externals"];
@@ -0,0 +1,8 @@
1
+ import { Compiler } from "webpack";
2
+ export declare const runtimeFiles: Record<string, string>;
3
+ export declare class InjectRuntimePlugin {
4
+ apply(compiler: Compiler): void;
5
+ }
6
+ export declare class CreateTypeDefinitionPlugin {
7
+ apply(compiler: Compiler): void;
8
+ }
@@ -4,6 +4,7 @@ export declare const DEFAULT_HTTP_PORT = 3002;
4
4
  export declare const DEFAULT_HTTP_BODY_SIZE_LIMIT: number;
5
5
  export declare const DEFAULT_HTTP_ENDPOINT = "/mcp";
6
6
  export declare const DEFAULT_HTTP_STATELESS = true;
7
+ export declare const DEFAULT_TOOLS_DIR = "src/tools";
7
8
  declare const configSchema: z.ZodObject<{
8
9
  stdio: z.ZodOptional<z.ZodBoolean>;
9
10
  http: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
@@ -115,6 +116,7 @@ declare const configSchema: z.ZodObject<{
115
116
  }>>;
116
117
  adapter: z.ZodOptional<z.ZodEnum<["express", "nextjs"]>>;
117
118
  }, "strip", z.ZodTypeAny, {
119
+ adapter?: "express" | "nextjs" | undefined;
118
120
  oauth?: {
119
121
  endpoints: {
120
122
  authorizationUrl: string;
@@ -129,8 +131,8 @@ declare const configSchema: z.ZodObject<{
129
131
  defaultScopes: string[];
130
132
  serviceDocumentationUrl?: string | undefined;
131
133
  } | undefined;
132
- adapter?: "express" | "nextjs" | undefined;
133
134
  }, {
135
+ adapter?: "express" | "nextjs" | undefined;
134
136
  oauth?: {
135
137
  endpoints: {
136
138
  authorizationUrl: string;
@@ -145,10 +147,19 @@ declare const configSchema: z.ZodObject<{
145
147
  pathPrefix?: string | undefined;
146
148
  defaultScopes?: string[] | undefined;
147
149
  } | undefined;
148
- adapter?: "express" | "nextjs" | undefined;
149
150
  }>>;
151
+ paths: z.ZodDefault<z.ZodOptional<z.ZodObject<{
152
+ tools: z.ZodDefault<z.ZodString>;
153
+ }, "strip", z.ZodTypeAny, {
154
+ tools: string;
155
+ }, {
156
+ tools?: string | undefined;
157
+ }>>>;
150
158
  webpack: z.ZodOptional<z.ZodFunction<z.ZodTuple<[z.ZodAny], z.ZodUnknown>, z.ZodAny>>;
151
159
  }, "strip", z.ZodTypeAny, {
160
+ paths: {
161
+ tools: string;
162
+ };
152
163
  stdio?: boolean | undefined;
153
164
  http?: boolean | {
154
165
  port: number;
@@ -165,6 +176,7 @@ declare const configSchema: z.ZodObject<{
165
176
  } | undefined;
166
177
  } | undefined;
167
178
  experimental?: {
179
+ adapter?: "express" | "nextjs" | undefined;
168
180
  oauth?: {
169
181
  endpoints: {
170
182
  authorizationUrl: string;
@@ -179,7 +191,6 @@ declare const configSchema: z.ZodObject<{
179
191
  defaultScopes: string[];
180
192
  serviceDocumentationUrl?: string | undefined;
181
193
  } | undefined;
182
- adapter?: "express" | "nextjs" | undefined;
183
194
  } | undefined;
184
195
  webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
185
196
  }, {
@@ -199,6 +210,7 @@ declare const configSchema: z.ZodObject<{
199
210
  } | undefined;
200
211
  } | undefined;
201
212
  experimental?: {
213
+ adapter?: "express" | "nextjs" | undefined;
202
214
  oauth?: {
203
215
  endpoints: {
204
216
  authorizationUrl: string;
@@ -213,7 +225,9 @@ declare const configSchema: z.ZodObject<{
213
225
  pathPrefix?: string | undefined;
214
226
  defaultScopes?: string[] | undefined;
215
227
  } | undefined;
216
- adapter?: "express" | "nextjs" | undefined;
228
+ } | undefined;
229
+ paths?: {
230
+ tools?: string | undefined;
217
231
  } | undefined;
218
232
  webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
219
233
  }>;