@projitive/mcp 1.0.0-beta.5 → 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 +235 -85
- package/output/index.js +178 -563
- package/output/projitive.js +399 -0
- package/output/projitive.test.js +29 -1
- package/output/prompts.js +87 -0
- package/output/resources.js +95 -0
- package/output/roadmap.js +135 -0
- package/output/tasks.js +322 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,36 +1,150 @@
|
|
|
1
1
|
# @projitive/mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Language: English | [简体中文](README_CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**Current Spec Version: projitive-spec v1.0.0 | MCP Version: 1.0.1**
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Projitive MCP server (semantic interface edition) helps agents discover projects, select tasks, locate evidence, and execute under governance workflows.
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
- 说明:Projitive 是通用治理规范,MCP 只是该规范的一种工具实现。
|
|
11
|
-
- 对齐规则:MCP 的主版本必须与规范主版本一致(当前均为 `v1.x`)
|
|
9
|
+
## Agent Delivery Loop
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
```mermaid
|
|
12
|
+
flowchart LR
|
|
13
|
+
A[taskNext / projectNext] --> B[taskContext / projectContext]
|
|
14
|
+
B --> C[Update tasks/designs/reports]
|
|
15
|
+
C --> D[taskContext verify]
|
|
16
|
+
D --> E{More actionable work?}
|
|
17
|
+
E -->|Yes| A
|
|
18
|
+
E -->|No| F[Done / wait for new tasks]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Why Developers Choose This MCP
|
|
22
|
+
|
|
23
|
+
- Predictable API family: `List/Context` as core, `Next/Scan/Locate` for acceleration.
|
|
24
|
+
- Governance-safe automation: state changes are guided by evidence-first workflow.
|
|
25
|
+
- Agent-ready outputs: markdown contracts optimized for tool-chaining, not raw JSON blobs.
|
|
26
|
+
- Production publishing pipeline: release-triggered CI with lint/test/publish gates.
|
|
27
|
+
|
|
28
|
+
## How It Helps Agents Manage and Advance Projects
|
|
29
|
+
|
|
30
|
+
This MCP is designed to make agent execution operational, not just informative. It gives agents a closed-loop workflow:
|
|
31
|
+
|
|
32
|
+
1. **Find what to do next**
|
|
33
|
+
- `taskNext` or `projectNext` ranks actionable targets.
|
|
34
|
+
2. **Build the right context**
|
|
35
|
+
- `taskContext` / `projectContext` / `roadmapContext` provide evidence, references, and next-call hints.
|
|
36
|
+
3. **Execute with governance constraints**
|
|
37
|
+
- Agent updates markdown artifacts (`tasks.md`, `designs/`, `reports/`) with immutable IDs and evidence rules.
|
|
38
|
+
4. **Re-verify and continue**
|
|
39
|
+
- Re-run `taskContext` (or `roadmapContext`) to confirm consistency, then move to the next task.
|
|
40
|
+
|
|
41
|
+
In short: it converts agent work from ad-hoc edits into a **discover → decide → execute → verify** delivery loop.
|
|
42
|
+
|
|
43
|
+
## Agent Workflow (Shortest Path)
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
taskNext
|
|
47
|
+
-> taskContext
|
|
48
|
+
-> update artifacts (tasks/designs/reports)
|
|
49
|
+
-> taskContext (verify)
|
|
50
|
+
-> taskNext (next cycle)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
When the agent starts inside a project:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
projectLocate -> projectContext -> taskList -> taskContext
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Quick Start
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd packages/mcp
|
|
63
|
+
npm ci
|
|
64
|
+
npm run build
|
|
65
|
+
npm run test
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Then configure your MCP client to run:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
node /absolute/path/to/packages/mcp/output/index.js
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Spec Version
|
|
75
|
+
|
|
76
|
+
- Current aligned spec version: `projitive-spec v1.0.0`
|
|
77
|
+
- Note: Projitive is a general governance specification; MCP is one implementation of this spec.
|
|
78
|
+
- Alignment rule: MCP major version must match the spec major version (currently both `v1.x`).
|
|
79
|
+
|
|
80
|
+
## Design Boundaries
|
|
81
|
+
|
|
82
|
+
- MCP handles discovery, locating, summarization, and execution guidance.
|
|
83
|
+
- Agents/AI handle reading and updating markdown content.
|
|
84
|
+
- MCP does not provide direct artifact-write APIs such as `task.update_*`, `roadmap.update_*`, or `sync_*`.
|
|
85
|
+
- All tool outputs are agent-oriented Markdown (not raw JSON objects).
|
|
86
|
+
- Standard output sections: `Summary` / `Evidence` / `Agent Guidance` / `Next Call`.
|
|
87
|
+
- Standard error sections: `Error` / `Next Step` / `Retry Example`.
|
|
88
|
+
|
|
89
|
+
## MCP Capability Model
|
|
90
|
+
|
|
91
|
+
- Tools: execute discovery/locating/summarization actions (primary channel).
|
|
92
|
+
- Resources: expose readable governance artifacts for low-cost context loading.
|
|
93
|
+
- Prompts: provide parameterized workflow templates to reduce execution drift.
|
|
94
|
+
|
|
95
|
+
### Resources (Implemented)
|
|
14
96
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
|
|
97
|
+
- `projitive://governance/workspace`: reads `.projitive/README.md`
|
|
98
|
+
- `projitive://governance/tasks`: reads `.projitive/tasks.md`
|
|
99
|
+
- `projitive://governance/roadmap`: reads `.projitive/roadmap.md`
|
|
100
|
+
- `projitive://mcp/method-catalog`: method naming and role catalog (`List/Context/Next/Scan/Locate`)
|
|
101
|
+
|
|
102
|
+
### Prompts (Implemented)
|
|
103
|
+
|
|
104
|
+
- `executeTaskWorkflow`: standard execution chain (`taskNext -> taskContext -> artifacts update -> verify`)
|
|
105
|
+
- `updateTaskStatusWithEvidence`: status transition + evidence alignment template
|
|
106
|
+
- `triageProjectGovernance`: project-level governance triage template
|
|
21
107
|
|
|
22
108
|
## Tools Methods
|
|
23
109
|
|
|
24
|
-
###
|
|
110
|
+
### Discovery Layer
|
|
25
111
|
|
|
26
|
-
#### `
|
|
112
|
+
#### `projectInit`
|
|
27
113
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
114
|
+
- **Purpose**: manually initialize governance directory structure for a project (default `.projitive`).
|
|
115
|
+
- **Input**: `rootPath?`, `governanceDir?`, `force?`
|
|
116
|
+
- **Output Example (Markdown)**:
|
|
31
117
|
|
|
32
118
|
```markdown
|
|
33
|
-
#
|
|
119
|
+
# projectInit
|
|
120
|
+
|
|
121
|
+
## Summary
|
|
122
|
+
- rootPath: /workspace/proj-a
|
|
123
|
+
- governanceDir: /workspace/proj-a/.projitive
|
|
124
|
+
- markerPath: /workspace/proj-a/.projitive/.projitive
|
|
125
|
+
- force: false
|
|
126
|
+
|
|
127
|
+
## Evidence
|
|
128
|
+
- createdFiles: 4
|
|
129
|
+
- updatedFiles: 0
|
|
130
|
+
- skippedFiles: 0
|
|
131
|
+
|
|
132
|
+
## Agent Guidance
|
|
133
|
+
- If files were skipped and you want to overwrite templates, rerun with force=true.
|
|
134
|
+
- Continue with projectContext and taskList for execution.
|
|
135
|
+
|
|
136
|
+
## Next Call
|
|
137
|
+
- projectContext(projectPath="/workspace/proj-a/.projitive")
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
#### `projectNext`
|
|
141
|
+
|
|
142
|
+
- **Purpose**: directly list recently actionable projects (ranked by actionable task count and recency).
|
|
143
|
+
- **Input**: `rootPath?`, `maxDepth?`, `limit?`
|
|
144
|
+
- **Output Example (Markdown)**:
|
|
145
|
+
|
|
146
|
+
```markdown
|
|
147
|
+
# projectNext
|
|
34
148
|
|
|
35
149
|
## Summary
|
|
36
150
|
- rootPath: /workspace
|
|
@@ -45,18 +159,21 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
45
159
|
2. /workspace/proj-b | actionable=3 | in_progress=1 | todo=2 | blocked=0 | done=7 | latest=2026-02-16T09:00:00.000Z | tasksPath=/workspace/proj-b/tasks.md
|
|
46
160
|
|
|
47
161
|
## Agent Guidance
|
|
48
|
-
- Pick top 1 project and call `
|
|
49
|
-
- Then call `
|
|
162
|
+
- Pick top 1 project and call `projectContext` with its governanceDir.
|
|
163
|
+
- Then call `taskList` and `taskContext` to continue execution.
|
|
164
|
+
|
|
165
|
+
## Next Call
|
|
166
|
+
- projectContext(projectPath="/workspace/proj-a")
|
|
50
167
|
```
|
|
51
168
|
|
|
52
|
-
#### `
|
|
169
|
+
#### `projectScan`
|
|
53
170
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
171
|
+
- **Purpose**: scan directories and discover governable projects.
|
|
172
|
+
- **Input**: `rootPath?`, `maxDepth?`
|
|
173
|
+
- **Output Example (Markdown)**:
|
|
57
174
|
|
|
58
175
|
```markdown
|
|
59
|
-
#
|
|
176
|
+
# projectScan
|
|
60
177
|
|
|
61
178
|
## Summary
|
|
62
179
|
- rootPath: /workspace
|
|
@@ -69,18 +186,21 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
69
186
|
2. /workspace/proj-b
|
|
70
187
|
|
|
71
188
|
## Agent Guidance
|
|
72
|
-
-
|
|
73
|
-
- Then
|
|
189
|
+
- Use one discovered project path and call `projectLocate` to lock governance root.
|
|
190
|
+
- Then call `projectContext` to inspect current governance state.
|
|
191
|
+
|
|
192
|
+
## Next Call
|
|
193
|
+
- projectLocate(inputPath="/workspace/proj-a")
|
|
74
194
|
```
|
|
75
195
|
|
|
76
|
-
#### `
|
|
196
|
+
#### `projectLocate`
|
|
77
197
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
198
|
+
- **Purpose**: when an agent is already inside a project path, resolve the nearest `.projitive` upward.
|
|
199
|
+
- **Input**: `inputPath`
|
|
200
|
+
- **Output Example (Markdown)**:
|
|
81
201
|
|
|
82
202
|
```markdown
|
|
83
|
-
#
|
|
203
|
+
# projectLocate
|
|
84
204
|
|
|
85
205
|
## Summary
|
|
86
206
|
- resolvedFrom: /workspace/proj-a/packages/mcp
|
|
@@ -88,17 +208,20 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
88
208
|
- markerPath: /workspace/proj-a/.projitive
|
|
89
209
|
|
|
90
210
|
## Agent Guidance
|
|
91
|
-
-
|
|
211
|
+
- Call `projectContext` with this governanceDir to get task and roadmap summaries.
|
|
212
|
+
|
|
213
|
+
## Next Call
|
|
214
|
+
- projectContext(projectPath="/workspace/proj-a")
|
|
92
215
|
```
|
|
93
216
|
|
|
94
|
-
#### `
|
|
217
|
+
#### `projectContext`
|
|
95
218
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
219
|
+
- **Purpose**: summarize governance state instead of only returning file lists.
|
|
220
|
+
- **Input**: `projectPath`
|
|
221
|
+
- **Output Example (Markdown)**:
|
|
99
222
|
|
|
100
223
|
```markdown
|
|
101
|
-
#
|
|
224
|
+
# projectContext
|
|
102
225
|
|
|
103
226
|
## Summary
|
|
104
227
|
- governanceDir: /workspace/proj-a
|
|
@@ -122,20 +245,23 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
122
245
|
- ✅ hooks/
|
|
123
246
|
|
|
124
247
|
## Agent Guidance
|
|
125
|
-
-
|
|
126
|
-
- Then
|
|
248
|
+
- Start from `taskList` to choose a target task.
|
|
249
|
+
- Then call `taskContext` with a task ID to retrieve evidence locations and reading order.
|
|
250
|
+
|
|
251
|
+
## Next Call
|
|
252
|
+
- taskList(projectPath="/workspace/proj-a")
|
|
127
253
|
```
|
|
128
254
|
|
|
129
|
-
###
|
|
255
|
+
### Task Layer
|
|
130
256
|
|
|
131
|
-
#### `
|
|
257
|
+
#### `taskNext`
|
|
132
258
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
259
|
+
- **Purpose**: one-step workflow for project discovery + best task selection + evidence/read-order output.
|
|
260
|
+
- **Input**: `rootPath?`, `maxDepth?`, `topCandidates?`
|
|
261
|
+
- **Output Example (Markdown)**:
|
|
136
262
|
|
|
137
263
|
```markdown
|
|
138
|
-
#
|
|
264
|
+
# taskNext
|
|
139
265
|
|
|
140
266
|
## Summary
|
|
141
267
|
- rootPath: /workspace
|
|
@@ -156,6 +282,10 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
156
282
|
1. TASK-0003 | IN_PROGRESS | Build MCP tools | project=/workspace/proj-a | projectScore=6
|
|
157
283
|
2. TASK-0007 | TODO | Add docs examples | project=/workspace/proj-b | projectScore=5
|
|
158
284
|
|
|
285
|
+
### Selection Reason
|
|
286
|
+
- Rank rule: projectScore DESC -> taskPriority DESC -> taskUpdatedAt DESC.
|
|
287
|
+
- Selected candidate scores: projectScore=6, taskPriority=2, taskUpdatedAtMs=1739793600000.
|
|
288
|
+
|
|
159
289
|
### Suggested Read Order
|
|
160
290
|
1. /workspace/proj-a/tasks.md
|
|
161
291
|
2. /workspace/proj-a/designs/mcp-design.md
|
|
@@ -163,19 +293,22 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
163
293
|
|
|
164
294
|
## Agent Guidance
|
|
165
295
|
- Start immediately with Suggested Read Order and execute the selected task.
|
|
166
|
-
- Re-run `
|
|
296
|
+
- Re-run `taskContext` for the selectedTaskId after edits to verify evidence consistency.
|
|
297
|
+
|
|
298
|
+
## Next Call
|
|
299
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
167
300
|
```
|
|
168
301
|
|
|
169
|
-
-
|
|
302
|
+
- **Recommended Path**: prefer `taskNext` to avoid multi-hop flow (`projectNext -> projectContext -> taskList -> taskContext`).
|
|
170
303
|
|
|
171
|
-
#### `
|
|
304
|
+
#### `taskList`
|
|
172
305
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
306
|
+
- **Purpose**: list tasks in current project, with optional status filtering and limiting.
|
|
307
|
+
- **Input**: `projectPath`, `status?`, `limit?`
|
|
308
|
+
- **Output Example (Markdown)**:
|
|
176
309
|
|
|
177
310
|
```markdown
|
|
178
|
-
#
|
|
311
|
+
# taskList
|
|
179
312
|
|
|
180
313
|
## Summary
|
|
181
314
|
- governanceDir: /workspace/proj-a
|
|
@@ -189,25 +322,28 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
189
322
|
- TASK-0007 | IN_PROGRESS | Add docs examples | owner=bob | updatedAt=2026-02-17T13:30:00.000Z
|
|
190
323
|
|
|
191
324
|
## Agent Guidance
|
|
192
|
-
-
|
|
325
|
+
- Pick one task ID and call `taskContext`.
|
|
326
|
+
|
|
327
|
+
## Next Call
|
|
328
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
193
329
|
```
|
|
194
330
|
|
|
195
|
-
#### `
|
|
331
|
+
#### `taskContext`
|
|
196
332
|
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
- **
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
333
|
+
- **Purpose**: return task detail + related evidence locations in one call (replacing `trace.references`).
|
|
334
|
+
- **Input**: `projectPath`, `taskId`
|
|
335
|
+
- **HOOK Injection**:
|
|
336
|
+
- If `hooks/task_get_head.md` exists, its content is prepended to result.
|
|
337
|
+
- If `hooks/task_get_footer.md` exists, its content is appended to result.
|
|
338
|
+
- Used for project-level custom guidance without changing core `taskContext` shape.
|
|
339
|
+
- **Output Example (Markdown)**:
|
|
204
340
|
|
|
205
341
|
```markdown
|
|
206
|
-
[hooks/task_get_head.md
|
|
342
|
+
[hooks/task_get_head.md content (if present)]
|
|
207
343
|
|
|
208
344
|
---
|
|
209
345
|
|
|
210
|
-
#
|
|
346
|
+
# taskContext
|
|
211
347
|
|
|
212
348
|
## Summary
|
|
213
349
|
- governanceDir: /workspace/proj-a
|
|
@@ -238,22 +374,27 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
238
374
|
## Agent Guidance
|
|
239
375
|
- Read the files in Suggested Read Order.
|
|
240
376
|
- Verify whether current status and evidence are consistent.
|
|
377
|
+
- This task is IN_PROGRESS: prioritize finishing with report/design evidence updates.
|
|
378
|
+
- Verify references stay consistent before marking DONE.
|
|
379
|
+
|
|
380
|
+
## Next Call
|
|
381
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
241
382
|
|
|
242
383
|
---
|
|
243
384
|
|
|
244
|
-
[hooks/task_get_footer.md
|
|
385
|
+
[hooks/task_get_footer.md content (if present)]
|
|
245
386
|
```
|
|
246
387
|
|
|
247
|
-
###
|
|
388
|
+
### Roadmap Layer
|
|
248
389
|
|
|
249
|
-
#### `
|
|
390
|
+
#### `roadmapList`
|
|
250
391
|
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
392
|
+
- **Purpose**: list roadmap items and linked task summary.
|
|
393
|
+
- **Input**: `projectPath`
|
|
394
|
+
- **Output Example (Markdown)**:
|
|
254
395
|
|
|
255
396
|
```markdown
|
|
256
|
-
#
|
|
397
|
+
# roadmapList
|
|
257
398
|
|
|
258
399
|
## Summary
|
|
259
400
|
- governanceDir: /workspace/proj-a
|
|
@@ -265,17 +406,20 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
265
406
|
- ROADMAP-0002 | linkedTasks=3
|
|
266
407
|
|
|
267
408
|
## Agent Guidance
|
|
268
|
-
-
|
|
409
|
+
- Pick one roadmap ID and call `roadmapContext`.
|
|
410
|
+
|
|
411
|
+
## Next Call
|
|
412
|
+
- roadmapContext(projectPath="/workspace/proj-a", roadmapId="ROADMAP-0001")
|
|
269
413
|
```
|
|
270
414
|
|
|
271
|
-
#### `
|
|
415
|
+
#### `roadmapContext`
|
|
272
416
|
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
417
|
+
- **Purpose**: get single roadmap detail and reference locations.
|
|
418
|
+
- **Input**: `projectPath`, `roadmapId`
|
|
419
|
+
- **Output Example (Markdown)**:
|
|
276
420
|
|
|
277
421
|
```markdown
|
|
278
|
-
#
|
|
422
|
+
# roadmapContext
|
|
279
423
|
|
|
280
424
|
## Summary
|
|
281
425
|
- governanceDir: /workspace/proj-a
|
|
@@ -295,12 +439,15 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
295
439
|
## Agent Guidance
|
|
296
440
|
- Read roadmap references first, then related tasks.
|
|
297
441
|
- Keep ROADMAP/TASK IDs unchanged while updating markdown files.
|
|
442
|
+
|
|
443
|
+
## Next Call
|
|
444
|
+
- roadmapContext(projectPath="/workspace/proj-a", roadmapId="ROADMAP-0001")
|
|
298
445
|
```
|
|
299
446
|
|
|
300
|
-
##
|
|
447
|
+
## Unified Error Output Example
|
|
301
448
|
|
|
302
449
|
```markdown
|
|
303
|
-
#
|
|
450
|
+
# taskContext
|
|
304
451
|
|
|
305
452
|
## Error
|
|
306
453
|
- cause: Invalid task ID format: TASK-12
|
|
@@ -308,11 +455,14 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
308
455
|
## Next Step
|
|
309
456
|
- expected format: TASK-0001
|
|
310
457
|
- retry with a valid task ID
|
|
458
|
+
|
|
459
|
+
## Retry Example
|
|
460
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0001")
|
|
311
461
|
```
|
|
312
462
|
|
|
313
|
-
## Agent
|
|
463
|
+
## Recommended Agent Call Flow
|
|
314
464
|
|
|
315
|
-
1. `task.
|
|
316
|
-
2. `task
|
|
317
|
-
3. `project.
|
|
318
|
-
4.
|
|
465
|
+
1. `taskNext`: one-step discovery and top task selection (default path).
|
|
466
|
+
2. `taskContext`: fetch detailed evidence for a specific task ID when needed.
|
|
467
|
+
3. `projectNext`: optional project-level scheduling flow when you need project-first dispatch.
|
|
468
|
+
4. When already in a project path, use `projectLocate` to quickly resolve governance root.
|