@dashclaw/mcp-server 1.0.0 → 1.0.1
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 +6 -3
- package/bin/dashclaw-mcp.js +25 -1
- package/lib/server.js +6 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ MCP server for [DashClaw](https://github.com/ucsandman/DashClaw) governance. Exp
|
|
|
7
7
|
### Claude Desktop / Claude Code (stdio)
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npx @dashclaw/mcp-server --url https://your-dashclaw.vercel.app --key oc_live_xxx
|
|
10
|
+
npx -y @dashclaw/mcp-server --url https://your-dashclaw.vercel.app --key oc_live_xxx --agent-id claude-desktop
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Or add to `claude_desktop_config.json`:
|
|
@@ -17,16 +17,19 @@ Or add to `claude_desktop_config.json`:
|
|
|
17
17
|
"mcpServers": {
|
|
18
18
|
"dashclaw": {
|
|
19
19
|
"command": "npx",
|
|
20
|
-
"args": ["@dashclaw/mcp-server"],
|
|
20
|
+
"args": ["-y", "@dashclaw/mcp-server"],
|
|
21
21
|
"env": {
|
|
22
22
|
"DASHCLAW_URL": "https://your-dashclaw.vercel.app",
|
|
23
|
-
"DASHCLAW_API_KEY": "oc_live_xxx"
|
|
23
|
+
"DASHCLAW_API_KEY": "oc_live_xxx",
|
|
24
|
+
"DASHCLAW_AGENT_ID": "claude-desktop"
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
```
|
|
29
30
|
|
|
31
|
+
**About `DASHCLAW_AGENT_ID`:** this is the name that shows up on `/fleet`, `/decisions`, and every other governance surface. If you omit it, the server auto-derives an `agent_id` from the MCP protocol's `clientInfo.name` (e.g. `claude-ai` for Claude Desktop, `cursor-vscode` for Cursor) so calls don't silently commingle with other agents — but a human-friendly name like `claude-desktop` is what you actually want for dashboard readability. Explicit configuration always wins over auto-derivation.
|
|
32
|
+
|
|
30
33
|
### Claude Managed Agents (Streamable HTTP)
|
|
31
34
|
|
|
32
35
|
If you're running DashClaw, the MCP endpoint is built in at `/api/mcp`:
|
package/bin/dashclaw-mcp.js
CHANGED
|
@@ -45,7 +45,31 @@ config.url = config.url || process.env.DASHCLAW_URL;
|
|
|
45
45
|
config.apiKey = config.apiKey || process.env.DASHCLAW_API_KEY;
|
|
46
46
|
config.agentId = config.agentId || process.env.DASHCLAW_AGENT_ID;
|
|
47
47
|
|
|
48
|
-
const server = createServer(config);
|
|
48
|
+
const { server, client } = createServer(config);
|
|
49
49
|
const transport = new StdioServerTransport();
|
|
50
50
|
await server.connect(transport);
|
|
51
|
+
|
|
52
|
+
// Auto-derive agent_id from the MCP `initialize` clientInfo when the user
|
|
53
|
+
// hasn't supplied --agent-id or DASHCLAW_AGENT_ID. Without this, every call
|
|
54
|
+
// from Claude Desktop, MCP Inspector, etc. arrives with an empty agent_id and
|
|
55
|
+
// silently commingles with whatever default the server falls back to (almost
|
|
56
|
+
// always `claude-code`). The MCP protocol's clientInfo.name identifies the
|
|
57
|
+
// connecting client (e.g. "claude-ai" for Claude Desktop, "cursor-vscode" for
|
|
58
|
+
// Cursor) so we use it as a sensible default — explicit configuration still
|
|
59
|
+
// wins, because we only set it when client.agentId is empty.
|
|
60
|
+
const originalOnMessage = transport.onmessage;
|
|
61
|
+
if (typeof originalOnMessage === 'function') {
|
|
62
|
+
transport.onmessage = (message) => {
|
|
63
|
+
if (
|
|
64
|
+
message?.method === 'initialize' &&
|
|
65
|
+
!client.agentId &&
|
|
66
|
+
message.params?.clientInfo?.name
|
|
67
|
+
) {
|
|
68
|
+
client.agentId = String(message.params.clientInfo.name);
|
|
69
|
+
console.error(`[dashclaw] auto-derived agent_id from MCP clientInfo: ${client.agentId}`);
|
|
70
|
+
}
|
|
71
|
+
return originalOnMessage(message);
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
51
75
|
console.error('@dashclaw/mcp-server running on stdio');
|
package/lib/server.js
CHANGED
|
@@ -33,7 +33,10 @@ function jsonSchemaToInputSchema(jsonSchema) {
|
|
|
33
33
|
* @param {string} [config.url] - DashClaw instance URL (default: http://localhost:3000)
|
|
34
34
|
* @param {string} [config.apiKey] - API key (oc_live_ prefix)
|
|
35
35
|
* @param {string} [config.agentId] - Default agent ID for tool calls
|
|
36
|
-
* @returns {McpServer} Configured MCP server
|
|
36
|
+
* @returns {{ server: McpServer, client: DashClawClient }} Configured MCP server
|
|
37
|
+
* ready to connect, plus the DashClawClient so callers (the stdio bin) can
|
|
38
|
+
* auto-derive `agentId` from the MCP initialize handshake when no
|
|
39
|
+
* --agent-id / DASHCLAW_AGENT_ID was provided.
|
|
37
40
|
*/
|
|
38
41
|
export function createServer(config = {}) {
|
|
39
42
|
// 1. Create DashClawClient
|
|
@@ -51,7 +54,7 @@ export function createServer(config = {}) {
|
|
|
51
54
|
const server = new McpServer(
|
|
52
55
|
{
|
|
53
56
|
name: '@dashclaw/mcp-server',
|
|
54
|
-
version: '1.0.
|
|
57
|
+
version: '1.0.1',
|
|
55
58
|
},
|
|
56
59
|
{
|
|
57
60
|
capabilities: {
|
|
@@ -128,5 +131,5 @@ export function createServer(config = {}) {
|
|
|
128
131
|
}
|
|
129
132
|
}
|
|
130
133
|
|
|
131
|
-
return server;
|
|
134
|
+
return { server, client };
|
|
132
135
|
}
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashclaw/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "MCP server for DashClaw governance — guard, record, invoke, and discover capabilities.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"dashclaw-mcp": "
|
|
7
|
+
"dashclaw-mcp": "bin/dashclaw-mcp.js"
|
|
8
8
|
},
|
|
9
9
|
"main": "./lib/server.js",
|
|
10
10
|
"exports": {
|