xmcp 0.0.17 → 0.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/README.md +24 -17
- package/dist/cli.js +2 -2
- package/dist/compiler/compiler-context.d.ts +4 -0
- package/dist/compiler/get-webpack-config/get-externals.d.ts +7 -0
- package/dist/compiler/get-webpack-config/plugins.d.ts +8 -0
- package/dist/compiler/parse-xmcp-config.d.ts +18 -4
- package/dist/runtime/adapter-express.js +1 -1
- package/dist/runtime/adapter-express.js.LICENSE.txt +237 -0
- package/dist/runtime/adapter-nextjs.js +2 -1
- package/dist/runtime/{118.js.LICENSE.txt → adapter-nextjs.js.LICENSE.txt} +2 -0
- package/dist/runtime/headers.js +1 -1
- package/dist/runtime/http.js +1 -1
- package/dist/runtime/http.js.LICENSE.txt +237 -0
- package/dist/runtime/stdio.js +2 -1
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/fs-utils.d.ts +1 -0
- package/dist/utils/path-validation.d.ts +3 -0
- package/package.json +7 -6
- package/dist/runtime/118.js +0 -2
- package/dist/runtime/267.js +0 -1
- package/dist/runtime/382.js +0 -1
- package/dist/runtime/386.js +0 -2
- package/dist/runtime/562.js +0 -2
- package/dist/runtime/562.js.LICENSE.txt +0 -197
- package/dist/runtime/895.js +0 -1
- /package/dist/runtime/{386.js.LICENSE.txt → stdio.js.LICENSE.txt} +0 -0
|
@@ -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
|
-
|
|
228
|
+
} | undefined;
|
|
229
|
+
paths?: {
|
|
230
|
+
tools?: string | undefined;
|
|
217
231
|
} | undefined;
|
|
218
232
|
webpack?: ((args_0: any, ...args: unknown[]) => any) | undefined;
|
|
219
233
|
}>;
|