@poolzin/pool-bot 2026.4.34 → 2026.4.35
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/build-info.json +3 -3
- package/dist/cli/mcp-cli.d.ts +2 -1
- package/dist/cli/mcp-cli.d.ts.map +1 -1
- package/dist/cli/mcp-cli.js +47 -30
- package/dist/cli/program/register.subclis.d.ts.map +1 -1
- package/dist/cli/program/register.subclis.js +9 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +5 -2
- package/docs/mcp-server.md +19 -0
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
package/dist/cli/mcp-cli.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
|
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"}
|
package/dist/cli/mcp-cli.js
CHANGED
|
@@ -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
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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;
|
|
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",
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -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;
|
|
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"}
|
package/dist/mcp/server.js
CHANGED
|
@@ -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)) {
|
|
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
|
|
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 {
|
package/docs/mcp-server.md
CHANGED
|
@@ -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
|
+
```
|