@maplezzk/mcps 1.0.2 → 1.0.4
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/commands/daemon.js +4 -1
- package/dist/core/config.js +2 -1
- package/dist/index.js +4 -1
- package/dist/types/config.js +2 -2
- package/package.json +1 -1
package/dist/commands/daemon.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import http from 'http';
|
|
2
2
|
import chalk from 'chalk';
|
|
3
3
|
import { connectionPool } from '../core/pool.js';
|
|
4
|
+
import { createRequire } from 'module';
|
|
5
|
+
const require = createRequire(import.meta.url);
|
|
6
|
+
const pkg = require('../../package.json');
|
|
4
7
|
const PORT = 4100;
|
|
5
8
|
export const registerDaemonCommand = (program) => {
|
|
6
9
|
const daemonCmd = program.command('daemon')
|
|
@@ -56,7 +59,7 @@ const startDaemon = (port) => {
|
|
|
56
59
|
}
|
|
57
60
|
if (req.method === 'GET' && req.url === '/status') {
|
|
58
61
|
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
59
|
-
res.end(JSON.stringify({ status: 'running', version:
|
|
62
|
+
res.end(JSON.stringify({ status: 'running', version: pkg.version }));
|
|
60
63
|
return;
|
|
61
64
|
}
|
|
62
65
|
// ... (restart/stop/call handlers) ...
|
package/dist/core/config.js
CHANGED
|
@@ -30,9 +30,10 @@ export class ConfigManager {
|
|
|
30
30
|
servers = json.servers;
|
|
31
31
|
}
|
|
32
32
|
else if (json.mcpServers && typeof json.mcpServers === 'object') {
|
|
33
|
-
// Convert map to array
|
|
33
|
+
// Convert map to array and add default type='stdio' if missing
|
|
34
34
|
servers = Object.entries(json.mcpServers).map(([name, config]) => ({
|
|
35
35
|
name,
|
|
36
|
+
type: config.type || (config.command ? 'stdio' : undefined), // Auto-detect type
|
|
36
37
|
...config
|
|
37
38
|
}));
|
|
38
39
|
}
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,14 @@ import { registerServerCommands } from './commands/server.js';
|
|
|
4
4
|
import { registerToolsCommand } from './commands/tools.js';
|
|
5
5
|
import { registerCallCommand } from './commands/call.js';
|
|
6
6
|
import { registerDaemonCommand } from './commands/daemon.js';
|
|
7
|
+
import { createRequire } from 'module';
|
|
8
|
+
const require = createRequire(import.meta.url);
|
|
9
|
+
const pkg = require('../package.json');
|
|
7
10
|
const program = new Command();
|
|
8
11
|
program
|
|
9
12
|
.name('mcps')
|
|
10
13
|
.description('A CLI to manage and use MCP servers')
|
|
11
|
-
.version(
|
|
14
|
+
.version(pkg.version);
|
|
12
15
|
registerServerCommands(program);
|
|
13
16
|
registerToolsCommand(program);
|
|
14
17
|
registerCallCommand(program);
|
package/dist/types/config.js
CHANGED
|
@@ -2,9 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
export const ServerConfigSchema = z.union([
|
|
3
3
|
z.object({
|
|
4
4
|
name: z.string(),
|
|
5
|
-
type: z.literal('stdio'),
|
|
5
|
+
type: z.literal('stdio').optional().default('stdio'),
|
|
6
6
|
command: z.string(),
|
|
7
|
-
args: z.array(z.string()).default([]),
|
|
7
|
+
args: z.array(z.string()).optional().default([]),
|
|
8
8
|
env: z.record(z.string()).optional(),
|
|
9
9
|
}).passthrough(),
|
|
10
10
|
z.object({
|