all-in-one-mcp 1.0.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 +31 -0
- package/bin/all-in-one-mcp.mjs +17 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +132 -0
- package/dist/config/runtimeConfig.d.ts +6 -0
- package/dist/config/runtimeConfig.d.ts.map +1 -0
- package/dist/config/runtimeConfig.js +33 -0
- package/dist/contracts/constants.d.ts +4 -0
- package/dist/contracts/constants.d.ts.map +1 -0
- package/dist/contracts/constants.js +3 -0
- package/dist/contracts/index.d.ts +3 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/schemas.d.ts +325 -0
- package/dist/contracts/schemas.d.ts.map +1 -0
- package/dist/contracts/schemas.js +92 -0
- package/dist/database/sqliteStore.d.ts +14 -0
- package/dist/database/sqliteStore.d.ts.map +1 -0
- package/dist/database/sqliteStore.js +150 -0
- package/dist/events/broadcaster.d.ts +7 -0
- package/dist/events/broadcaster.d.ts.map +1 -0
- package/dist/events/broadcaster.js +16 -0
- package/dist/gateway/mcpGateway.d.ts +13 -0
- package/dist/gateway/mcpGateway.d.ts.map +1 -0
- package/dist/gateway/mcpGateway.js +105 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/logging/lineBuffer.d.ts +8 -0
- package/dist/logging/lineBuffer.d.ts.map +1 -0
- package/dist/logging/lineBuffer.js +26 -0
- package/dist/runtime.d.ts +42 -0
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +270 -0
- package/dist/server/httpServer.d.ts +14 -0
- package/dist/server/httpServer.d.ts.map +1 -0
- package/dist/server/httpServer.js +215 -0
- package/dist/supervisor/managedMcpSupervisor.d.ts +55 -0
- package/dist/supervisor/managedMcpSupervisor.d.ts.map +1 -0
- package/dist/supervisor/managedMcpSupervisor.js +309 -0
- package/dist/testing/index.d.ts +6 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +43 -0
- package/package.json +59 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# all-in-one-mcp
|
|
2
|
+
|
|
3
|
+
`all-in-one-mcp` is a managed MCP runtime that exposes:
|
|
4
|
+
|
|
5
|
+
- an HTTP MCP gateway at `/mcp`
|
|
6
|
+
- an admin API at `/api/mcps`
|
|
7
|
+
- a health endpoint at `/healthz`
|
|
8
|
+
- a stdio proxy mode for legacy MCP clients
|
|
9
|
+
|
|
10
|
+
## Run with npx
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npx all-in-one-mcp serve
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Useful flags:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx all-in-one-mcp serve --host 127.0.0.1 --port 4100 --database ./runtime.sqlite
|
|
20
|
+
npx all-in-one-mcp stdio-proxy --url http://127.0.0.1:4100/mcp
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Environment variables:
|
|
24
|
+
|
|
25
|
+
- `ALL_IN_ONE_MCP_HOST`
|
|
26
|
+
- `ALL_IN_ONE_MCP_PORT`
|
|
27
|
+
- `ALL_IN_ONE_MCP_DATABASE`
|
|
28
|
+
- `ALL_IN_ONE_MCP_URL`
|
|
29
|
+
- `ALL_IN_ONE_MCP_HOME`
|
|
30
|
+
|
|
31
|
+
If no database path is supplied, the runtime stores its SQLite database in the platform data directory for `all-in-one-mcp`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync } from 'node:fs'
|
|
4
|
+
import { dirname, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url'
|
|
6
|
+
|
|
7
|
+
const currentDir = dirname(fileURLToPath(import.meta.url))
|
|
8
|
+
const distEntry = resolve(currentDir, '../dist/cli.js')
|
|
9
|
+
|
|
10
|
+
if (!existsSync(distEntry)) {
|
|
11
|
+
process.stderr.write(
|
|
12
|
+
'The runtime CLI has not been built yet. Run "pnpm --filter all-in-one-mcp build" first.\n'
|
|
13
|
+
)
|
|
14
|
+
process.exit(1)
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
await import(pathToFileURL(distEntry).href)
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
4
|
+
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
|
|
5
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
6
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
7
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ToolListChangedNotificationSchema } from '@modelcontextprotocol/sdk/types.js';
|
|
8
|
+
import { startManagedMcpHttpServer } from './server/httpServer.js';
|
|
9
|
+
const require = createRequire(import.meta.url);
|
|
10
|
+
const { version } = require('../package.json');
|
|
11
|
+
function hasFlag(...flags) {
|
|
12
|
+
return flags.some((flag) => process.argv.includes(flag));
|
|
13
|
+
}
|
|
14
|
+
function readArgument(flag) {
|
|
15
|
+
const index = process.argv.indexOf(flag);
|
|
16
|
+
if (index < 0) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return process.argv[index + 1];
|
|
20
|
+
}
|
|
21
|
+
function parsePort(value) {
|
|
22
|
+
const port = Number(value);
|
|
23
|
+
if (!Number.isInteger(port) || port < 0 || port > 65_535) {
|
|
24
|
+
throw new Error(`Invalid port "${value}". Expected an integer between 0 and 65535.`);
|
|
25
|
+
}
|
|
26
|
+
return port;
|
|
27
|
+
}
|
|
28
|
+
function printUsage() {
|
|
29
|
+
process.stdout.write(`all-in-one-mcp v${version}
|
|
30
|
+
|
|
31
|
+
Usage:
|
|
32
|
+
all-in-one-mcp serve [--host 127.0.0.1] [--port 4100] [--database /path/to/runtime.sqlite]
|
|
33
|
+
all-in-one-mcp stdio-proxy --url http://127.0.0.1:4100/mcp
|
|
34
|
+
|
|
35
|
+
Environment:
|
|
36
|
+
ALL_IN_ONE_MCP_HOST
|
|
37
|
+
ALL_IN_ONE_MCP_PORT
|
|
38
|
+
ALL_IN_ONE_MCP_DATABASE
|
|
39
|
+
ALL_IN_ONE_MCP_URL
|
|
40
|
+
ALL_IN_ONE_MCP_HOME
|
|
41
|
+
`);
|
|
42
|
+
}
|
|
43
|
+
async function runStdioProxy(urlString) {
|
|
44
|
+
const client = new Client({
|
|
45
|
+
name: 'all-in-one-mcp-stdio-proxy',
|
|
46
|
+
version: '1.0.0'
|
|
47
|
+
}, {
|
|
48
|
+
capabilities: {}
|
|
49
|
+
});
|
|
50
|
+
const upstreamTransport = new StreamableHTTPClientTransport(new URL(urlString));
|
|
51
|
+
const stdioServer = new Server({
|
|
52
|
+
name: 'all-in-one-mcp-stdio-proxy',
|
|
53
|
+
version: '1.0.0'
|
|
54
|
+
}, {
|
|
55
|
+
capabilities: {
|
|
56
|
+
tools: {
|
|
57
|
+
listChanged: true
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
const stdioTransport = new StdioServerTransport();
|
|
62
|
+
stdioServer.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
63
|
+
return client.listTools();
|
|
64
|
+
});
|
|
65
|
+
stdioServer.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
66
|
+
return client.callTool({
|
|
67
|
+
name: request.params.name,
|
|
68
|
+
arguments: request.params.arguments
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
client.setNotificationHandler(ToolListChangedNotificationSchema, async () => {
|
|
72
|
+
await stdioServer.sendToolListChanged();
|
|
73
|
+
});
|
|
74
|
+
client.onerror = (error) => {
|
|
75
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
76
|
+
};
|
|
77
|
+
await client.connect(upstreamTransport);
|
|
78
|
+
await stdioServer.connect(stdioTransport);
|
|
79
|
+
}
|
|
80
|
+
async function main() {
|
|
81
|
+
if (hasFlag('--help', '-h')) {
|
|
82
|
+
printUsage();
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (hasFlag('--version', '-v')) {
|
|
86
|
+
process.stdout.write(`${version}\n`);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
const command = process.argv[2] && !process.argv[2].startsWith('--') ? process.argv[2] : 'serve';
|
|
90
|
+
if (command === 'serve') {
|
|
91
|
+
const host = readArgument('--host') ?? process.env.ALL_IN_ONE_MCP_HOST ?? '127.0.0.1';
|
|
92
|
+
const port = parsePort(readArgument('--port') ?? process.env.ALL_IN_ONE_MCP_PORT ?? '4100');
|
|
93
|
+
const databasePath = readArgument('--database') ?? process.env.ALL_IN_ONE_MCP_DATABASE;
|
|
94
|
+
const server = await startManagedMcpHttpServer({
|
|
95
|
+
host,
|
|
96
|
+
port,
|
|
97
|
+
databasePath
|
|
98
|
+
});
|
|
99
|
+
process.stdout.write(`all-in-one-mcp listening on http://${server.host}:${server.port}\n`);
|
|
100
|
+
process.stdout.write(`MCP endpoint: http://${server.host}:${server.port}/mcp\n`);
|
|
101
|
+
process.stdout.write(`Admin API: http://${server.host}:${server.port}/api/mcps\n`);
|
|
102
|
+
process.stdout.write(`Health: http://${server.host}:${server.port}/healthz\n`);
|
|
103
|
+
const shutdown = async () => {
|
|
104
|
+
await server.close();
|
|
105
|
+
process.exit(0);
|
|
106
|
+
};
|
|
107
|
+
process.once('SIGINT', () => {
|
|
108
|
+
void shutdown();
|
|
109
|
+
});
|
|
110
|
+
process.once('SIGTERM', () => {
|
|
111
|
+
void shutdown();
|
|
112
|
+
});
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
if (command === 'stdio-proxy') {
|
|
116
|
+
const url = readArgument('--url') ?? process.env.ALL_IN_ONE_MCP_URL;
|
|
117
|
+
if (!url) {
|
|
118
|
+
process.stderr.write('Missing required --url argument.\n');
|
|
119
|
+
process.exitCode = 1;
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
new URL(url);
|
|
123
|
+
await runStdioProxy(url);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
printUsage();
|
|
127
|
+
process.exitCode = 1;
|
|
128
|
+
}
|
|
129
|
+
void main().catch((error) => {
|
|
130
|
+
process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
131
|
+
process.exitCode = 1;
|
|
132
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtimeConfig.d.ts","sourceRoot":"","sources":["../../src/config/runtimeConfig.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB,CAAA;AAED,wBAAgB,2BAA2B,IAAI,MAAM,CAsBpD;AAED,wBAAgB,mBAAmB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAQjE"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { mkdirSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { dirname, join, resolve } from 'node:path';
|
|
4
|
+
export function resolveDefaultDataDirectory() {
|
|
5
|
+
const override = process.env.ALL_IN_ONE_MCP_HOME?.trim();
|
|
6
|
+
if (override) {
|
|
7
|
+
const resolvedOverride = resolve(override);
|
|
8
|
+
mkdirSync(resolvedOverride, { recursive: true });
|
|
9
|
+
return resolvedOverride;
|
|
10
|
+
}
|
|
11
|
+
let baseDirectory;
|
|
12
|
+
if (process.platform === 'win32' && process.env.LOCALAPPDATA?.trim()) {
|
|
13
|
+
baseDirectory = resolve(process.env.LOCALAPPDATA.trim(), 'all-in-one-mcp');
|
|
14
|
+
}
|
|
15
|
+
else if (process.platform === 'darwin') {
|
|
16
|
+
baseDirectory = resolve(homedir(), 'Library', 'Application Support', 'all-in-one-mcp');
|
|
17
|
+
}
|
|
18
|
+
else if (process.env.XDG_DATA_HOME?.trim()) {
|
|
19
|
+
baseDirectory = resolve(process.env.XDG_DATA_HOME.trim(), 'all-in-one-mcp');
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
baseDirectory = resolve(homedir(), '.local', 'share', 'all-in-one-mcp');
|
|
23
|
+
}
|
|
24
|
+
mkdirSync(baseDirectory, { recursive: true });
|
|
25
|
+
return baseDirectory;
|
|
26
|
+
}
|
|
27
|
+
export function resolveDatabasePath(databasePath) {
|
|
28
|
+
const resolvedPath = databasePath && databasePath.trim().length > 0
|
|
29
|
+
? resolve(databasePath)
|
|
30
|
+
: join(resolveDefaultDataDirectory(), 'all-in-one-mcp.sqlite');
|
|
31
|
+
mkdirSync(dirname(resolvedPath), { recursive: true });
|
|
32
|
+
return resolvedPath;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/contracts/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,aAAa,CAAA;AACrC,eAAO,MAAM,0BAA0B,QAAS,CAAA;AAChD,eAAO,MAAM,uBAAuB,OAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contracts/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,325 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const keyValuePairSchema: z.ZodObject<{
|
|
3
|
+
key: z.ZodString;
|
|
4
|
+
value: z.ZodString;
|
|
5
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
6
|
+
}, z.core.$strip>;
|
|
7
|
+
export declare const managedStdioMcpDefinitionSchema: z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
11
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
12
|
+
toolPrefix: z.ZodString;
|
|
13
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
14
|
+
transport: z.ZodLiteral<"stdio">;
|
|
15
|
+
command: z.ZodString;
|
|
16
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
17
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
18
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
19
|
+
key: z.ZodString;
|
|
20
|
+
value: z.ZodString;
|
|
21
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
}, z.core.$strip>>>;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
export declare const managedStreamableHttpMcpDefinitionSchema: z.ZodObject<{
|
|
25
|
+
id: z.ZodString;
|
|
26
|
+
name: z.ZodString;
|
|
27
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
28
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
29
|
+
toolPrefix: z.ZodString;
|
|
30
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
transport: z.ZodLiteral<"streamable-http">;
|
|
32
|
+
url: z.ZodURL;
|
|
33
|
+
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
34
|
+
key: z.ZodString;
|
|
35
|
+
value: z.ZodString;
|
|
36
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
37
|
+
}, z.core.$strip>>>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
export declare const managedMcpDefinitionSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
name: z.ZodString;
|
|
42
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
43
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
44
|
+
toolPrefix: z.ZodString;
|
|
45
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
46
|
+
transport: z.ZodLiteral<"stdio">;
|
|
47
|
+
command: z.ZodString;
|
|
48
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
49
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
50
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
51
|
+
key: z.ZodString;
|
|
52
|
+
value: z.ZodString;
|
|
53
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
name: z.ZodString;
|
|
58
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
59
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
60
|
+
toolPrefix: z.ZodString;
|
|
61
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
62
|
+
transport: z.ZodLiteral<"streamable-http">;
|
|
63
|
+
url: z.ZodURL;
|
|
64
|
+
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
65
|
+
key: z.ZodString;
|
|
66
|
+
value: z.ZodString;
|
|
67
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
}, z.core.$strip>>>;
|
|
69
|
+
}, z.core.$strip>], "transport">;
|
|
70
|
+
export declare const managedMcpStatusSchema: z.ZodEnum<{
|
|
71
|
+
error: "error";
|
|
72
|
+
stopped: "stopped";
|
|
73
|
+
starting: "starting";
|
|
74
|
+
ready: "ready";
|
|
75
|
+
degraded: "degraded";
|
|
76
|
+
stopping: "stopping";
|
|
77
|
+
}>;
|
|
78
|
+
export declare const managedToolSchema: z.ZodObject<{
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
upstreamName: z.ZodString;
|
|
81
|
+
title: z.ZodOptional<z.ZodString>;
|
|
82
|
+
description: z.ZodOptional<z.ZodString>;
|
|
83
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
84
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
86
|
+
execution: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
}, z.core.$strip>;
|
|
88
|
+
export declare const managedMcpSnapshotSchema: z.ZodObject<{
|
|
89
|
+
definition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
90
|
+
id: z.ZodString;
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
93
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
94
|
+
toolPrefix: z.ZodString;
|
|
95
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
96
|
+
transport: z.ZodLiteral<"stdio">;
|
|
97
|
+
command: z.ZodString;
|
|
98
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
99
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
100
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
101
|
+
key: z.ZodString;
|
|
102
|
+
value: z.ZodString;
|
|
103
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
106
|
+
id: z.ZodString;
|
|
107
|
+
name: z.ZodString;
|
|
108
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
109
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
110
|
+
toolPrefix: z.ZodString;
|
|
111
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
transport: z.ZodLiteral<"streamable-http">;
|
|
113
|
+
url: z.ZodURL;
|
|
114
|
+
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
115
|
+
key: z.ZodString;
|
|
116
|
+
value: z.ZodString;
|
|
117
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
118
|
+
}, z.core.$strip>>>;
|
|
119
|
+
}, z.core.$strip>], "transport">;
|
|
120
|
+
status: z.ZodEnum<{
|
|
121
|
+
error: "error";
|
|
122
|
+
stopped: "stopped";
|
|
123
|
+
starting: "starting";
|
|
124
|
+
ready: "ready";
|
|
125
|
+
degraded: "degraded";
|
|
126
|
+
stopping: "stopping";
|
|
127
|
+
}>;
|
|
128
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
129
|
+
name: z.ZodString;
|
|
130
|
+
upstreamName: z.ZodString;
|
|
131
|
+
title: z.ZodOptional<z.ZodString>;
|
|
132
|
+
description: z.ZodOptional<z.ZodString>;
|
|
133
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
134
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
135
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
136
|
+
execution: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
toolCount: z.ZodNumber;
|
|
139
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
140
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
141
|
+
updatedAt: z.ZodString;
|
|
142
|
+
}, z.core.$strip>;
|
|
143
|
+
export declare const managedMcpLogLevelSchema: z.ZodEnum<{
|
|
144
|
+
error: "error";
|
|
145
|
+
debug: "debug";
|
|
146
|
+
info: "info";
|
|
147
|
+
warn: "warn";
|
|
148
|
+
}>;
|
|
149
|
+
export declare const managedMcpLogSourceSchema: z.ZodEnum<{
|
|
150
|
+
transport: "transport";
|
|
151
|
+
manager: "manager";
|
|
152
|
+
stdout: "stdout";
|
|
153
|
+
stderr: "stderr";
|
|
154
|
+
upstream: "upstream";
|
|
155
|
+
}>;
|
|
156
|
+
export declare const managedMcpLogEntrySchema: z.ZodObject<{
|
|
157
|
+
id: z.ZodNumber;
|
|
158
|
+
mcpId: z.ZodString;
|
|
159
|
+
level: z.ZodEnum<{
|
|
160
|
+
error: "error";
|
|
161
|
+
debug: "debug";
|
|
162
|
+
info: "info";
|
|
163
|
+
warn: "warn";
|
|
164
|
+
}>;
|
|
165
|
+
source: z.ZodEnum<{
|
|
166
|
+
transport: "transport";
|
|
167
|
+
manager: "manager";
|
|
168
|
+
stdout: "stdout";
|
|
169
|
+
stderr: "stderr";
|
|
170
|
+
upstream: "upstream";
|
|
171
|
+
}>;
|
|
172
|
+
message: z.ZodString;
|
|
173
|
+
timestamp: z.ZodString;
|
|
174
|
+
}, z.core.$strip>;
|
|
175
|
+
export declare const managedMcpEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
176
|
+
type: z.ZodLiteral<"snapshot">;
|
|
177
|
+
snapshot: z.ZodObject<{
|
|
178
|
+
definition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
name: z.ZodString;
|
|
181
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
182
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
183
|
+
toolPrefix: z.ZodString;
|
|
184
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
185
|
+
transport: z.ZodLiteral<"stdio">;
|
|
186
|
+
command: z.ZodString;
|
|
187
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
188
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
189
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
190
|
+
key: z.ZodString;
|
|
191
|
+
value: z.ZodString;
|
|
192
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
193
|
+
}, z.core.$strip>>>;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
id: z.ZodString;
|
|
196
|
+
name: z.ZodString;
|
|
197
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
198
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
199
|
+
toolPrefix: z.ZodString;
|
|
200
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
201
|
+
transport: z.ZodLiteral<"streamable-http">;
|
|
202
|
+
url: z.ZodURL;
|
|
203
|
+
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
204
|
+
key: z.ZodString;
|
|
205
|
+
value: z.ZodString;
|
|
206
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
}, z.core.$strip>>>;
|
|
208
|
+
}, z.core.$strip>], "transport">;
|
|
209
|
+
status: z.ZodEnum<{
|
|
210
|
+
error: "error";
|
|
211
|
+
stopped: "stopped";
|
|
212
|
+
starting: "starting";
|
|
213
|
+
ready: "ready";
|
|
214
|
+
degraded: "degraded";
|
|
215
|
+
stopping: "stopping";
|
|
216
|
+
}>;
|
|
217
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
218
|
+
name: z.ZodString;
|
|
219
|
+
upstreamName: z.ZodString;
|
|
220
|
+
title: z.ZodOptional<z.ZodString>;
|
|
221
|
+
description: z.ZodOptional<z.ZodString>;
|
|
222
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
223
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
224
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
225
|
+
execution: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
226
|
+
}, z.core.$strip>>;
|
|
227
|
+
toolCount: z.ZodNumber;
|
|
228
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
229
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
230
|
+
updatedAt: z.ZodString;
|
|
231
|
+
}, z.core.$strip>;
|
|
232
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
233
|
+
type: z.ZodLiteral<"log">;
|
|
234
|
+
entry: z.ZodObject<{
|
|
235
|
+
id: z.ZodNumber;
|
|
236
|
+
mcpId: z.ZodString;
|
|
237
|
+
level: z.ZodEnum<{
|
|
238
|
+
error: "error";
|
|
239
|
+
debug: "debug";
|
|
240
|
+
info: "info";
|
|
241
|
+
warn: "warn";
|
|
242
|
+
}>;
|
|
243
|
+
source: z.ZodEnum<{
|
|
244
|
+
transport: "transport";
|
|
245
|
+
manager: "manager";
|
|
246
|
+
stdout: "stdout";
|
|
247
|
+
stderr: "stderr";
|
|
248
|
+
upstream: "upstream";
|
|
249
|
+
}>;
|
|
250
|
+
message: z.ZodString;
|
|
251
|
+
timestamp: z.ZodString;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
254
|
+
type: z.ZodLiteral<"removed">;
|
|
255
|
+
mcpId: z.ZodString;
|
|
256
|
+
}, z.core.$strip>], "type">;
|
|
257
|
+
export declare const managedMcpCollectionSchema: z.ZodObject<{
|
|
258
|
+
items: z.ZodArray<z.ZodObject<{
|
|
259
|
+
definition: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
260
|
+
id: z.ZodString;
|
|
261
|
+
name: z.ZodString;
|
|
262
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
263
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
264
|
+
toolPrefix: z.ZodString;
|
|
265
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
266
|
+
transport: z.ZodLiteral<"stdio">;
|
|
267
|
+
command: z.ZodString;
|
|
268
|
+
args: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
269
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
270
|
+
env: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
271
|
+
key: z.ZodString;
|
|
272
|
+
value: z.ZodString;
|
|
273
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
274
|
+
}, z.core.$strip>>>;
|
|
275
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
276
|
+
id: z.ZodString;
|
|
277
|
+
name: z.ZodString;
|
|
278
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
279
|
+
autoStart: z.ZodDefault<z.ZodBoolean>;
|
|
280
|
+
toolPrefix: z.ZodString;
|
|
281
|
+
startupTimeoutMs: z.ZodDefault<z.ZodNumber>;
|
|
282
|
+
transport: z.ZodLiteral<"streamable-http">;
|
|
283
|
+
url: z.ZodURL;
|
|
284
|
+
headers: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
285
|
+
key: z.ZodString;
|
|
286
|
+
value: z.ZodString;
|
|
287
|
+
masked: z.ZodOptional<z.ZodBoolean>;
|
|
288
|
+
}, z.core.$strip>>>;
|
|
289
|
+
}, z.core.$strip>], "transport">;
|
|
290
|
+
status: z.ZodEnum<{
|
|
291
|
+
error: "error";
|
|
292
|
+
stopped: "stopped";
|
|
293
|
+
starting: "starting";
|
|
294
|
+
ready: "ready";
|
|
295
|
+
degraded: "degraded";
|
|
296
|
+
stopping: "stopping";
|
|
297
|
+
}>;
|
|
298
|
+
tools: z.ZodArray<z.ZodObject<{
|
|
299
|
+
name: z.ZodString;
|
|
300
|
+
upstreamName: z.ZodString;
|
|
301
|
+
title: z.ZodOptional<z.ZodString>;
|
|
302
|
+
description: z.ZodOptional<z.ZodString>;
|
|
303
|
+
inputSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
304
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
305
|
+
annotations: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
306
|
+
execution: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
307
|
+
}, z.core.$strip>>;
|
|
308
|
+
toolCount: z.ZodNumber;
|
|
309
|
+
pid: z.ZodNullable<z.ZodNumber>;
|
|
310
|
+
lastError: z.ZodOptional<z.ZodString>;
|
|
311
|
+
updatedAt: z.ZodString;
|
|
312
|
+
}, z.core.$strip>>;
|
|
313
|
+
generatedAt: z.ZodString;
|
|
314
|
+
}, z.core.$strip>;
|
|
315
|
+
export type KeyValuePair = z.infer<typeof keyValuePairSchema>;
|
|
316
|
+
export type ManagedMcpDefinition = z.infer<typeof managedMcpDefinitionSchema>;
|
|
317
|
+
export type ManagedStdioMcpDefinition = z.infer<typeof managedStdioMcpDefinitionSchema>;
|
|
318
|
+
export type ManagedStreamableHttpMcpDefinition = z.infer<typeof managedStreamableHttpMcpDefinitionSchema>;
|
|
319
|
+
export type ManagedMcpStatus = z.infer<typeof managedMcpStatusSchema>;
|
|
320
|
+
export type ManagedTool = z.infer<typeof managedToolSchema>;
|
|
321
|
+
export type ManagedMcpSnapshot = z.infer<typeof managedMcpSnapshotSchema>;
|
|
322
|
+
export type ManagedMcpLogEntry = z.infer<typeof managedMcpLogEntrySchema>;
|
|
323
|
+
export type ManagedMcpEvent = z.infer<typeof managedMcpEventSchema>;
|
|
324
|
+
export type ManagedMcpCollection = z.infer<typeof managedMcpCollectionSchema>;
|
|
325
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/contracts/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAWvB,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAA;AAWF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;iBAM1C,CAAA;AAEF,eAAO,MAAM,wCAAwC;;;;;;;;;;;;;;iBAInD,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAGrC,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;EAOjC,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;iBAS5B,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQnC,CAAA;AAEF,eAAO,MAAM,wBAAwB;;;;;EAA6C,CAAA;AAClF,eAAO,MAAM,yBAAyB;;;;;;EAAmE,CAAA;AAEzG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;iBAOnC,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAahC,CAAA;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAGrC,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAC7D,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAC7E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AACvF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wCAAwC,CAAC,CAAA;AACzG,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AACrE,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC3D,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AACzE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AACnE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
|