@anyforge/mcp-server 2.2.0 → 2.3.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 +23 -0
- package/dist/index.js +25 -4
- package/dist/index.js.map +1 -1
- package/dist/prompts/genesis.d.ts +3 -0
- package/dist/prompts/genesis.js +68 -0
- package/dist/prompts/genesis.js.map +1 -0
- package/dist/tools/initiatives.js +49 -0
- package/dist/tools/initiatives.js.map +1 -1
- package/dist/tools/programs.js +49 -0
- package/dist/tools/programs.js.map +1 -1
- package/dist/tools/repos.d.ts +11 -0
- package/dist/tools/repos.js +120 -0
- package/dist/tools/repos.js.map +1 -0
- package/dist/tools/types.d.ts +18 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -74,6 +74,28 @@ Use the equivalent stdio MCP config (`command: npx`, `args: ["tsx",
|
|
|
74
74
|
| `anyforge_resume_crew` | approve | Resume a PAUSED/HALTED crew |
|
|
75
75
|
| `anyforge_halt_crew` | approve | Halt a crew |
|
|
76
76
|
| `anyforge_amend_crew` | approve | Continue & finish — send a crew at its HIL gate back to the engineer with guidance |
|
|
77
|
+
| `anyforge_create_program` | write | Create a program (cross-initiative grouping) |
|
|
78
|
+
| `anyforge_write_program_brief` | write | Write/update a program's brief (charter) — seeds each initiative's architect context |
|
|
79
|
+
| `anyforge_create_initiative` | write | Create a (DRAFT) initiative, optionally under a program |
|
|
80
|
+
| `anyforge_dispatch_architect` | write | Decompose an initiative into a backlog (→ HIL #1) |
|
|
81
|
+
| `anyforge_list_repo_index` | read | List the org repo index (activity, coverage, analyzed) — discover codebases to scope |
|
|
82
|
+
| `anyforge_get_repo_analysis` | read | One repo's coverage / architecture / gap summary |
|
|
83
|
+
| `anyforge_analyze_repos` | write | Start Phase-1 analysis for one or more repos |
|
|
84
|
+
| `anyforge_start_coverage_sweep` | write | Paced Phase 1→2 analysis sweep over a program/repo set |
|
|
85
|
+
| `anyforge_refresh_repo_index` | write | Refresh the repo index + committed-coverage detection now |
|
|
86
|
+
|
|
87
|
+
## Prompts (guided flows)
|
|
88
|
+
|
|
89
|
+
MCP clients that support server prompts (e.g. Claude Code surfaces them as
|
|
90
|
+
`/mcp__anyforge__<name>` slash commands) get:
|
|
91
|
+
|
|
92
|
+
| Prompt | Args | What it does |
|
|
93
|
+
|--------|------|--------------|
|
|
94
|
+
| `genesis` | `programId?`, `goal?` | Turns the client into the **Program Genesis agent**: it interviews you to scope a program across your codebases (using `anyforge_list_repo_index` / `anyforge_get_repo_analysis`), writes the program brief, then creates one initiative per in-scope codebase and offers to dispatch the architect on each. |
|
|
95
|
+
|
|
96
|
+
The Genesis flow runs entirely in *your* agent — there's no server-side
|
|
97
|
+
chat-in-a-tool. The prompt gives your client the persona + interview script;
|
|
98
|
+
it drives the conversation and calls the tools above as it goes.
|
|
77
99
|
|
|
78
100
|
## Example prompts
|
|
79
101
|
|
|
@@ -81,6 +103,7 @@ Use the equivalent stdio MCP config (`command: npx`, `args: ["tsx",
|
|
|
81
103
|
- "Show me the plan for approval `abc123` then approve it." → `anyforge_get_approval_detail` → `anyforge_submit_approval`
|
|
82
104
|
- "Add a P1 bug: rate-limit the export endpoint." → `anyforge_create_work_item`
|
|
83
105
|
- "What did crew `xyz` produce? Post a comment asking it to add tests." → `anyforge_get_crew` → `anyforge_post_crew_comment`
|
|
106
|
+
- "Scope a coverage program across our Go services." → run the `genesis` prompt → it lists repos, scopes, and creates an initiative per service.
|
|
84
107
|
|
|
85
108
|
## How it works
|
|
86
109
|
|
package/dist/index.js
CHANGED
|
@@ -19,20 +19,41 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
21
21
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
22
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
22
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, ListPromptsRequestSchema, GetPromptRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
23
23
|
import { hilTools } from './tools/hil.js';
|
|
24
24
|
import { workTools } from './tools/work.js';
|
|
25
25
|
import { initiativeTools } from './tools/initiatives.js';
|
|
26
26
|
import { programTools } from './tools/programs.js';
|
|
27
27
|
import { crewTools } from './tools/crews.js';
|
|
28
28
|
import { coverageTools } from './tools/coverage.js';
|
|
29
|
+
import { repoTools } from './tools/repos.js';
|
|
30
|
+
import { prompts as PROMPTS } from './prompts/genesis.js';
|
|
29
31
|
// ─── Assemble the tool registry ──────────────────────────────────────
|
|
30
|
-
const MODULES = [hilTools, workTools, initiativeTools, programTools, crewTools, coverageTools];
|
|
32
|
+
const MODULES = [hilTools, workTools, initiativeTools, programTools, crewTools, coverageTools, repoTools];
|
|
31
33
|
const TOOLS = MODULES.flatMap(m => m.tools);
|
|
32
34
|
const HANDLERS = Object.assign({}, ...MODULES.map(m => m.handlers));
|
|
35
|
+
const PROMPT_BY_NAME = Object.fromEntries(PROMPTS.map(p => [p.name, p]));
|
|
33
36
|
// ─── Server setup ────────────────────────────────────────────────────
|
|
34
|
-
const server = new Server({ name: 'anyforge', version: '2.
|
|
37
|
+
const server = new Server({ name: 'anyforge', version: '2.3.0' }, { capabilities: { tools: {}, prompts: {} } });
|
|
35
38
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS }));
|
|
39
|
+
// ─── Prompts (guided flows: `genesis`) ───────────────────────────────
|
|
40
|
+
// Prompts turn the MCP client itself into the Genesis agent — see
|
|
41
|
+
// prompts/genesis.ts for the rationale.
|
|
42
|
+
server.setRequestHandler(ListPromptsRequestSchema, async () => ({
|
|
43
|
+
prompts: PROMPTS.map(p => ({ name: p.name, description: p.description, arguments: p.arguments })),
|
|
44
|
+
}));
|
|
45
|
+
server.setRequestHandler(GetPromptRequestSchema, async (request) => {
|
|
46
|
+
const prompt = PROMPT_BY_NAME[request.params.name];
|
|
47
|
+
if (!prompt)
|
|
48
|
+
throw new Error(`unknown prompt "${request.params.name}"`);
|
|
49
|
+
const args = (request.params.arguments ?? {});
|
|
50
|
+
return {
|
|
51
|
+
description: prompt.description,
|
|
52
|
+
messages: [
|
|
53
|
+
{ role: 'user', content: { type: 'text', text: prompt.render(args) } },
|
|
54
|
+
],
|
|
55
|
+
};
|
|
56
|
+
});
|
|
36
57
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
37
58
|
const { name, arguments: args } = request.params;
|
|
38
59
|
const handler = HANDLERS[name];
|
|
@@ -66,7 +87,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
66
87
|
async function main() {
|
|
67
88
|
const transport = new StdioServerTransport();
|
|
68
89
|
await server.connect(transport);
|
|
69
|
-
console.error(`AnyForge MCP Server started (stdio, ${TOOLS.length} tools)`);
|
|
90
|
+
console.error(`AnyForge MCP Server started (stdio, ${TOOLS.length} tools, ${PROMPTS.length} prompts)`);
|
|
70
91
|
}
|
|
71
92
|
main().catch(err => {
|
|
72
93
|
console.error('MCP Server failed to start:', err);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAA;AAChF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC5C,OAAO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E,EAAE,CAAC;YAC/F,OAAO,EAAE,IAAI;SACd,CAAA;IACH,CAAC;AACH,CAAC,CAAC,CAAA;AAEF,wEAAwE;AAExE,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAA;IAC5C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAC/B,OAAO,CAAC,KAAK,CAAC,uCAAuC,KAAK,CAAC,MAAM,WAAW,OAAO,CAAC,MAAM,WAAW,CAAC,CAAA;AACxG,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;IACjB,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,GAAG,CAAC,CAAA;IACjD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `genesis` prompt — the discoverable entry point that turns the MCP
|
|
3
|
+
* client (Claude Code, Cursor, …) INTO the AnyForge Program Genesis agent.
|
|
4
|
+
*
|
|
5
|
+
* We deliberately do NOT pipe a server-side agent through a chat-in-a-tool:
|
|
6
|
+
* the user already has a capable conversational agent (the MCP client), so
|
|
7
|
+
* we give it the Genesis persona + the interview script and let it drive the
|
|
8
|
+
* conversation, calling the AnyForge control tools as it goes. This reads as
|
|
9
|
+
* a natural chat — "talk to Genesis" — and works in any MCP client.
|
|
10
|
+
*
|
|
11
|
+
* Flow it encodes: gather objective → scope codebases (list_repo_index) →
|
|
12
|
+
* gather per-codebase functionality/details (get_repo_analysis to ground) →
|
|
13
|
+
* persist the program brief → propose + confirm one initiative per codebase →
|
|
14
|
+
* create them (create_initiative w/ programId) → dispatch the architect per
|
|
15
|
+
* initiative (dispatch_architect → backlog → approve_backlog).
|
|
16
|
+
*/
|
|
17
|
+
function header(args) {
|
|
18
|
+
const lines = ['You are the **AnyForge Program Genesis agent**, running inside the user\'s terminal via the AnyForge MCP server.'];
|
|
19
|
+
if (args.programId)
|
|
20
|
+
lines.push(`\nYou are scoping the existing program \`${args.programId}\`. Call \`anyforge_get_program\` on it first to load its current name, status, and brief.`);
|
|
21
|
+
else
|
|
22
|
+
lines.push('\nNo program exists yet. Once you understand the objective, create one with `anyforge_create_program` and use its id for everything below.');
|
|
23
|
+
if (args.goal)
|
|
24
|
+
lines.push(`\nThe user's stated goal to start from: "${args.goal}"`);
|
|
25
|
+
return lines.join('\n');
|
|
26
|
+
}
|
|
27
|
+
export const genesisPrompt = {
|
|
28
|
+
name: 'genesis',
|
|
29
|
+
description: 'Start a Program Genesis session: chat with the AnyForge Genesis agent to scope a program ' +
|
|
30
|
+
'across your codebases and create one initiative per codebase, then dispatch the architect on each.',
|
|
31
|
+
arguments: [
|
|
32
|
+
{ name: 'programId', description: 'Existing program to scope (omit to create a new one during the chat).', required: false },
|
|
33
|
+
{ name: 'goal', description: 'One-line program goal to seed the conversation (optional).', required: false },
|
|
34
|
+
],
|
|
35
|
+
render: (args) => `${header(args)}
|
|
36
|
+
|
|
37
|
+
Your job is to interview the user until you have enough to define **proper, codebase-scoped initiatives** under this program, then create them and (on the user's go-ahead) dispatch the architect on each. Initiatives are always scoped to a single codebase — one program fans out into one initiative per in-scope codebase.
|
|
38
|
+
|
|
39
|
+
## How to run the conversation
|
|
40
|
+
Ask questions in small clusters — never dump the whole questionnaire at once. Listen, then go deeper where the answer is thin. Use the tools to ground every step in real data rather than guessing.
|
|
41
|
+
|
|
42
|
+
**1. Objective & outcome.** What is this program trying to achieve, and what's the business outcome / definition of done? (e.g. "raise test coverage above 90% across the payments services", "migrate the Go services off the deprecated auth SDK".)
|
|
43
|
+
|
|
44
|
+
**2. Scope the codebases.** Call \`anyforge_list_repo_index\` to show real candidates (default = active repos; for a coverage/quality program pass \`belowCoverage\` to get the repos below the target, worst-first). Present them and ask the user which are in scope. For the handful you or the user are unsure about, call \`anyforge_get_repo_analysis\` to see coverage, architecture health, gap count, and languages — that tells you how far each repo is from the goal. Confirm the final in-scope set explicitly.
|
|
45
|
+
|
|
46
|
+
**3. Per-codebase detail.** For each in-scope codebase, gather what the program actually means *there*: which functionality/areas, the specific work expected, constraints, and any nuances. Pull \`anyforge_get_repo_analysis\` to anchor this in the repo's real state. Keep asking until each codebase has enough for an architect to decompose it into real work — not a vague one-liner.
|
|
47
|
+
|
|
48
|
+
**4. Success criteria & guardrails.** Coverage target, deadlines, priorities/ordering across codebases, anything explicitly out of scope.
|
|
49
|
+
|
|
50
|
+
## When scope is clear
|
|
51
|
+
**5. Persist the brief.** Call \`anyforge_write_program_brief\` with a markdown charter (Purpose, Goals, Rationale, Scope in/out, Success metrics, Key context & sources). This grounds the program and seeds every initiative's architect context — so write it well.
|
|
52
|
+
|
|
53
|
+
**6. Propose initiatives — then STOP for confirmation.** Present a table: one initiative per in-scope codebase, each with a name, the repo, and a 1–2 sentence intent derived from the objective + that repo's analysis. Do **not** create anything yet. Ask the user to confirm, edit names/intents, drop or add codebases.
|
|
54
|
+
|
|
55
|
+
**7. Create them.** On confirmation, call \`anyforge_create_initiative\` once per codebase with: \`programId\`, \`name\`, \`description\`, \`defaultGithubRepo\` (the repo), \`defaultGithubBranch\` (its default branch from the index), and a \`brdContent\` that captures that codebase's slice of the program (objective + specific functionality/details + success criteria). It's idempotent — it de-dupes on name within the program/repo. Report the created initiative ids/codes.
|
|
56
|
+
|
|
57
|
+
**8. Dispatch the architect.** Tell the user each initiative starts in DRAFT and the architect decomposes it into a backlog that lands at HIL #1 for approval. Offer to dispatch — call \`anyforge_dispatch_architect\` per initiative (one at a time, or all of them, the user's choice). After review, \`anyforge_approve_backlog\` moves an initiative to IN_PROGRESS and crews pick it up.
|
|
58
|
+
|
|
59
|
+
## Rules
|
|
60
|
+
- Ground every claim in tool output — never invent repos, coverage numbers, or codebase facts.
|
|
61
|
+
- Never write (create program/initiative, write brief) before the user has confirmed the relevant step.
|
|
62
|
+
- One initiative per codebase; reflect the program brief into each initiative's \`brdContent\`.
|
|
63
|
+
- If the user gives you everything up front, still confirm the proposed initiative list before creating.
|
|
64
|
+
|
|
65
|
+
Begin by ${args.programId ? 'loading the program, then confirming the objective' : 'asking for the program objective'}.`,
|
|
66
|
+
};
|
|
67
|
+
export const prompts = [genesisPrompt];
|
|
68
|
+
//# sourceMappingURL=genesis.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"genesis.js","sourceRoot":"","sources":["../../prompts/genesis.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,SAAS,MAAM,CAAC,IAA4B;IAC1C,MAAM,KAAK,GAAG,CAAC,kHAAkH,CAAC,CAAA;IAClI,IAAI,IAAI,CAAC,SAAS;QAAE,KAAK,CAAC,IAAI,CAAC,4CAA4C,IAAI,CAAC,SAAS,4FAA4F,CAAC,CAAA;;QACjL,KAAK,CAAC,IAAI,CAAC,4IAA4I,CAAC,CAAA;IAC7J,IAAI,IAAI,CAAC,IAAI;QAAE,KAAK,CAAC,IAAI,CAAC,4CAA4C,IAAI,CAAC,IAAI,GAAG,CAAC,CAAA;IACnF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED,MAAM,CAAC,MAAM,aAAa,GAAc;IACtC,IAAI,EAAE,SAAS;IACf,WAAW,EACT,2FAA2F;QAC3F,oGAAoG;IACtG,SAAS,EAAE;QACT,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,uEAAuE,EAAE,QAAQ,EAAE,KAAK,EAAE;QAC5H,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,4DAA4D,EAAE,QAAQ,EAAE,KAAK,EAAE;KAC7G;IACD,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA8BxB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,oDAAoD,CAAC,CAAC,CAAC,kCAAkC,GAAG;CACvH,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAgB,CAAC,aAAa,CAAC,CAAA"}
|
|
@@ -50,6 +50,41 @@ export const initiativeTools = {
|
|
|
50
50
|
required: ['initiativeId', 'crewId', 'messageId'],
|
|
51
51
|
},
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
name: 'anyforge_create_initiative',
|
|
55
|
+
description: 'Create an initiative (optionally under a program). De-dupes on name within the same ' +
|
|
56
|
+
'codebase or program+repo, so re-runs return the existing one. Starts in DRAFT; dispatch ' +
|
|
57
|
+
'the architect to decompose it into a backlog. Requires `write` scope.',
|
|
58
|
+
inputSchema: {
|
|
59
|
+
type: 'object',
|
|
60
|
+
properties: {
|
|
61
|
+
name: { type: 'string', description: 'Initiative name.' },
|
|
62
|
+
description: { type: 'string', description: 'What needs to be done (the intent).' },
|
|
63
|
+
programId: { type: 'string', description: 'Parent program id (links it under a program).' },
|
|
64
|
+
defaultGithubRepo: { type: 'string', description: 'Repo the crews run on, "owner/name".' },
|
|
65
|
+
defaultGithubBranch: { type: 'string', description: 'Base branch (default "main").' },
|
|
66
|
+
priority: { type: 'string', description: 'P0 / P1 (default) / P2 / P3.' },
|
|
67
|
+
tokenBudget: { type: 'number', description: 'Token budget cap (default 50000).' },
|
|
68
|
+
contextNotes: { type: 'string', description: 'Extra context for the architect.' },
|
|
69
|
+
brdContent: { type: 'string', description: 'Business-requirements doc text (seeds decomposition).' },
|
|
70
|
+
codebaseId: { type: 'string', description: 'Linked codebase id, when created from a gap finding.' },
|
|
71
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Free-form tags.' },
|
|
72
|
+
},
|
|
73
|
+
required: ['name', 'description'],
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
name: 'anyforge_dispatch_architect',
|
|
78
|
+
description: 'Run (or re-run) the architect decomposition for an initiative: (re)creates the ' +
|
|
79
|
+
'decomposition crew, clears any prior error, and starts the architect, which proposes a ' +
|
|
80
|
+
'backlog for HIL #1 approval. Use after creating an initiative, or to retry a failed ' +
|
|
81
|
+
'decomposition. Requires `write` scope.',
|
|
82
|
+
inputSchema: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: { initiativeId: { type: 'string', description: 'The initiative id.' } },
|
|
85
|
+
required: ['initiativeId'],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
53
88
|
],
|
|
54
89
|
handlers: {
|
|
55
90
|
anyforge_list_initiatives: args => callControl('GET', `/initiatives${qs({ status: args.status })}`),
|
|
@@ -59,6 +94,20 @@ export const initiativeTools = {
|
|
|
59
94
|
crewId: args.crewId,
|
|
60
95
|
messageId: args.messageId,
|
|
61
96
|
}),
|
|
97
|
+
anyforge_create_initiative: args => callControl('POST', '/initiatives', {
|
|
98
|
+
name: args.name,
|
|
99
|
+
description: args.description,
|
|
100
|
+
programId: args.programId,
|
|
101
|
+
defaultGithubRepo: args.defaultGithubRepo,
|
|
102
|
+
defaultGithubBranch: args.defaultGithubBranch,
|
|
103
|
+
priority: args.priority,
|
|
104
|
+
tokenBudget: args.tokenBudget,
|
|
105
|
+
contextNotes: args.contextNotes,
|
|
106
|
+
brdContent: args.brdContent,
|
|
107
|
+
codebaseId: args.codebaseId,
|
|
108
|
+
tags: args.tags,
|
|
109
|
+
}),
|
|
110
|
+
anyforge_dispatch_architect: args => callControl('POST', `/initiatives/${encodeURIComponent(String(args.initiativeId))}/dispatch-architect`),
|
|
62
111
|
},
|
|
63
112
|
};
|
|
64
113
|
//# sourceMappingURL=initiatives.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initiatives.js","sourceRoot":"","sources":["../../tools/initiatives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAGrD;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAe;IACzC,KAAK,EAAE;QACL;YACE,IAAI,EAAE,2BAA2B;YACjC,W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+
{
|
|
28
|
+
name: 'anyforge_create_program',
|
|
29
|
+
description: 'Create a program (the cross-initiative grouping). Use this to set up a body of work ' +
|
|
30
|
+
'before adding initiatives under it. Requires `write` scope.',
|
|
31
|
+
inputSchema: {
|
|
32
|
+
type: 'object',
|
|
33
|
+
properties: {
|
|
34
|
+
name: { type: 'string', description: 'Program name.' },
|
|
35
|
+
description: { type: 'string', description: 'What the program is for.' },
|
|
36
|
+
status: { type: 'string', description: 'PLANNING (default), IN_PROGRESS, COMPLETE, or CANCELLED.' },
|
|
37
|
+
ownerId: { type: 'string', description: 'Owning operator uid. Defaults to the key user.' },
|
|
38
|
+
targetDate: { type: 'string', description: 'Target completion date (ISO yyyy-mm-dd).' },
|
|
39
|
+
coverageTarget: { type: 'number', description: 'Test-coverage goal 0–100 (e.g. 90).' },
|
|
40
|
+
brief: { type: 'string', description: 'Program charter / brief (markdown).' },
|
|
41
|
+
tags: { type: 'array', items: { type: 'string' }, description: 'Free-form tags.' },
|
|
42
|
+
},
|
|
43
|
+
required: ['name'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'anyforge_write_program_brief',
|
|
48
|
+
description: "Write or update a program's Brief — the canonical markdown charter (Purpose, Goals, Rationale, " +
|
|
49
|
+
'Scope (in/out), Success metrics, Key context & sources). Synthesize it from the program goal, the ' +
|
|
50
|
+
'codebases scoped in, this conversation, and any documents the user shared. The brief grounds future ' +
|
|
51
|
+
"Genesis chats and seeds each initiative's architect context, so a clear program purpose flows down " +
|
|
52
|
+
'to work-item decomposition. Call it once scope is clear, before creating the per-codebase ' +
|
|
53
|
+
'initiatives. Requires `write` scope.',
|
|
54
|
+
inputSchema: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
programId: { type: 'string', description: 'The program to write the brief on.' },
|
|
58
|
+
brief: { type: 'string', description: 'The full program brief in markdown (≤16000 chars). Replaces the current brief.' },
|
|
59
|
+
},
|
|
60
|
+
required: ['programId', 'brief'],
|
|
61
|
+
},
|
|
62
|
+
},
|
|
27
63
|
],
|
|
28
64
|
handlers: {
|
|
65
|
+
anyforge_write_program_brief: args => callControl('PATCH', `/programs/${encodeURIComponent(String(args.programId))}`, {
|
|
66
|
+
brief: args.brief,
|
|
67
|
+
}),
|
|
29
68
|
anyforge_list_programs: args => callControl('GET', `/programs${qs({ status: args.status })}`),
|
|
30
69
|
anyforge_get_program: args => callControl('GET', `/programs/${encodeURIComponent(String(args.programId))}`),
|
|
70
|
+
anyforge_create_program: args => callControl('POST', '/programs', {
|
|
71
|
+
name: args.name,
|
|
72
|
+
description: args.description,
|
|
73
|
+
status: args.status,
|
|
74
|
+
ownerId: args.ownerId,
|
|
75
|
+
targetDate: args.targetDate,
|
|
76
|
+
coverageTarget: args.coverageTarget,
|
|
77
|
+
brief: args.brief,
|
|
78
|
+
tags: args.tags,
|
|
79
|
+
}),
|
|
31
80
|
},
|
|
32
81
|
};
|
|
33
82
|
//# sourceMappingURL=programs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"programs.js","sourceRoot":"","sources":["../../tools/programs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAGrD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAe;IACtC,KAAK,EAAE;QACL;YACE,IAAI,EAAE,wBAAwB;YAC9B,WAAW,EACT,gFAAgF;gBAChF,2FAA2F;YAC7F,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,uCAAuC,EAAE;iBACjF;aACF;SACF;QACD;YACE,IAAI,EAAE,sBAAsB;YAC5B,WAAW,EAAE,6BAA6B;YAC1C,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,Q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AkB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE;YAC9E,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;QACJ,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAC7B,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,MAA4B,EAAE,CAAC,EAAE,CAAC;QACrF,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAC3B,WAAW,CAAC,KAAK,EAAE,aAAa,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QAC/E,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAC9B,WAAW,CAAC,MAAM,EAAE,WAAW,EAAE;YAC/B,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,cAAc,EAAE,IAAI,CAAC,cAAc;YACnC,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;SAChB,CAAC;KACL;CACF,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ToolModule } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Repo tools — read the org repo index and a single repo's analysis
|
|
4
|
+
* (the READ primitives Program Genesis uses to scope a program), kick
|
|
5
|
+
* codebase analysis directly, or launch the server-side paced coverage
|
|
6
|
+
* sweep that walks every repo through Phase 1 then Phase 2 without
|
|
7
|
+
* exhausting the operator's token window. Analysis/sweep run on the key
|
|
8
|
+
* user's credential (per-user OAuth → company key) and require `write`
|
|
9
|
+
* scope; the reads need only `read`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const repoTools: ToolModule;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { callControl, qs } from '../lib/apiClient.js';
|
|
2
|
+
/**
|
|
3
|
+
* Repo tools — read the org repo index and a single repo's analysis
|
|
4
|
+
* (the READ primitives Program Genesis uses to scope a program), kick
|
|
5
|
+
* codebase analysis directly, or launch the server-side paced coverage
|
|
6
|
+
* sweep that walks every repo through Phase 1 then Phase 2 without
|
|
7
|
+
* exhausting the operator's token window. Analysis/sweep run on the key
|
|
8
|
+
* user's credential (per-user OAuth → company key) and require `write`
|
|
9
|
+
* scope; the reads need only `read`.
|
|
10
|
+
*/
|
|
11
|
+
export const repoTools = {
|
|
12
|
+
tools: [
|
|
13
|
+
{
|
|
14
|
+
name: 'anyforge_list_repo_index',
|
|
15
|
+
description: "List the repositories in this company's org-level repo index, with activity classification " +
|
|
16
|
+
'(active = pushed recently, stable = no recent pushes, deprecated = archived), whether each repo ' +
|
|
17
|
+
'already has an AnyForge analysis, and its known coverage %. Use this FIRST when scoping a ' +
|
|
18
|
+
'program to discover candidate codebases. Defaults to active repos. To scope a coverage/quality ' +
|
|
19
|
+
'program in one shot, pass belowCoverage (e.g. 90) — returns only repos with known coverage ' +
|
|
20
|
+
'below it, worst-first. The result includes total counts so you know how many were omitted by the cap.',
|
|
21
|
+
inputSchema: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
properties: {
|
|
24
|
+
activityStatus: {
|
|
25
|
+
type: 'string',
|
|
26
|
+
enum: ['active', 'stable', 'deprecated', 'all'],
|
|
27
|
+
description: 'Activity filter. Default "active".',
|
|
28
|
+
},
|
|
29
|
+
language: { type: 'string', description: 'Primary-language filter (exact, case-insensitive), e.g. "Go".' },
|
|
30
|
+
belowCoverage: { type: 'number', description: 'Only repos with KNOWN coverage below this % (worst-first). Repos with unknown coverage are excluded.' },
|
|
31
|
+
limit: { type: 'number', description: 'Max repos to return (default 100, max 200).' },
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'anyforge_get_repo_analysis',
|
|
37
|
+
description: 'Get the AnyForge analysis summary for a single repo (coverage %, architecture red/amber/green ' +
|
|
38
|
+
'counts, open gap count, languages) to assess its relevance and distance from the program goal. ' +
|
|
39
|
+
'Returns `analyzed: false` with a note when the repo has no analysis yet — it can still be scoped ' +
|
|
40
|
+
'in. Call this for the handful of repos you are unsure about, NOT for every repo in a large org.',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
properties: {
|
|
44
|
+
repoFullName: { type: 'string', description: 'The "owner/name" repo, exactly as listed by anyforge_list_repo_index.' },
|
|
45
|
+
},
|
|
46
|
+
required: ['repoFullName'],
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'anyforge_analyze_repos',
|
|
51
|
+
description: 'Start Phase-1 codebase analysis for one or more repos. Idempotent — already-analyzed ' +
|
|
52
|
+
'repos return `already_analyzed`, in-flight ones `already_running` (never re-run). Up to ' +
|
|
53
|
+
'25 repos per call; chunk larger sets or use anyforge_start_coverage_sweep instead. ' +
|
|
54
|
+
'Requires `write` scope.',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {
|
|
58
|
+
repos: {
|
|
59
|
+
type: 'array',
|
|
60
|
+
items: { type: 'string' },
|
|
61
|
+
description: 'Repo full names ("owner/name"), max 25 per call.',
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
required: ['repos'],
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: 'anyforge_start_coverage_sweep',
|
|
69
|
+
description: 'Launch a hands-off, paced analysis sweep: runs Phase 1 across every repo, then Phase 2, ' +
|
|
70
|
+
'keeping at most `concurrency` analyses in flight so the operator OAuth token window is ' +
|
|
71
|
+
'never exhausted. Seed from a programId (derives repos from its initiatives) or an explicit ' +
|
|
72
|
+
'repos list. Re-seeding overwrites the current sweep. Requires `write` scope.',
|
|
73
|
+
inputSchema: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
programId: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'Derive the repo set from this program’s initiatives.',
|
|
79
|
+
},
|
|
80
|
+
repos: {
|
|
81
|
+
type: 'array',
|
|
82
|
+
items: { type: 'string' },
|
|
83
|
+
description: 'Explicit repo full names ("owner/name"). Used when programId is omitted.',
|
|
84
|
+
},
|
|
85
|
+
concurrency: {
|
|
86
|
+
type: 'number',
|
|
87
|
+
description: 'Max in-flight analyses per phase (default 5, 1–10).',
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'anyforge_refresh_repo_index',
|
|
94
|
+
description: 'Refresh the org repo index now instead of waiting for the nightly sweep. Re-lists every ' +
|
|
95
|
+
"repo's metadata AND auto-detects COMMITTED coverage: for repos with no crew/CI coverage, it " +
|
|
96
|
+
'reads the repo tree for a checked-in coverage report (lcov.info, coverage-summary.json, ' +
|
|
97
|
+
'cobertura, clover) and records the parsed %, so a repo that publishes coverage in git shows ' +
|
|
98
|
+
'a number without a crew run or a manual upload. Runs in the background — re-read the repo ' +
|
|
99
|
+
'index / coverage panel shortly after. Requires `write` scope.',
|
|
100
|
+
inputSchema: { type: 'object', properties: {} },
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
handlers: {
|
|
104
|
+
anyforge_list_repo_index: args => callControl('GET', `/repos${qs({
|
|
105
|
+
activityStatus: args.activityStatus,
|
|
106
|
+
language: args.language,
|
|
107
|
+
belowCoverage: args.belowCoverage,
|
|
108
|
+
limit: args.limit,
|
|
109
|
+
})}`),
|
|
110
|
+
anyforge_get_repo_analysis: args => callControl('GET', `/repos/analysis${qs({ repo: args.repoFullName })}`),
|
|
111
|
+
anyforge_analyze_repos: args => callControl('POST', '/repos/analyze', { repos: args.repos }),
|
|
112
|
+
anyforge_start_coverage_sweep: args => callControl('POST', '/repos/analyze-sweep', {
|
|
113
|
+
programId: args.programId,
|
|
114
|
+
repos: args.repos,
|
|
115
|
+
concurrency: args.concurrency,
|
|
116
|
+
}),
|
|
117
|
+
anyforge_refresh_repo_index: () => callControl('POST', '/repos/index-refresh', {}),
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
//# sourceMappingURL=repos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repos.js","sourceRoot":"","sources":["../../tools/repos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,qBAAqB,CAAA;AAGrD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,SAAS,GAAe;IACnC,KAAK,EAAE;QACL;YACE,IAAI,EAAE,0BAA0B;YAChC,WAAW,EACT,6FAA6F;gBAC7F,kGAAkG;gBAClG,4FAA4F;gBAC5F,iGAAiG;gBACjG,6FAA6F;gBAC7F,uGAAuG;YACzG,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,cAAc,EAAE;wBACd,IAAI,EAAE,QAAQ;wBACd,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC;wBAC/C,WAAW,EAAE,oCAAoC;qBAClD;oBACD,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+DAA+D,EAAE;oBAC1G,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,sGAAsG,EAAE;oBACtJ,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6CAA6C,EAAE;iBACtF;aACF;SACF;QACD;YACE,IAAI,EAAE,4BAA4B;YAClC,WAAW,EACT,gGAAgG;gBAChG,iGAAiG;gBACjG,mGAAmG;gBACnG,iGAAiG;YACnG,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE;oBACV,YAAY,EAAE,EAAE,IAAI,EAAE,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C;YAC7B,cAAc,EAAE,IAAI,CAAC,cAAoC;YACzD,QAAQ,EAAE,IAAI,CAAC,QAA8B;YAC7C,aAAa,EAAE,IAAI,CAAC,aAAmC;YACvD,KAAK,EAAE,IAAI,CAAC,KAA2B;SACxC,CAAC,EAAE,CAAC;QACP,0BAA0B,EAAE,IAAI,CAAC,EAAE,CACjC,WAAW,CAAC,KAAK,EAAE,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,YAAkC,EAAE,CAAC,EAAE,CAAC;QAC/F,sBAAsB,EAAE,IAAI,CAAC,EAAE,CAC7B,WAAW,CAAC,MAAM,EAAE,gBAAgB,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9D,6BAA6B,EAAE,IAAI,CAAC,EAAE,CACpC,WAAW,CAAC,MAAM,EAAE,sBAAsB,EAAE;YAC1C,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;QACJ,2BAA2B,EAAE,GAAG,EAAE,CAChC,WAAW,CAAC,MAAM,EAAE,sBAAsB,EAAE,EAAE,CAAC;KAClD;CACF,CAAA"}
|
package/dist/tools/types.d.ts
CHANGED
|
@@ -19,3 +19,21 @@ export interface ToolModule {
|
|
|
19
19
|
tools: ToolDef[];
|
|
20
20
|
handlers: Record<string, ToolHandler>;
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* MCP prompt — a server-provided, parameterised conversation starter.
|
|
24
|
+
* Claude Code surfaces these as slash commands (e.g.
|
|
25
|
+
* `/mcp__anyforge__genesis`), so they're the discoverable entry point
|
|
26
|
+
* for a guided flow. `render` turns the invocation arguments into the
|
|
27
|
+
* user-message text the client injects to kick off the conversation.
|
|
28
|
+
*/
|
|
29
|
+
export interface PromptArg {
|
|
30
|
+
name: string;
|
|
31
|
+
description: string;
|
|
32
|
+
required?: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface PromptDef {
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
arguments: PromptArg[];
|
|
38
|
+
render: (args: Record<string, string>) => string;
|
|
39
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anyforge/mcp-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "AnyForge MCP Server — drive AnyForge (HIL approvals, initiatives, work items, crews) from Claude CLI, Cursor, and other MCP clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|