@guyghost/swarm-dao-mcp 0.2.0
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 +79 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +7 -0
- package/dist/cli.js.map +1 -0
- package/dist/host-adapter.d.ts +11 -0
- package/dist/host-adapter.d.ts.map +1 -0
- package/dist/host-adapter.js +56 -0
- package/dist/host-adapter.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +341 -0
- package/dist/server.js.map +1 -0
- package/package.json +65 -0
package/README.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# @guyghost/swarm-dao-mcp
|
|
2
|
+
|
|
3
|
+
Swarm DAO governance as an **MCP (Model Context Protocol)** stdio server.
|
|
4
|
+
Exposes the full Swarm DAO toolset — propose, deliberate, control, execute,
|
|
5
|
+
ship, rollback, audit — as MCP tools that any MCP-compatible host can call.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @guyghost/swarm-dao-mcp
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Run
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# Boots the stdio MCP server, using $DAO_ROOT (or cwd) as the DAO root.
|
|
17
|
+
swarm-dao-mcp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Configure in a host
|
|
21
|
+
|
|
22
|
+
Any MCP host can register this server. Example (VS Code / Claude / generic):
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"mcpServers": {
|
|
27
|
+
"swarm-dao": {
|
|
28
|
+
"type": "stdio",
|
|
29
|
+
"command": "npx",
|
|
30
|
+
"args": ["-y", "@guyghost/swarm-dao-mcp"],
|
|
31
|
+
"env": { "DAO_ROOT": "." }
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
For ready-made host packages (native config + instructions + slash commands),
|
|
38
|
+
see the sibling adapters:
|
|
39
|
+
|
|
40
|
+
- [`@guyghost/swarm-dao-copilot-adapter`](../copilot-adapter)
|
|
41
|
+
- [`@guyghost/swarm-dao-claude-adapter`](../claude-adapter)
|
|
42
|
+
- [`@guyghost/swarm-dao-codex-adapter`](../codex-adapter)
|
|
43
|
+
|
|
44
|
+
## Tools
|
|
45
|
+
|
|
46
|
+
23 tools covering the full governance lifecycle:
|
|
47
|
+
|
|
48
|
+
| Group | Tools |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| Onboarding | `dao_help`, `dao_setup` |
|
|
51
|
+
| Proposals | `dao_propose`, `dao_update_proposal`, `dao_propose_amendment`, `dao_list` |
|
|
52
|
+
| Deliberation | `dao_deliberate`, `dao_record_outputs`, `dao_roundtable` |
|
|
53
|
+
| Delivery | `dao_plan`, `dao_artefacts`, `dao_dry_run`, `dao_control`, `dao_execute`, `dao_ship`, `dao_rollback` |
|
|
54
|
+
| Tracking | `dao_dashboard`, `dao_audit`, `dao_rate` |
|
|
55
|
+
| Agents | `dao_agents` |
|
|
56
|
+
| GitHub | `dao_config_github`, `dao_github_create_branch`, `dao_github_open_pr` |
|
|
57
|
+
|
|
58
|
+
## Programmatic API
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { createSwarmDaoMcpServer, ensureDaoStorage, createMcpHostAdapter } from "@guyghost/swarm-dao-mcp";
|
|
62
|
+
|
|
63
|
+
await ensureDaoStorage("/path/to/repo");
|
|
64
|
+
const server = createSwarmDaoMcpServer("/path/to/repo");
|
|
65
|
+
await server.connect(yourTransport);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## How deliberation works over MCP
|
|
69
|
+
|
|
70
|
+
MCP hosts cannot have the server spawn sub-agents, so Swarm DAO uses
|
|
71
|
+
**manual deliberation** here:
|
|
72
|
+
|
|
73
|
+
1. `dao_deliberate` returns a dispatch plan (agents + models).
|
|
74
|
+
2. The host spawns one sub-agent per plan entry itself.
|
|
75
|
+
3. `dao_record_outputs` feeds the sub-agent outputs back into the DAO.
|
|
76
|
+
|
|
77
|
+
## License
|
|
78
|
+
|
|
79
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAErD,sBAAsB,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACvC,OAAO,CAAC,KAAK,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC/C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { HostAdapter } from "@guyghost/swarm-dao-core";
|
|
2
|
+
export declare function resolveDaoRoot(): string;
|
|
3
|
+
/**
|
|
4
|
+
* Build a {@link HostAdapter} for a stdio MCP host. Such hosts cannot spawn
|
|
5
|
+
* sub-agents themselves, so `spawnAgent` returns an error directing the caller
|
|
6
|
+
* to the manual `dao_deliberate` → `dao_record_outputs` workflow.
|
|
7
|
+
*/
|
|
8
|
+
export declare function createStdioHostAdapter(hostId: string, workDir?: string): HostAdapter;
|
|
9
|
+
/** Default host adapter (hostId = "mcp") for the standalone MCP server. */
|
|
10
|
+
export declare function createMcpHostAdapter(workDir?: string): HostAdapter;
|
|
11
|
+
//# sourceMappingURL=host-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-adapter.d.ts","sourceRoot":"","sources":["../src/host-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAmB,GAAG,WAAW,CAwC9F;AAED,2EAA2E;AAC3E,wBAAgB,oBAAoB,CAAC,OAAO,SAAmB,GAAG,WAAW,CAE5E"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { execCommand, readFileContained, writeFileContained } from "@guyghost/swarm-dao-core";
|
|
2
|
+
export function resolveDaoRoot() {
|
|
3
|
+
return process.env.DAO_ROOT?.trim() || process.cwd();
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Build a {@link HostAdapter} for a stdio MCP host. Such hosts cannot spawn
|
|
7
|
+
* sub-agents themselves, so `spawnAgent` returns an error directing the caller
|
|
8
|
+
* to the manual `dao_deliberate` → `dao_record_outputs` workflow.
|
|
9
|
+
*/
|
|
10
|
+
export function createStdioHostAdapter(hostId, workDir = resolveDaoRoot()) {
|
|
11
|
+
return {
|
|
12
|
+
hostId,
|
|
13
|
+
async spawnAgent(params) {
|
|
14
|
+
return {
|
|
15
|
+
agentId: params.agent.id,
|
|
16
|
+
agentName: params.agent.name,
|
|
17
|
+
role: params.agent.role,
|
|
18
|
+
content: "",
|
|
19
|
+
durationMs: 0,
|
|
20
|
+
error: `${hostId} hosts require manual sub-agent dispatch. Use dao_deliberate then dao_record_outputs.`,
|
|
21
|
+
};
|
|
22
|
+
},
|
|
23
|
+
async spawnAgents() {
|
|
24
|
+
return [];
|
|
25
|
+
},
|
|
26
|
+
async log(params) {
|
|
27
|
+
const prefix = `[${params.level}] ${params.service}:`;
|
|
28
|
+
if (params.level === "error") {
|
|
29
|
+
console.error(prefix, params.message);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
console.error(prefix, params.message);
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
getWorkingDirectory() {
|
|
36
|
+
return workDir;
|
|
37
|
+
},
|
|
38
|
+
async readFile(filePath) {
|
|
39
|
+
return readFileContained(filePath, workDir);
|
|
40
|
+
},
|
|
41
|
+
async writeFile(filePath, content) {
|
|
42
|
+
return writeFileContained(filePath, content, workDir);
|
|
43
|
+
},
|
|
44
|
+
async exec(command, options) {
|
|
45
|
+
return execCommand(command, options);
|
|
46
|
+
},
|
|
47
|
+
hasCapability(capability) {
|
|
48
|
+
return ["read_file", "write_file", "exec", "log"].includes(capability);
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
/** Default host adapter (hostId = "mcp") for the standalone MCP server. */
|
|
53
|
+
export function createMcpHostAdapter(workDir = resolveDaoRoot()) {
|
|
54
|
+
return createStdioHostAdapter("mcp", workDir);
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=host-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host-adapter.js","sourceRoot":"","sources":["../src/host-adapter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9F,MAAM,UAAU,cAAc;IAC5B,OAAO,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;AACvD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,OAAO,GAAG,cAAc,EAAE;IAC/E,OAAO;QACL,MAAM;QACN,KAAK,CAAC,UAAU,CAAC,MAAM;YACrB,OAAO;gBACL,OAAO,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE;gBACxB,SAAS,EAAE,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,GAAG,cAAc,EAAE;IAC7D,OAAO,sBAAsB,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
2
|
+
export declare function ensureDaoStorage(workDir: string): Promise<void>;
|
|
3
|
+
export declare function createSwarmDaoMcpServer(workDir?: string): Server;
|
|
4
|
+
export declare function startSwarmDaoMcpServer(workDir?: string): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAiCA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AA+BnE,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMrE;AAED,wBAAgB,uBAAuB,CAAC,OAAO,SAAmB,GAAG,MAAM,CAqU1E;AAED,wBAAsB,sBAAsB,CAAC,OAAO,SAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAMtF"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { buildDaoHelpMessage, DAO_ONBOARDING_MESSAGE, getOrCreateState, getState, handleDaoAgents, handleDaoArtefacts, handleDaoAudit, handleDaoConfigGithub, handleDaoControl, handleDaoDashboard, handleDaoDeliberate, handleDaoDryRun, handleDaoExecute, handleDaoGithubCreateBranch, handleDaoGithubOpenPr, handleDaoList, handleDaoPlan, handleDaoPropose, handleDaoProposeAmendment, handleDaoRate, handleDaoRecordOutputs, handleDaoRollback, handleDaoRoundtable, handleDaoSetup, handleDaoShip, handleDaoUpdateProposal, initStorage, loadState, PROPOSAL_TYPES, setState, } from "@guyghost/swarm-dao-core";
|
|
2
|
+
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
3
|
+
import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
4
|
+
import { createMcpHostAdapter, resolveDaoRoot } from "./host-adapter.js";
|
|
5
|
+
function textResult(text) {
|
|
6
|
+
return { content: [{ type: "text", text }] };
|
|
7
|
+
}
|
|
8
|
+
function errorResult(message) {
|
|
9
|
+
return { content: [{ type: "text", text: message }], isError: true };
|
|
10
|
+
}
|
|
11
|
+
function parseProposalType(value) {
|
|
12
|
+
if (typeof value === "string" && PROPOSAL_TYPES.includes(value)) {
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
throw new Error(`Invalid proposal type: ${String(value)}. Valid types: ${PROPOSAL_TYPES.join(", ")}`);
|
|
16
|
+
}
|
|
17
|
+
function createToolContext(workDir) {
|
|
18
|
+
return {
|
|
19
|
+
adapter: createMcpHostAdapter(workDir),
|
|
20
|
+
workDir,
|
|
21
|
+
deliberationMode: "manual",
|
|
22
|
+
controlToolName: "dao_control",
|
|
23
|
+
failOnGateFailure: false,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export async function ensureDaoStorage(workDir) {
|
|
27
|
+
await initStorage(workDir);
|
|
28
|
+
const loaded = await loadState(workDir);
|
|
29
|
+
if (!loaded) {
|
|
30
|
+
setState(getOrCreateState(workDir));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export function createSwarmDaoMcpServer(workDir = resolveDaoRoot()) {
|
|
34
|
+
const server = new Server({ name: "swarm-dao", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
35
|
+
const ctx = createToolContext(workDir);
|
|
36
|
+
const controlTool = "dao_control";
|
|
37
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
38
|
+
tools: [
|
|
39
|
+
{
|
|
40
|
+
name: "dao_help",
|
|
41
|
+
description: "Show onboarding and available DAO tools",
|
|
42
|
+
inputSchema: { type: "object", properties: {} },
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "dao_setup",
|
|
46
|
+
description: "Initialize the DAO with default 7 product agents",
|
|
47
|
+
inputSchema: { type: "object", properties: { useDefaults: { type: "boolean" } } },
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: "dao_propose",
|
|
51
|
+
description: "Create a new DAO proposal",
|
|
52
|
+
inputSchema: {
|
|
53
|
+
type: "object",
|
|
54
|
+
required: ["title", "type", "description"],
|
|
55
|
+
properties: {
|
|
56
|
+
title: { type: "string" },
|
|
57
|
+
type: { type: "string", enum: [...PROPOSAL_TYPES] },
|
|
58
|
+
description: { type: "string" },
|
|
59
|
+
context: { type: "string" },
|
|
60
|
+
problemStatement: { type: "string" },
|
|
61
|
+
acceptanceCriteria: { type: "array", items: { type: "string" } },
|
|
62
|
+
successMetrics: { type: "array", items: { type: "string" } },
|
|
63
|
+
rollbackConditions: { type: "array", items: { type: "string" } },
|
|
64
|
+
affectedPaths: { type: "array", items: { type: "string" } },
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "dao_deliberate",
|
|
70
|
+
description: "Build a swarm dispatch plan for manual sub-agent execution",
|
|
71
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: "dao_record_outputs",
|
|
75
|
+
description: "Record sub-agent outputs and finalize deliberation",
|
|
76
|
+
inputSchema: {
|
|
77
|
+
type: "object",
|
|
78
|
+
required: ["proposalId", "outputs"],
|
|
79
|
+
properties: {
|
|
80
|
+
proposalId: { type: "number" },
|
|
81
|
+
outputs: {
|
|
82
|
+
type: "array",
|
|
83
|
+
items: {
|
|
84
|
+
type: "object",
|
|
85
|
+
required: ["agentId", "content"],
|
|
86
|
+
properties: {
|
|
87
|
+
agentId: { type: "string" },
|
|
88
|
+
content: { type: "string" },
|
|
89
|
+
durationMs: { type: "number" },
|
|
90
|
+
error: { type: "string" },
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
name: "dao_control",
|
|
99
|
+
description: "Run quality control gates",
|
|
100
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: "dao_execute",
|
|
104
|
+
description: "Execute an approved or controlled proposal",
|
|
105
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "dao_ship",
|
|
109
|
+
description: "Ship a controlled proposal (optionally cascade dependencies)",
|
|
110
|
+
inputSchema: {
|
|
111
|
+
type: "object",
|
|
112
|
+
required: ["proposalId"],
|
|
113
|
+
properties: { proposalId: { type: "number" }, cascade: { type: "boolean" }, force: { type: "boolean" } },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{ name: "dao_list", description: "List all DAO proposals", inputSchema: { type: "object", properties: {} } },
|
|
117
|
+
{ name: "dao_agents", description: "List all DAO agents", inputSchema: { type: "object", properties: {} } },
|
|
118
|
+
{
|
|
119
|
+
name: "dao_plan",
|
|
120
|
+
description: "Get delivery plan",
|
|
121
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
name: "dao_artefacts",
|
|
125
|
+
description: "View auto-generated artefacts for a proposal",
|
|
126
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: "dao_dry_run",
|
|
130
|
+
description: "Preview execution without applying changes",
|
|
131
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "dao_rollback",
|
|
135
|
+
description: "Revert proposal execution to pre-execution snapshot",
|
|
136
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "dao_dashboard",
|
|
140
|
+
description: "View outcome tracking dashboard",
|
|
141
|
+
inputSchema: { type: "object", properties: {} },
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
name: "dao_roundtable",
|
|
145
|
+
description: "Ask every agent to suggest a proposal idea",
|
|
146
|
+
inputSchema: { type: "object", properties: {} },
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "dao_audit",
|
|
150
|
+
description: "View audit trail",
|
|
151
|
+
inputSchema: { type: "object", properties: { proposalId: { type: "number" } } },
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: "dao_rate",
|
|
155
|
+
description: "Rate a proposal outcome post-execution (1-5 stars)",
|
|
156
|
+
inputSchema: {
|
|
157
|
+
type: "object",
|
|
158
|
+
required: ["proposalId", "score", "comment"],
|
|
159
|
+
properties: {
|
|
160
|
+
proposalId: { type: "number" },
|
|
161
|
+
score: { type: "number", minimum: 1, maximum: 5 },
|
|
162
|
+
comment: { type: "string" },
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "dao_update_proposal",
|
|
168
|
+
description: "Update structured fields on an open proposal",
|
|
169
|
+
inputSchema: {
|
|
170
|
+
type: "object",
|
|
171
|
+
required: ["proposalId"],
|
|
172
|
+
properties: {
|
|
173
|
+
proposalId: { type: "number" },
|
|
174
|
+
problemStatement: { type: "string" },
|
|
175
|
+
acceptanceCriteria: { type: "array", items: { type: "string" } },
|
|
176
|
+
successMetrics: { type: "array", items: { type: "string" } },
|
|
177
|
+
rollbackConditions: { type: "array", items: { type: "string" } },
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
name: "dao_propose_amendment",
|
|
183
|
+
description: "Propose an amendment to the DAO",
|
|
184
|
+
inputSchema: {
|
|
185
|
+
type: "object",
|
|
186
|
+
required: ["title", "description", "amendmentType"],
|
|
187
|
+
properties: {
|
|
188
|
+
title: { type: "string" },
|
|
189
|
+
description: { type: "string" },
|
|
190
|
+
amendmentType: {
|
|
191
|
+
type: "string",
|
|
192
|
+
enum: ["agent-update", "agent-add", "agent-remove", "config-update", "quorum-update", "gate-update"],
|
|
193
|
+
},
|
|
194
|
+
agentId: { type: "string" },
|
|
195
|
+
agentChanges: { type: "string" },
|
|
196
|
+
newAgentId: { type: "string" },
|
|
197
|
+
newAgentName: { type: "string" },
|
|
198
|
+
newAgentRole: { type: "string" },
|
|
199
|
+
newAgentWeight: { type: "number" },
|
|
200
|
+
configChanges: { type: "string" },
|
|
201
|
+
quorumChanges: { type: "string" },
|
|
202
|
+
addGates: { type: "array", items: { type: "string" } },
|
|
203
|
+
removeGates: { type: "array", items: { type: "string" } },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: "dao_config_github",
|
|
209
|
+
description: "Configure GitHub integration for branch/PR tools",
|
|
210
|
+
inputSchema: {
|
|
211
|
+
type: "object",
|
|
212
|
+
required: ["token", "owner", "repo"],
|
|
213
|
+
properties: { token: { type: "string" }, owner: { type: "string" }, repo: { type: "string" } },
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "dao_github_create_branch",
|
|
218
|
+
description: "Create a GitHub branch for a proposal",
|
|
219
|
+
inputSchema: { type: "object", required: ["proposalId"], properties: { proposalId: { type: "number" } } },
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: "dao_github_open_pr",
|
|
223
|
+
description: "Open a GitHub pull request for a proposal",
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: "object",
|
|
226
|
+
required: ["proposalId", "headBranch"],
|
|
227
|
+
properties: { proposalId: { type: "number" }, headBranch: { type: "string" } },
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
}));
|
|
232
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
233
|
+
const args = (request.params.arguments ?? {});
|
|
234
|
+
const name = request.params.name;
|
|
235
|
+
try {
|
|
236
|
+
switch (name) {
|
|
237
|
+
case "dao_help": {
|
|
238
|
+
const state = getState();
|
|
239
|
+
if (!state.initialized)
|
|
240
|
+
return textResult(DAO_ONBOARDING_MESSAGE);
|
|
241
|
+
return textResult(buildDaoHelpMessage({ host: "mcp", manualDeliberation: true, controlTool }));
|
|
242
|
+
}
|
|
243
|
+
case "dao_setup":
|
|
244
|
+
return textResult(await handleDaoSetup(ctx, args.useDefaults !== false));
|
|
245
|
+
case "dao_propose":
|
|
246
|
+
return textResult(await handleDaoPropose({
|
|
247
|
+
title: String(args.title),
|
|
248
|
+
type: parseProposalType(args.type),
|
|
249
|
+
description: String(args.description),
|
|
250
|
+
context: args.context !== undefined ? String(args.context) : undefined,
|
|
251
|
+
problemStatement: args.problemStatement !== undefined ? String(args.problemStatement) : undefined,
|
|
252
|
+
acceptanceCriteria: args.acceptanceCriteria,
|
|
253
|
+
successMetrics: args.successMetrics,
|
|
254
|
+
rollbackConditions: args.rollbackConditions,
|
|
255
|
+
affectedPaths: args.affectedPaths,
|
|
256
|
+
}));
|
|
257
|
+
case "dao_deliberate":
|
|
258
|
+
return textResult(await handleDaoDeliberate(ctx, Number(args.proposalId)));
|
|
259
|
+
case "dao_record_outputs":
|
|
260
|
+
return textResult(await handleDaoRecordOutputs(ctx, Number(args.proposalId), args.outputs ?? []));
|
|
261
|
+
case "dao_control":
|
|
262
|
+
return textResult(await handleDaoControl(ctx, Number(args.proposalId)));
|
|
263
|
+
case "dao_execute":
|
|
264
|
+
return textResult(await handleDaoExecute(Number(args.proposalId)));
|
|
265
|
+
case "dao_ship":
|
|
266
|
+
return textResult(await handleDaoShip(ctx, Number(args.proposalId), {
|
|
267
|
+
cascade: args.cascade === true,
|
|
268
|
+
force: args.force === true,
|
|
269
|
+
}));
|
|
270
|
+
case "dao_list":
|
|
271
|
+
return textResult(await handleDaoList());
|
|
272
|
+
case "dao_agents":
|
|
273
|
+
return textResult(await handleDaoAgents());
|
|
274
|
+
case "dao_plan":
|
|
275
|
+
return textResult(await handleDaoPlan(Number(args.proposalId), controlTool));
|
|
276
|
+
case "dao_artefacts":
|
|
277
|
+
return textResult(await handleDaoArtefacts(Number(args.proposalId)));
|
|
278
|
+
case "dao_dry_run":
|
|
279
|
+
return textResult(await handleDaoDryRun(Number(args.proposalId)));
|
|
280
|
+
case "dao_rollback":
|
|
281
|
+
return textResult(await handleDaoRollback(Number(args.proposalId)));
|
|
282
|
+
case "dao_dashboard":
|
|
283
|
+
return textResult(await handleDaoDashboard());
|
|
284
|
+
case "dao_roundtable":
|
|
285
|
+
return textResult(await handleDaoRoundtable(ctx));
|
|
286
|
+
case "dao_audit":
|
|
287
|
+
return textResult(await handleDaoAudit(args.proposalId !== undefined ? Number(args.proposalId) : undefined));
|
|
288
|
+
case "dao_rate":
|
|
289
|
+
return textResult(await handleDaoRate(Number(args.proposalId), Number(args.score), String(args.comment)));
|
|
290
|
+
case "dao_update_proposal":
|
|
291
|
+
return textResult(await handleDaoUpdateProposal(Number(args.proposalId), {
|
|
292
|
+
problemStatement: args.problemStatement !== undefined ? String(args.problemStatement) : undefined,
|
|
293
|
+
acceptanceCriteria: args.acceptanceCriteria,
|
|
294
|
+
successMetrics: args.successMetrics,
|
|
295
|
+
rollbackConditions: args.rollbackConditions,
|
|
296
|
+
}));
|
|
297
|
+
case "dao_propose_amendment":
|
|
298
|
+
return textResult(await handleDaoProposeAmendment({
|
|
299
|
+
title: String(args.title),
|
|
300
|
+
description: String(args.description),
|
|
301
|
+
amendmentType: args.amendmentType,
|
|
302
|
+
agentId: args.agentId !== undefined ? String(args.agentId) : undefined,
|
|
303
|
+
agentChanges: args.agentChanges !== undefined ? String(args.agentChanges) : undefined,
|
|
304
|
+
newAgentId: args.newAgentId !== undefined ? String(args.newAgentId) : undefined,
|
|
305
|
+
newAgentName: args.newAgentName !== undefined ? String(args.newAgentName) : undefined,
|
|
306
|
+
newAgentRole: args.newAgentRole !== undefined ? String(args.newAgentRole) : undefined,
|
|
307
|
+
newAgentWeight: args.newAgentWeight !== undefined ? Number(args.newAgentWeight) : undefined,
|
|
308
|
+
configChanges: args.configChanges !== undefined ? String(args.configChanges) : undefined,
|
|
309
|
+
quorumChanges: args.quorumChanges !== undefined ? String(args.quorumChanges) : undefined,
|
|
310
|
+
addGates: args.addGates,
|
|
311
|
+
removeGates: args.removeGates,
|
|
312
|
+
}));
|
|
313
|
+
case "dao_config_github":
|
|
314
|
+
return textResult(await handleDaoConfigGithub(ctx, {
|
|
315
|
+
token: String(args.token),
|
|
316
|
+
owner: String(args.owner),
|
|
317
|
+
repo: String(args.repo),
|
|
318
|
+
}));
|
|
319
|
+
case "dao_github_create_branch":
|
|
320
|
+
return textResult(await handleDaoGithubCreateBranch(ctx, Number(args.proposalId)));
|
|
321
|
+
case "dao_github_open_pr":
|
|
322
|
+
return textResult(await handleDaoGithubOpenPr(ctx, Number(args.proposalId), String(args.headBranch)));
|
|
323
|
+
default:
|
|
324
|
+
return errorResult(`Unknown tool: ${name}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
catch (error) {
|
|
328
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
329
|
+
return errorResult(`Error: ${message}`);
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
return server;
|
|
333
|
+
}
|
|
334
|
+
export async function startSwarmDaoMcpServer(workDir = resolveDaoRoot()) {
|
|
335
|
+
await ensureDaoStorage(workDir);
|
|
336
|
+
const { StdioServerTransport } = await import("@modelcontextprotocol/sdk/server/stdio.js");
|
|
337
|
+
const server = createSwarmDaoMcpServer(workDir);
|
|
338
|
+
const transport = new StdioServerTransport();
|
|
339
|
+
await server.connect(transport);
|
|
340
|
+
}
|
|
341
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,2BAA2B,EAC3B,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,yBAAyB,EACzB,aAAa,EACb,sBAAsB,EACtB,iBAAiB,EACjB,mBAAmB,EACnB,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,SAAS,EACT,cAAc,EACd,QAAQ,GACT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACnG,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,mBAAmB,C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AAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,WAAW,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAAC,OAAO,GAAG,cAAc,EAAE;IACrE,MAAM,gBAAgB,CAAC,OAAO,CAAC,CAAC;IAChC,MAAM,EAAE,oBAAoB,EAAE,GAAG,MAAM,MAAM,CAAC,2CAA2C,CAAC,CAAC;IAC3F,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@guyghost/swarm-dao-mcp",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Swarm DAO Model Context Protocol server — exposes DAO governance tools to any MCP-compatible host (Copilot, Claude, Codex, …)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"swarm-dao-mcp": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"sideEffects": false,
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"test": "bun test",
|
|
25
|
+
"lint": "biome check .",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"prepublishOnly": "bun run build"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@guyghost/swarm-dao-core": "^0.3.0",
|
|
31
|
+
"@modelcontextprotocol/sdk": "^1.29.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/bun": "latest",
|
|
35
|
+
"@types/node": "^22.0.0"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"swarm-dao",
|
|
39
|
+
"mcp",
|
|
40
|
+
"model-context-protocol",
|
|
41
|
+
"dao",
|
|
42
|
+
"governance",
|
|
43
|
+
"multi-agent",
|
|
44
|
+
"deliberation",
|
|
45
|
+
"ai-agents",
|
|
46
|
+
"quality-gates",
|
|
47
|
+
"copilot",
|
|
48
|
+
"claude",
|
|
49
|
+
"codex"
|
|
50
|
+
],
|
|
51
|
+
"author": "guyghost",
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "git+https://github.com/guyghost/swarm-dao.git",
|
|
56
|
+
"directory": "packages/mcp-server"
|
|
57
|
+
},
|
|
58
|
+
"bugs": {
|
|
59
|
+
"url": "https://github.com/guyghost/swarm-dao/issues"
|
|
60
|
+
},
|
|
61
|
+
"homepage": "https://github.com/guyghost/swarm-dao#readme",
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
65
|
+
}
|