@poolzin/pool-bot 2026.4.34 → 2026.4.36

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.4.34",
3
- "commit": "b8effc9024bae6e44840b2e4f8f46cc63126bd61",
4
- "builtAt": "2026-04-07T11:05:36.639Z"
2
+ "version": "2026.4.36",
3
+ "commit": "713ea950b901906b93c4bd9d8a313731671f40e5",
4
+ "builtAt": "2026-04-07T11:46:07.534Z"
5
5
  }
@@ -6,5 +6,6 @@
6
6
  * poolbot mcp serve --http # Start MCP server on HTTP (port 3000)
7
7
  * poolbot mcp serve --http --port 3001
8
8
  */
9
- export declare function runMCPCLI(args: string[]): Promise<void>;
9
+ import type { Command } from "commander";
10
+ export declare function registerMCPCli(program: Command): void;
10
11
  //# sourceMappingURL=mcp-cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-cli.d.ts","sourceRoot":"","sources":["../../src/cli/mcp-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAmC7D"}
1
+ {"version":3,"file":"mcp-cli.d.ts","sourceRoot":"","sources":["../../src/cli/mcp-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AASzC,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,QAqD9C"}
@@ -9,36 +9,53 @@
9
9
  import { runMCPServer } from "../mcp/server.js";
10
10
  import { loadConfig } from "../config/config.js";
11
11
  import { resolveDefaultAgentId } from "../agents/agent-scope.js";
12
- export async function runMCPCLI(args) {
13
- const config = loadConfig();
14
- const agentId = resolveDefaultAgentId(config);
15
- const isHTTP = args.includes("--http");
16
- const portArg = args.find((arg) => arg.startsWith("--port="));
17
- const port = portArg ? parseInt(portArg.split("=")[1], 10) : undefined;
18
- const readOnly = args.includes("--read-only");
19
- console.error("Starting PoolBot MCP Server...");
20
- console.error(` Agent: ${agentId}`);
21
- console.error(` Mode: ${isHTTP ? "HTTP" : "stdio"}`);
22
- if (isHTTP) {
23
- console.error(` Port: ${port || 3000}`);
24
- }
25
- if (readOnly) {
26
- console.error(" Read-only mode: enabled");
27
- }
28
- console.error("");
29
- console.error("For Claude Desktop, add to claude_desktop_config.json:");
30
- console.error(JSON.stringify({
31
- mcpServers: {
32
- poolbot: {
33
- command: "poolbot",
34
- args: ["mcp", "serve"],
12
+ import { runCommandWithRuntime } from "./cli-utils.js";
13
+ import { defaultRuntime } from "../runtime.js";
14
+ import { theme } from "../terminal/theme.js";
15
+ import { formatDocsLink } from "../terminal/links.js";
16
+ export function registerMCPCli(program) {
17
+ const mcp = program
18
+ .command("mcp")
19
+ .description("Model Context Protocol server for PoolBot")
20
+ .addHelpText("after", () => `\n${theme.muted("Docs:")} ${formatDocsLink("/mcp-server", "docs.molt.bot/mcp-server")}\n`);
21
+ mcp
22
+ .command("serve")
23
+ .description("Start MCP server")
24
+ .option("--http", "Use HTTP transport instead of stdio")
25
+ .option("--port <number>", "HTTP port (default: 3000)")
26
+ .option("--read-only", "Disable send_message tool")
27
+ .action(async (opts) => {
28
+ const config = loadConfig();
29
+ const agentId = resolveDefaultAgentId(config);
30
+ const isHTTP = opts.http === true;
31
+ const port = opts.port ? parseInt(opts.port, 10) : undefined;
32
+ const readOnly = opts.readOnly === true;
33
+ defaultRuntime.log("Starting PoolBot MCP Server...");
34
+ defaultRuntime.log(` Agent: ${agentId}`);
35
+ defaultRuntime.log(` Mode: ${isHTTP ? "HTTP" : "stdio"}`);
36
+ if (isHTTP) {
37
+ defaultRuntime.log(` Port: ${port || 3000}`);
38
+ }
39
+ if (readOnly) {
40
+ defaultRuntime.log(" Read-only mode: enabled");
41
+ }
42
+ defaultRuntime.log("");
43
+ defaultRuntime.log("For Claude Desktop, add to claude_desktop_config.json:");
44
+ defaultRuntime.log(JSON.stringify({
45
+ mcpServers: {
46
+ poolbot: {
47
+ command: "poolbot",
48
+ args: ["mcp", "serve"],
49
+ },
35
50
  },
36
- },
37
- }, null, 2));
38
- console.error("");
39
- await runMCPServer({
40
- agentId,
41
- httpPort: port,
42
- readOnly,
51
+ }, null, 2));
52
+ defaultRuntime.log("");
53
+ await runCommandWithRuntime(defaultRuntime, async () => {
54
+ await runMCPServer({
55
+ agentId,
56
+ httpPort: port,
57
+ readOnly,
58
+ });
59
+ });
43
60
  });
44
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"register.subclis.d.ts","sourceRoot":"","sources":["../../../src/cli/program/register.subclis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAElE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AA8RF,wBAAgB,gBAAgB,IAAI,WAAW,EAAE,CAEhD;AAED,wBAAgB,gCAAgC,IAAI,MAAM,EAAE,CAE3D;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ3F;AAaD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,MAAM,EAAiB,QAkBrF"}
1
+ {"version":3,"file":"register.subclis.d.ts","sourceRoot":"","sources":["../../../src/cli/program/register.subclis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAOzC,KAAK,eAAe,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAElE,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAuSF,wBAAgB,gBAAgB,IAAI,WAAW,EAAE,CAEhD;AAED,wBAAgB,gCAAgC,IAAI,MAAM,EAAE,CAE3D;AAED,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ3F;AAaD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,MAAM,EAAiB,QAkBrF"}
@@ -263,6 +263,15 @@ const entries = [
263
263
  mod.registerUpdateCli(program);
264
264
  },
265
265
  },
266
+ {
267
+ name: "mcp",
268
+ description: "Model Context Protocol server",
269
+ hasSubcommands: true,
270
+ register: async (program) => {
271
+ const mod = await import("../mcp-cli.js");
272
+ mod.registerMCPCli(program);
273
+ },
274
+ },
266
275
  {
267
276
  name: "completion",
268
277
  description: "Generate shell completion script",
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqBH,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA0HD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,GAAE,gBAAqB;IA2B1C,OAAO,CAAC,aAAa;IAiSrB;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjC;;OAEG;IACG,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB7C;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B;AAID,wBAAsB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BhF"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAqBH,UAAU,gBAAgB;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA+HD,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;gBAEZ,OAAO,GAAE,gBAAqB;IA2B1C,OAAO,CAAC,aAAa;IAySrB;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAMjC;;OAEG;IACG,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB7C;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG5B;AAID,wBAAsB,YAAY,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CA4BhF"}
@@ -81,7 +81,8 @@ function searchSessions(workspaceDir, agentId, query, limit = 10) {
81
81
  const sessions = loadSessions(workspaceDir, agentId);
82
82
  const results = [];
83
83
  const queryLower = query.toLowerCase();
84
- for (const session of sessions.slice(0, 50)) { // Limit search to recent 50 sessions
84
+ for (const session of sessions.slice(0, 50)) {
85
+ // Limit search to recent 50 sessions
85
86
  const messages = loadSessionMessages(workspaceDir, agentId, session.sessionKey);
86
87
  const matches = [];
87
88
  for (const msg of messages) {
@@ -344,7 +345,9 @@ export class PoolBotMCPServer {
344
345
  totalMessages,
345
346
  sessionsLast24h: last24h,
346
347
  sessionsLast7d: last7d,
347
- oldestSession: sessions.length > 0 ? new Date(sessions[sessions.length - 1].createdAt).toISOString() : null,
348
+ oldestSession: sessions.length > 0
349
+ ? new Date(sessions[sessions.length - 1].createdAt).toISOString()
350
+ : null,
348
351
  newestSession: sessions.length > 0 ? new Date(sessions[0].updatedAt).toISOString() : null,
349
352
  };
350
353
  return {
@@ -169,3 +169,22 @@ The MCP server:
169
169
  - [Model Context Protocol Documentation](https://modelcontextprotocol.io/)
170
170
  - [Claude Desktop MCP Setup](https://claude.ai/mcp)
171
171
  - [PoolBot Documentation](/docs/)
172
+
173
+ ## Direct Usage (without CLI integration)
174
+
175
+ If the `poolbot mcp serve` command is not available in your version, you can run the MCP server directly with Node.js:
176
+
177
+ ```bash
178
+ # stdio mode
179
+ node -e "import('@poolzin/pool-bot/dist/mcp/server.js').then(m => m.runMCPServer())"
180
+
181
+ # HTTP mode
182
+ node -e "import('@poolzin/pool-bot/dist/mcp/server.js').then(m => m.runMCPServer(['--http', '--port=3000']))"
183
+ ```
184
+
185
+ Or create a wrapper script:
186
+
187
+ ```bash
188
+ #!/bin/bash
189
+ node -e "import('@poolzin/pool-bot/dist/mcp/server.js').then(m => m.runMCPServer(process.argv.slice(2)))" "$@"
190
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolzin/pool-bot",
3
- "version": "2026.4.34",
3
+ "version": "2026.4.36",
4
4
  "description": "🎱 Pool Bot - AI assistant with PLCODE integrations",
5
5
  "keywords": [],
6
6
  "license": "MIT",
@@ -321,14 +321,14 @@
321
321
  "undici": "^7.21.0",
322
322
  "ws": "^8.19.0",
323
323
  "yaml": "^2.8.2",
324
- "zod": "^4.3.6"
324
+ "zod": "^4.3.6",
325
+ "@modelcontextprotocol/sdk": "^1.27.1"
325
326
  },
326
327
  "devDependencies": {
327
328
  "@discordjs/voice": "^0.19.0",
328
329
  "@grammyjs/types": "^3.24.0",
329
330
  "@lit-labs/signals": "^0.2.0",
330
331
  "@lit/context": "^1.1.6",
331
- "@modelcontextprotocol/sdk": "^1.27.1",
332
332
  "@types/express": "^5.0.6",
333
333
  "@types/markdown-it": "^14.1.2",
334
334
  "@types/node": "^25.2.2",