@kitsy/coop-mcp 1.0.0 → 2.1.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 CHANGED
@@ -35,9 +35,11 @@ Or, after installation/build:
35
35
 
36
36
  ```bash
37
37
  coop-mcp --repo C:/path/to/your/repo
38
+ coop-mcp --repo C:/path/to/your/repo --project webapp
38
39
  ```
39
40
 
40
41
  If `--repo` is omitted, the server resolves the nearest parent directory containing `.coop/`.
42
+ If the workspace contains multiple COOP projects, pass `--project <id>` or set the workspace current project first.
41
43
 
42
44
  ## Claude Code Setup
43
45
 
@@ -88,5 +90,5 @@ Any MCP client that supports `stdio` transports can launch this server with the
88
90
 
89
91
  - The server reads and writes the local `.coop/` workspace directly.
90
92
  - Tool mutations go through shared core rules for task writing, planning, and state transitions.
91
- - Workspace identity is exposed from `.coop/config.yml -> project` for orchestrators and multi-repo agents.
93
+ - Workspace identity is exposed from the active project's `.coop/projects/<project.id>/config.yml -> project` block for orchestrators and multi-repo agents.
92
94
  - This phase intentionally keeps transport simple: local `stdio`, no remote hosting, no auth layer.
package/dist/index.d.ts CHANGED
@@ -36,7 +36,8 @@ type CreateTaskInput = {
36
36
  declare class CoopMcpService {
37
37
  readonly repoRoot: string;
38
38
  readonly coopDir: string;
39
- constructor(repoRoot?: string);
39
+ readonly projectId: string;
40
+ constructor(repoRoot?: string, projectId?: string | undefined);
40
41
  loadGraph(): TaskGraph;
41
42
  workspaceInfo(): {
42
43
  instance: {
@@ -183,6 +184,7 @@ declare class CoopMcpService {
183
184
 
184
185
  type CoopMcpServerOptions = {
185
186
  repoRoot?: string;
187
+ projectId?: string;
186
188
  };
187
189
  declare function createCoopMcpServer(options?: CoopMcpServerOptions): {
188
190
  server: McpServer;
package/dist/index.js CHANGED
@@ -17,6 +17,8 @@ import {
17
17
  TaskStatus,
18
18
  TaskType,
19
19
  analyze_feasibility,
20
+ coop_project_config_path,
21
+ resolve_project,
20
22
  load_graph,
21
23
  parseTaskFile,
22
24
  parseYamlFile,
@@ -61,7 +63,11 @@ function randomToken() {
61
63
  return crypto.randomBytes(4).toString("hex").toUpperCase();
62
64
  }
63
65
  function readConfig(root) {
64
- const configPath = path.join(root, ".coop", "config.yml");
66
+ const projectRoot = resolve_project(root, {
67
+ project: process.env.COOP_PROJECT_ID,
68
+ require: true
69
+ }).root;
70
+ const configPath = coop_project_config_path(projectRoot);
65
71
  if (!fs.existsSync(configPath)) {
66
72
  return {};
67
73
  }
@@ -131,7 +137,13 @@ function walkFiles(dirPath) {
131
137
  return out.sort((a, b) => a.localeCompare(b));
132
138
  }
133
139
  function taskFileById(root, id) {
134
- const taskDir = path.join(root, ".coop", "tasks");
140
+ const taskDir = path.join(
141
+ resolve_project(root, {
142
+ project: process.env.COOP_PROJECT_ID,
143
+ require: true
144
+ }).root,
145
+ "tasks"
146
+ );
135
147
  const wanted = `${id}.md`.toLowerCase();
136
148
  const match = walkFiles(taskDir).find((filePath) => path.basename(filePath).toLowerCase() === wanted);
137
149
  if (!match) {
@@ -189,11 +201,14 @@ function resolveRepoRoot(start = process.cwd()) {
189
201
  var CoopMcpService = class {
190
202
  repoRoot;
191
203
  coopDir;
192
- constructor(repoRoot = resolveRepoRoot(process.env.COOP_REPO_ROOT ?? process.cwd())) {
204
+ projectId;
205
+ constructor(repoRoot = resolveRepoRoot(process.env.COOP_REPO_ROOT ?? process.cwd()), projectId = process.env.COOP_PROJECT_ID) {
193
206
  this.repoRoot = path.resolve(repoRoot);
194
- this.coopDir = path.join(this.repoRoot, ".coop");
207
+ const project = resolve_project(this.repoRoot, { project: projectId, require: true });
208
+ this.projectId = project.id;
209
+ this.coopDir = project.root;
195
210
  if (!fs.existsSync(this.coopDir)) {
196
- throw new Error(`Missing .coop directory at ${this.coopDir}.`);
211
+ throw new Error(`Missing COOP project directory at ${this.coopDir}.`);
197
212
  }
198
213
  }
199
214
  loadGraph() {
@@ -204,7 +219,7 @@ var CoopMcpService = class {
204
219
  const repoName = path.basename(this.repoRoot);
205
220
  return {
206
221
  instance: {
207
- id: config.project?.id?.trim() || repoName,
222
+ id: config.project?.id?.trim() || this.projectId || repoName,
208
223
  name: config.project?.name?.trim() || repoName,
209
224
  aliases: (config.project?.aliases ?? []).filter((entry) => typeof entry === "string" && entry.trim().length > 0)
210
225
  },
@@ -443,22 +458,28 @@ function resourceTextResult(uri, value) {
443
458
  // src/index.ts
444
459
  function parseArgs(argv) {
445
460
  let repoRoot;
461
+ let projectId;
446
462
  for (let index = 2; index < argv.length; index += 1) {
447
463
  const current = argv[index];
448
464
  if (current === "--repo") {
449
465
  repoRoot = argv[index + 1];
450
466
  index += 1;
467
+ continue;
468
+ }
469
+ if (current === "--project") {
470
+ projectId = argv[index + 1];
471
+ index += 1;
451
472
  }
452
473
  }
453
- return { repoRoot };
474
+ return { repoRoot, projectId };
454
475
  }
455
476
  function createCoopMcpServer(options = {}) {
456
477
  const repoRoot = resolveRepoRoot(options.repoRoot ?? process.env.COOP_REPO_ROOT ?? process.cwd());
457
- const service = new CoopMcpService(repoRoot);
478
+ const service = new CoopMcpService(repoRoot, options.projectId ?? process.env.COOP_PROJECT_ID);
458
479
  const server = new McpServer(
459
480
  {
460
481
  name: "@kitsy/coop-mcp",
461
- version: "1.0.0"
482
+ version: "2.1.0"
462
483
  },
463
484
  {
464
485
  capabilities: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kitsy/coop-mcp",
3
- "version": "1.0.0",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "@modelcontextprotocol/sdk": "^1.27.1",
22
22
  "zod": "^4.3.6",
23
- "@kitsy/coop-core": "1.0.0"
23
+ "@kitsy/coop-core": "2.1.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^24.12.0",