@maplezzk/mcps 1.0.3 → 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/index.js +4 -1
- 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/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);
|