mcp-simple-gateway
Version:
MCP Simple Gateway
495 lines (494 loc) • 16.4 kB
TypeScript
import { z } from 'zod';
import { TransportType } from './../../types/config.js';
export declare const transportTypeSchema: z.ZodNativeEnum<typeof TransportType>;
export declare const commonProxyOptionsSchema: z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>;
export declare const mcpStdioServerConfigSchema: z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.STDIO>>;
command: z.ZodString;
args: z.ZodArray<z.ZodString, "many">;
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
cwd: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}>;
export declare const mcpSSEServerConfigSchema: z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.SSE>>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}>;
export declare const mcpStreamableHTTPServerConfigSchema: z.ZodObject<{
type: z.ZodLiteral<TransportType.STREAMABLE_HTTP>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}>;
export declare const mcpServerConfigSchema: z.ZodUnion<[z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.STDIO>>;
command: z.ZodString;
args: z.ZodArray<z.ZodString, "many">;
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
cwd: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.SSE>>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}>, z.ZodObject<{
type: z.ZodLiteral<TransportType.STREAMABLE_HTTP>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}>]>;
export declare const mcpServerProxyBaseConfigSchema: z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>;
export declare const mcpStdioServerProxyConfigSchema: z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.STDIO>>;
command: z.ZodString;
args: z.ZodArray<z.ZodString, "many">;
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
cwd: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}>>;
export declare const mcpSSEServerProxyConfigSchema: z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.SSE>>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}>>;
export declare const mcpStreamableHTTPServerProxyConfigSchema: z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodLiteral<TransportType.STREAMABLE_HTTP>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}>>;
export declare const mcpServerProxyConfigSchema: z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.STDIO>>;
command: z.ZodString;
args: z.ZodArray<z.ZodString, "many">;
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
cwd: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}>>, z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.SSE>>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}>>, z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodLiteral<TransportType.STREAMABLE_HTTP>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}>>]>;
export declare const proxyServerConfigSchema: z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
} & {
logLevel: z.ZodOptional<z.ZodAny>;
logPretty: z.ZodOptional<z.ZodBoolean>;
cors: z.ZodOptional<z.ZodAny>;
}, "strip", z.ZodTypeAny, {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
}, {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
}>;
export declare const configSchema: z.ZodObject<{
proxyServer: z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
} & {
logLevel: z.ZodOptional<z.ZodAny>;
logPretty: z.ZodOptional<z.ZodBoolean>;
cors: z.ZodOptional<z.ZodAny>;
}, "strip", z.ZodTypeAny, {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
}, {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
}>;
mcpServers: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.STDIO>>;
command: z.ZodString;
args: z.ZodArray<z.ZodString, "many">;
env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
cwd: z.ZodOptional<z.ZodString>;
}, "strip", z.ZodTypeAny, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}, {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}>>, z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodOptional<z.ZodLiteral<TransportType.SSE>>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}, {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}>>, z.ZodIntersection<z.ZodObject<{
proxyOptions: z.ZodOptional<z.ZodObject<{
authTokens: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
}, "strip", z.ZodTypeAny, {
authTokens?: string[] | undefined;
}, {
authTokens?: string[] | undefined;
}>>;
}, "strip", z.ZodTypeAny, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}, {
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
}>, z.ZodObject<{
type: z.ZodLiteral<TransportType.STREAMABLE_HTTP>;
url: z.ZodString;
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
}, "strip", z.ZodTypeAny, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}, {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
}>>]>>;
}, "strip", z.ZodTypeAny, {
proxyServer: {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
};
mcpServers: Record<string, ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}) | ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}) | ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
})>;
}, {
proxyServer: {
logLevel?: any;
logPretty?: boolean | undefined;
cors?: any;
authTokens?: string[] | undefined;
};
mcpServers: Record<string, ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
command: string;
args: string[];
type?: TransportType.STDIO | undefined;
env?: Record<string, string> | undefined;
cwd?: string | undefined;
}) | ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
url: string;
type?: TransportType.SSE | undefined;
headers?: Record<string, string> | undefined;
}) | ({
proxyOptions?: {
authTokens?: string[] | undefined;
} | undefined;
} & {
type: TransportType.STREAMABLE_HTTP;
url: string;
headers?: Record<string, string> | undefined;
})>;
}>;