@projitive/mcp 1.0.0-beta.5 → 1.0.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 +206 -84
- package/output/index.js +177 -563
- package/output/projitive.js +259 -0
- 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,122 @@
|
|
|
1
1
|
# @projitive/mcp
|
|
2
2
|
|
|
3
|
+
Language: English | [简体中文](README_CN.md)
|
|
4
|
+
|
|
3
5
|
**Current Spec Version: projitive-spec v1.0.0 | MCP Version: 1.0.0**
|
|
4
6
|
|
|
5
|
-
Projitive MCP server
|
|
7
|
+
Projitive MCP server (semantic interface edition) helps agents discover projects, select tasks, locate evidence, and execute under governance workflows.
|
|
8
|
+
|
|
9
|
+
## Agent Delivery Loop
|
|
10
|
+
|
|
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.
|
|
6
42
|
|
|
7
|
-
##
|
|
43
|
+
## Agent Workflow (Shortest Path)
|
|
8
44
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
```
|
|
12
73
|
|
|
13
|
-
##
|
|
74
|
+
## Spec Version
|
|
14
75
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
- MCP
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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)
|
|
96
|
+
|
|
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
|
+
#### `projectNext`
|
|
27
113
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
114
|
+
- **Purpose**: directly list recently actionable projects (ranked by actionable task count and recency).
|
|
115
|
+
- **Input**: `rootPath?`, `maxDepth?`, `limit?`
|
|
116
|
+
- **Output Example (Markdown)**:
|
|
31
117
|
|
|
32
118
|
```markdown
|
|
33
|
-
#
|
|
119
|
+
# projectNext
|
|
34
120
|
|
|
35
121
|
## Summary
|
|
36
122
|
- rootPath: /workspace
|
|
@@ -45,18 +131,21 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
45
131
|
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
132
|
|
|
47
133
|
## Agent Guidance
|
|
48
|
-
- Pick top 1 project and call `
|
|
49
|
-
- Then call `
|
|
134
|
+
- Pick top 1 project and call `projectContext` with its governanceDir.
|
|
135
|
+
- Then call `taskList` and `taskContext` to continue execution.
|
|
136
|
+
|
|
137
|
+
## Next Call
|
|
138
|
+
- projectContext(projectPath="/workspace/proj-a")
|
|
50
139
|
```
|
|
51
140
|
|
|
52
|
-
#### `
|
|
141
|
+
#### `projectScan`
|
|
53
142
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
143
|
+
- **Purpose**: scan directories and discover governable projects.
|
|
144
|
+
- **Input**: `rootPath?`, `maxDepth?`
|
|
145
|
+
- **Output Example (Markdown)**:
|
|
57
146
|
|
|
58
147
|
```markdown
|
|
59
|
-
#
|
|
148
|
+
# projectScan
|
|
60
149
|
|
|
61
150
|
## Summary
|
|
62
151
|
- rootPath: /workspace
|
|
@@ -69,18 +158,21 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
69
158
|
2. /workspace/proj-b
|
|
70
159
|
|
|
71
160
|
## Agent Guidance
|
|
72
|
-
-
|
|
73
|
-
- Then
|
|
161
|
+
- Use one discovered project path and call `projectLocate` to lock governance root.
|
|
162
|
+
- Then call `projectContext` to inspect current governance state.
|
|
163
|
+
|
|
164
|
+
## Next Call
|
|
165
|
+
- projectLocate(inputPath="/workspace/proj-a")
|
|
74
166
|
```
|
|
75
167
|
|
|
76
|
-
#### `
|
|
168
|
+
#### `projectLocate`
|
|
77
169
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
170
|
+
- **Purpose**: when an agent is already inside a project path, resolve the nearest `.projitive` upward.
|
|
171
|
+
- **Input**: `inputPath`
|
|
172
|
+
- **Output Example (Markdown)**:
|
|
81
173
|
|
|
82
174
|
```markdown
|
|
83
|
-
#
|
|
175
|
+
# projectLocate
|
|
84
176
|
|
|
85
177
|
## Summary
|
|
86
178
|
- resolvedFrom: /workspace/proj-a/packages/mcp
|
|
@@ -88,17 +180,20 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
88
180
|
- markerPath: /workspace/proj-a/.projitive
|
|
89
181
|
|
|
90
182
|
## Agent Guidance
|
|
91
|
-
-
|
|
183
|
+
- Call `projectContext` with this governanceDir to get task and roadmap summaries.
|
|
184
|
+
|
|
185
|
+
## Next Call
|
|
186
|
+
- projectContext(projectPath="/workspace/proj-a")
|
|
92
187
|
```
|
|
93
188
|
|
|
94
|
-
#### `
|
|
189
|
+
#### `projectContext`
|
|
95
190
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
191
|
+
- **Purpose**: summarize governance state instead of only returning file lists.
|
|
192
|
+
- **Input**: `projectPath`
|
|
193
|
+
- **Output Example (Markdown)**:
|
|
99
194
|
|
|
100
195
|
```markdown
|
|
101
|
-
#
|
|
196
|
+
# projectContext
|
|
102
197
|
|
|
103
198
|
## Summary
|
|
104
199
|
- governanceDir: /workspace/proj-a
|
|
@@ -122,20 +217,23 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
122
217
|
- ✅ hooks/
|
|
123
218
|
|
|
124
219
|
## Agent Guidance
|
|
125
|
-
-
|
|
126
|
-
- Then
|
|
220
|
+
- Start from `taskList` to choose a target task.
|
|
221
|
+
- Then call `taskContext` with a task ID to retrieve evidence locations and reading order.
|
|
222
|
+
|
|
223
|
+
## Next Call
|
|
224
|
+
- taskList(projectPath="/workspace/proj-a")
|
|
127
225
|
```
|
|
128
226
|
|
|
129
|
-
###
|
|
227
|
+
### Task Layer
|
|
130
228
|
|
|
131
|
-
#### `
|
|
229
|
+
#### `taskNext`
|
|
132
230
|
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
231
|
+
- **Purpose**: one-step workflow for project discovery + best task selection + evidence/read-order output.
|
|
232
|
+
- **Input**: `rootPath?`, `maxDepth?`, `topCandidates?`
|
|
233
|
+
- **Output Example (Markdown)**:
|
|
136
234
|
|
|
137
235
|
```markdown
|
|
138
|
-
#
|
|
236
|
+
# taskNext
|
|
139
237
|
|
|
140
238
|
## Summary
|
|
141
239
|
- rootPath: /workspace
|
|
@@ -156,6 +254,10 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
156
254
|
1. TASK-0003 | IN_PROGRESS | Build MCP tools | project=/workspace/proj-a | projectScore=6
|
|
157
255
|
2. TASK-0007 | TODO | Add docs examples | project=/workspace/proj-b | projectScore=5
|
|
158
256
|
|
|
257
|
+
### Selection Reason
|
|
258
|
+
- Rank rule: projectScore DESC -> taskPriority DESC -> taskUpdatedAt DESC.
|
|
259
|
+
- Selected candidate scores: projectScore=6, taskPriority=2, taskUpdatedAtMs=1739793600000.
|
|
260
|
+
|
|
159
261
|
### Suggested Read Order
|
|
160
262
|
1. /workspace/proj-a/tasks.md
|
|
161
263
|
2. /workspace/proj-a/designs/mcp-design.md
|
|
@@ -163,19 +265,22 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
163
265
|
|
|
164
266
|
## Agent Guidance
|
|
165
267
|
- Start immediately with Suggested Read Order and execute the selected task.
|
|
166
|
-
- Re-run `
|
|
268
|
+
- Re-run `taskContext` for the selectedTaskId after edits to verify evidence consistency.
|
|
269
|
+
|
|
270
|
+
## Next Call
|
|
271
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
167
272
|
```
|
|
168
273
|
|
|
169
|
-
-
|
|
274
|
+
- **Recommended Path**: prefer `taskNext` to avoid multi-hop flow (`projectNext -> projectContext -> taskList -> taskContext`).
|
|
170
275
|
|
|
171
|
-
#### `
|
|
276
|
+
#### `taskList`
|
|
172
277
|
|
|
173
|
-
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
278
|
+
- **Purpose**: list tasks in current project, with optional status filtering and limiting.
|
|
279
|
+
- **Input**: `projectPath`, `status?`, `limit?`
|
|
280
|
+
- **Output Example (Markdown)**:
|
|
176
281
|
|
|
177
282
|
```markdown
|
|
178
|
-
#
|
|
283
|
+
# taskList
|
|
179
284
|
|
|
180
285
|
## Summary
|
|
181
286
|
- governanceDir: /workspace/proj-a
|
|
@@ -189,25 +294,28 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
189
294
|
- TASK-0007 | IN_PROGRESS | Add docs examples | owner=bob | updatedAt=2026-02-17T13:30:00.000Z
|
|
190
295
|
|
|
191
296
|
## Agent Guidance
|
|
192
|
-
-
|
|
297
|
+
- Pick one task ID and call `taskContext`.
|
|
298
|
+
|
|
299
|
+
## Next Call
|
|
300
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
193
301
|
```
|
|
194
302
|
|
|
195
|
-
#### `
|
|
303
|
+
#### `taskContext`
|
|
196
304
|
|
|
197
|
-
-
|
|
198
|
-
-
|
|
199
|
-
- **
|
|
200
|
-
-
|
|
201
|
-
-
|
|
202
|
-
-
|
|
203
|
-
-
|
|
305
|
+
- **Purpose**: return task detail + related evidence locations in one call (replacing `trace.references`).
|
|
306
|
+
- **Input**: `projectPath`, `taskId`
|
|
307
|
+
- **HOOK Injection**:
|
|
308
|
+
- If `hooks/task_get_head.md` exists, its content is prepended to result.
|
|
309
|
+
- If `hooks/task_get_footer.md` exists, its content is appended to result.
|
|
310
|
+
- Used for project-level custom guidance without changing core `taskContext` shape.
|
|
311
|
+
- **Output Example (Markdown)**:
|
|
204
312
|
|
|
205
313
|
```markdown
|
|
206
|
-
[hooks/task_get_head.md
|
|
314
|
+
[hooks/task_get_head.md content (if present)]
|
|
207
315
|
|
|
208
316
|
---
|
|
209
317
|
|
|
210
|
-
#
|
|
318
|
+
# taskContext
|
|
211
319
|
|
|
212
320
|
## Summary
|
|
213
321
|
- governanceDir: /workspace/proj-a
|
|
@@ -238,22 +346,27 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
238
346
|
## Agent Guidance
|
|
239
347
|
- Read the files in Suggested Read Order.
|
|
240
348
|
- Verify whether current status and evidence are consistent.
|
|
349
|
+
- This task is IN_PROGRESS: prioritize finishing with report/design evidence updates.
|
|
350
|
+
- Verify references stay consistent before marking DONE.
|
|
351
|
+
|
|
352
|
+
## Next Call
|
|
353
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0003")
|
|
241
354
|
|
|
242
355
|
---
|
|
243
356
|
|
|
244
|
-
[hooks/task_get_footer.md
|
|
357
|
+
[hooks/task_get_footer.md content (if present)]
|
|
245
358
|
```
|
|
246
359
|
|
|
247
|
-
###
|
|
360
|
+
### Roadmap Layer
|
|
248
361
|
|
|
249
|
-
#### `
|
|
362
|
+
#### `roadmapList`
|
|
250
363
|
|
|
251
|
-
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
364
|
+
- **Purpose**: list roadmap items and linked task summary.
|
|
365
|
+
- **Input**: `projectPath`
|
|
366
|
+
- **Output Example (Markdown)**:
|
|
254
367
|
|
|
255
368
|
```markdown
|
|
256
|
-
#
|
|
369
|
+
# roadmapList
|
|
257
370
|
|
|
258
371
|
## Summary
|
|
259
372
|
- governanceDir: /workspace/proj-a
|
|
@@ -265,17 +378,20 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
265
378
|
- ROADMAP-0002 | linkedTasks=3
|
|
266
379
|
|
|
267
380
|
## Agent Guidance
|
|
268
|
-
-
|
|
381
|
+
- Pick one roadmap ID and call `roadmapContext`.
|
|
382
|
+
|
|
383
|
+
## Next Call
|
|
384
|
+
- roadmapContext(projectPath="/workspace/proj-a", roadmapId="ROADMAP-0001")
|
|
269
385
|
```
|
|
270
386
|
|
|
271
|
-
#### `
|
|
387
|
+
#### `roadmapContext`
|
|
272
388
|
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
-
|
|
389
|
+
- **Purpose**: get single roadmap detail and reference locations.
|
|
390
|
+
- **Input**: `projectPath`, `roadmapId`
|
|
391
|
+
- **Output Example (Markdown)**:
|
|
276
392
|
|
|
277
393
|
```markdown
|
|
278
|
-
#
|
|
394
|
+
# roadmapContext
|
|
279
395
|
|
|
280
396
|
## Summary
|
|
281
397
|
- governanceDir: /workspace/proj-a
|
|
@@ -295,12 +411,15 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
295
411
|
## Agent Guidance
|
|
296
412
|
- Read roadmap references first, then related tasks.
|
|
297
413
|
- Keep ROADMAP/TASK IDs unchanged while updating markdown files.
|
|
414
|
+
|
|
415
|
+
## Next Call
|
|
416
|
+
- roadmapContext(projectPath="/workspace/proj-a", roadmapId="ROADMAP-0001")
|
|
298
417
|
```
|
|
299
418
|
|
|
300
|
-
##
|
|
419
|
+
## Unified Error Output Example
|
|
301
420
|
|
|
302
421
|
```markdown
|
|
303
|
-
#
|
|
422
|
+
# taskContext
|
|
304
423
|
|
|
305
424
|
## Error
|
|
306
425
|
- cause: Invalid task ID format: TASK-12
|
|
@@ -308,11 +427,14 @@ Projitive MCP server(语义化接口设计版),用于帮助 Agent 发现
|
|
|
308
427
|
## Next Step
|
|
309
428
|
- expected format: TASK-0001
|
|
310
429
|
- retry with a valid task ID
|
|
430
|
+
|
|
431
|
+
## Retry Example
|
|
432
|
+
- taskContext(projectPath="/workspace/proj-a", taskId="TASK-0001")
|
|
311
433
|
```
|
|
312
434
|
|
|
313
|
-
## Agent
|
|
435
|
+
## Recommended Agent Call Flow
|
|
314
436
|
|
|
315
|
-
1. `task.
|
|
316
|
-
2. `task
|
|
317
|
-
3. `project.
|
|
318
|
-
4.
|
|
437
|
+
1. `taskNext`: one-step discovery and top task selection (default path).
|
|
438
|
+
2. `taskContext`: fetch detailed evidence for a specific task ID when needed.
|
|
439
|
+
3. `projectNext`: optional project-level scheduling flow when you need project-first dispatch.
|
|
440
|
+
4. When already in a project path, use `projectLocate` to quickly resolve governance root.
|