@context-forge/mcp 0.8.5 → 0.9.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.
Files changed (61) hide show
  1. package/dist/index.d.ts +3 -0
  2. package/dist/index.d.ts.map +1 -0
  3. package/dist/index.js +51 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/tools/agentGuideTool.d.ts +3 -0
  6. package/dist/tools/agentGuideTool.d.ts.map +1 -0
  7. package/dist/tools/agentGuideTool.js +83 -0
  8. package/dist/tools/agentGuideTool.js.map +1 -0
  9. package/dist/tools/agentOnboardTool.d.ts +3 -0
  10. package/dist/tools/agentOnboardTool.d.ts.map +1 -0
  11. package/dist/tools/agentOnboardTool.js +85 -0
  12. package/dist/tools/agentOnboardTool.js.map +1 -0
  13. package/dist/tools/agentQuickstartTool.d.ts +3 -0
  14. package/dist/tools/agentQuickstartTool.d.ts.map +1 -0
  15. package/dist/tools/agentQuickstartTool.js +60 -0
  16. package/dist/tools/agentQuickstartTool.js.map +1 -0
  17. package/dist/tools/configTools.d.ts +3 -0
  18. package/dist/tools/configTools.d.ts.map +1 -0
  19. package/dist/tools/configTools.js +76 -0
  20. package/dist/tools/configTools.js.map +1 -0
  21. package/dist/tools/contextTools.d.ts +28 -0
  22. package/dist/tools/contextTools.d.ts.map +1 -0
  23. package/dist/tools/contextTools.js +229 -0
  24. package/dist/tools/contextTools.js.map +1 -0
  25. package/dist/tools/guideTools.d.ts +3 -0
  26. package/dist/tools/guideTools.d.ts.map +1 -0
  27. package/dist/tools/guideTools.js +130 -0
  28. package/dist/tools/guideTools.js.map +1 -0
  29. package/dist/tools/introspectionTools.d.ts +3 -0
  30. package/dist/tools/introspectionTools.d.ts.map +1 -0
  31. package/dist/tools/introspectionTools.js +276 -0
  32. package/dist/tools/introspectionTools.js.map +1 -0
  33. package/dist/tools/projectTools.d.ts +3 -0
  34. package/dist/tools/projectTools.d.ts.map +1 -0
  35. package/dist/tools/projectTools.js +264 -0
  36. package/dist/tools/projectTools.js.map +1 -0
  37. package/dist/tools/resolveOperationPath.d.ts +28 -0
  38. package/dist/tools/resolveOperationPath.d.ts.map +1 -0
  39. package/dist/tools/resolveOperationPath.js +56 -0
  40. package/dist/tools/resolveOperationPath.js.map +1 -0
  41. package/dist/tools/resolveProjectId.d.ts +14 -0
  42. package/dist/tools/resolveProjectId.d.ts.map +1 -0
  43. package/dist/tools/resolveProjectId.js +86 -0
  44. package/dist/tools/resolveProjectId.js.map +1 -0
  45. package/dist/tools/stateTools.d.ts +3 -0
  46. package/dist/tools/stateTools.d.ts.map +1 -0
  47. package/dist/tools/stateTools.js +55 -0
  48. package/dist/tools/stateTools.js.map +1 -0
  49. package/dist/tools/versionTool.d.ts +3 -0
  50. package/dist/tools/versionTool.d.ts.map +1 -0
  51. package/dist/tools/versionTool.js +11 -0
  52. package/dist/tools/versionTool.js.map +1 -0
  53. package/dist/tools/workflowTools.d.ts +3 -0
  54. package/dist/tools/workflowTools.d.ts.map +1 -0
  55. package/dist/tools/workflowTools.js +272 -0
  56. package/dist/tools/workflowTools.js.map +1 -0
  57. package/dist/tools/worktreeTools.d.ts +3 -0
  58. package/dist/tools/worktreeTools.d.ts.map +1 -0
  59. package/dist/tools/worktreeTools.js +234 -0
  60. package/dist/tools/worktreeTools.js.map +1 -0
  61. package/package.json +2 -2
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ // MCP SDK: @modelcontextprotocol/sdk v1.26.0 (v1 monolithic package)
3
+ // Zod: v4.1.5 — imported as `z` from 'zod'
4
+ import { createRequire } from 'node:module';
5
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
7
+ import { registerProjectTools } from './tools/projectTools.js';
8
+ import { registerContextTools } from './tools/contextTools.js';
9
+ import { registerStateTools } from './tools/stateTools.js';
10
+ import { registerConfigTools } from './tools/configTools.js';
11
+ import { registerIntrospectionTools } from './tools/introspectionTools.js';
12
+ import { registerWorkflowTools } from './tools/workflowTools.js';
13
+ import { registerWorktreeTools } from './tools/worktreeTools.js';
14
+ import { registerVersionTool } from './tools/versionTool.js';
15
+ import { registerGuideTools } from './tools/guideTools.js';
16
+ import { registerAgentOnboardTool } from './tools/agentOnboardTool.js';
17
+ import { registerAgentQuickstartTool } from './tools/agentQuickstartTool.js';
18
+ const require = createRequire(import.meta.url);
19
+ const { version: SERVER_VERSION } = require('../package.json');
20
+ const SERVER_NAME = 'context-forge-mcp';
21
+ function log(message) {
22
+ console.error(`[${SERVER_NAME}] ${message}`);
23
+ }
24
+ async function main() {
25
+ const server = new McpServer({
26
+ name: SERVER_NAME,
27
+ version: SERVER_VERSION,
28
+ });
29
+ // Registration order matters — some MCP clients truncate tool lists.
30
+ // High-priority tools first to maximize usability on limited clients.
31
+ registerAgentOnboardTool(server); // onboarding recipe for new projects
32
+ registerAgentQuickstartTool(server, SERVER_VERSION); // structured schema for machine consumers
33
+ registerProjectTools(server, SERVER_VERSION); // core: list, get, create, update
34
+ registerWorkflowTools(server); // what to do next
35
+ registerContextTools(server); // build prompts
36
+ registerGuideTools(server); // install/check guides
37
+ registerIntrospectionTools(server); // read project artifacts
38
+ registerWorktreeTools(server); // parallel work
39
+ registerConfigTools(server, SERVER_VERSION); // rarely needed
40
+ registerStateTools(server); // backup
41
+ registerVersionTool(server, SERVER_NAME, SERVER_VERSION);
42
+ const transport = new StdioServerTransport();
43
+ await server.connect(transport);
44
+ log('Server started');
45
+ }
46
+ main().catch((error) => {
47
+ const message = error instanceof Error ? error.message : String(error);
48
+ console.error(`[${SERVER_NAME}] Fatal error: ${message}`);
49
+ process.exit(1);
50
+ });
51
+ //# sourceM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,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerAgentGuideTool(server: McpServer): void;
3
+ //# sourceMappingURL=agentGuideTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentGuideTool.d.ts","sourceRoot":"","sources":["../../src/tools/agentGuideTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AA2EpE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAc9D"}
@@ -0,0 +1,83 @@
1
+ const AGENT_GUIDE = `# Context Forge — Agent Guide
2
+
3
+ Context Forge manages AI-assisted development projects through structured phases:
4
+ Concept → Architecture → Slice Planning → Slice Design → Task Breakdown → Implementation
5
+
6
+ Call this tool first to understand what's available and how to use it.
7
+
8
+ ## Quick Start
9
+
10
+ - **New user / no project yet?** Call **agent_onboard** — it returns step-by-step instructions to create a project and start working.
11
+ - **Existing project?** Follow this sequence:
12
+
13
+ 1. **project_list** — See all registered projects. Find the one matching the user's current directory.
14
+ 2. **project_get** — Get full details for a project (phase, active slice, task file, etc.).
15
+ 3. **workflow_next** — Get the recommended next action with rationale and suggested command.
16
+ 4. **context_build** — Generate a structured context prompt for the current project state.
17
+
18
+ ## Tool Categories
19
+
20
+ ### Project (start here)
21
+ - **project_list** — List all projects (use to find project by path)
22
+ - **project_get** — Full project details with introspection
23
+ - **project_create** — Create a new project (name + path required)
24
+ - **project_update** — Update project fields
25
+ - **project_schema** — Show all available project fields and valid values
26
+ - **project_structure** — Show project directory structure
27
+
28
+ ### Workflow (what to do next)
29
+ - **workflow_next** — Recommended next action based on project state
30
+ - **workflow_status** — Current phase, slice, and task progress
31
+ - **workflow_check** — Run consistency checks on project artifacts
32
+ - **workflow_future** — Consolidated future work across slice plans
33
+
34
+ ### Context (build prompts)
35
+ - **context_build** — Assemble a full context prompt for an AI session
36
+ - **context_summarize** — Summarize project context
37
+ - **template_preview** — Preview a prompt template with variables
38
+ - **prompt_list** — List available prompt templates
39
+ - **prompt_get** — Get a specific prompt template
40
+
41
+ ### Introspection (read project artifacts)
42
+ - **introspection_documents** — Detect documents for a slice index
43
+ - **introspection_frontmatter** — Parse YAML frontmatter from a document
44
+ - **introspection_slice_plan** — Parse a slice plan file
45
+ - **introspection_tasks** — Parse task files with completion state
46
+ - **introspection_future_work** — Future work items across plans
47
+
48
+ ### Guides
49
+ - **guide_status** — Check if the AI project guide is installed
50
+ - **guide_install** — Install the methodology guide
51
+ - **guide_update** — Update to latest guide version
52
+
53
+ ### Worktrees (parallel work in git worktrees)
54
+ - **worktree_list**, **worktree_get**, **worktree_init**, **worktree_update**, **worktree_rm**
55
+
56
+ ### Configuration
57
+ - **config_get** — Get a single config key, or omit key to list all settings (rarely needed)
58
+ - **config_set** — Set a config value at user or project scope
59
+
60
+ ### Meta
61
+ - **agent_onboard** — Step-by-step onboarding recipe for new projects
62
+ - **server_version** — Server name and version
63
+ - **storage_backup** — Create a versioned backup of project data
64
+
65
+ ## Common Mistakes
66
+
67
+ - Do NOT start with config_get — configuration is rarely relevant to the user's task.
68
+ - Do NOT call project_update without the user asking to change something.
69
+ - Do NOT guess project IDs — call project_list first to find the right one.
70
+ - If the user says "what's next" or "what should I do", call workflow_next.
71
+ - If the user wants to start a session, call context_build for a full context prompt.
72
+ `;
73
+ export function registerAgentGuideTool(server) {
74
+ server.registerTool('agent_guide', {
75
+ title: 'Agent Guide',
76
+ description: 'How to use Context Forge tools. Call this first to understand available tools, common workflows, and what to avoid.',
77
+ inputSchema: {},
78
+ annotations: { readOnlyHint: true, openWorldHint: false },
79
+ }, async () => ({
80
+ content: [{ type: 'text', text: AGENT_GUIDE }],
81
+ }));
82
+ }
83
+ //# sourceMappingURL=agentGuideTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentGuideTool.js","sourceRoot":"","sources":["../../src/tools/agentGuideTool.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEnB,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,MAAiB;IACtD,MAAM,CAAC,YAAY,CACjB,aAAa,EACb;QACE,KAAK,EAAE,aAAa;QACpB,WAAW,EACT,qHAAqH;QACvH,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1D,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;KACxD,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerAgentOnboardTool(server: McpServer): void;
3
+ //# sourceMappingURL=agentOnboardTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentOnboardTool.d.ts","sourceRoot":"","sources":["../../src/tools/agentOnboardTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAiEpE,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA0BhE"}
@@ -0,0 +1,85 @@
1
+ import { z } from 'zod';
2
+ const ONBOARD_GUIDE = `# Context Forge Onboarding
3
+
4
+ Follow these steps in order to set up a new Context Forge project and guide the
5
+ user into their first phase of work. Skip any step whose precondition is already met.
6
+
7
+ ## Step 1 — Detect existing project
8
+
9
+ Check whether a Context Forge project is already registered at the current
10
+ working directory.
11
+
12
+ Call \`project_list\`. Scan results for a project whose \`projectPath\` matches
13
+ the current directory.
14
+
15
+ - If a project exists at this path → skip to Step 3.
16
+ - If no project exists → continue to Step 2.
17
+
18
+ ## Step 2 — Create project
19
+
20
+ Ask the user what they'd like to name their project. If a project name argument
21
+ was provided, use that. If the user declines to choose, default to the current
22
+ directory name.
23
+
24
+ Run \`cf init <name>\` via the shell. This single command handles everything:
25
+ git initialization, project registration, guide installation, command
26
+ installation, and IDE setup.
27
+
28
+ **Important:** Do not rely on environment context (like "Is a git repository")
29
+ to determine git status — \`cf init\` checks the actual directory and handles
30
+ git initialization itself.
31
+
32
+ If shell access is unavailable, fall back to the MCP path:
33
+ 1. Call \`project_create\` with \`name\` and \`projectPath\` (the CWD).
34
+ 2. Call \`guide_install\` to install the AI Project Guide.
35
+ Note: the MCP fallback cannot initialize git. If the directory is not a git
36
+ repository, inform the user they need to run \`git init\` first.
37
+
38
+ ## Step 3 — Transition to concept discussion
39
+
40
+ The project is set up. Now begin the Phase 0 (Concept) conversation.
41
+
42
+ Call \`context_build\` to generate the concept-phase context prompt. Use the
43
+ returned prompt as your working context to guide the conversation.
44
+
45
+ Begin by asking the user to describe what they want to build. Guide them through
46
+ the concept exploration naturally — the context prompt provides the structure.
47
+ The goal is a concept document at the end of this conversation.
48
+
49
+ ## Step 4 — Mention ongoing guidance
50
+
51
+ After the concept conversation concludes (or if the user wants to pause),
52
+ mention that \`workflow_next\` (or \`cf next\` on the CLI) provides ongoing
53
+ guidance that adapts as the project progresses.
54
+
55
+ ## Notes
56
+
57
+ - If the user already has a project but is in a later phase (not Phase 0),
58
+ acknowledge this and call \`workflow_next\` instead of starting a concept
59
+ discussion.
60
+ - Keep the conversation natural. This is onboarding, not a checklist.
61
+ Adapt to what the user is telling you.
62
+ `;
63
+ export function registerAgentOnboardTool(server) {
64
+ server.registerTool('agent_onboard', {
65
+ title: 'Onboard New Project',
66
+ description: 'Step-by-step instructions for setting up a new Context Forge project and guiding the user into their first phase of work. ' +
67
+ 'Returns an onboarding recipe the agent should follow. Optionally accepts a project name.',
68
+ inputSchema: {
69
+ projectName: z
70
+ .string()
71
+ .optional()
72
+ .describe('Optional project name. If omitted, the agent should use the directory name or ask the user.'),
73
+ },
74
+ annotations: { readOnlyHint: true, openWorldHint: false },
75
+ }, async ({ projectName }) => {
76
+ let text = ONBOARD_GUIDE;
77
+ if (projectName) {
78
+ text += `\n**Project name provided:** ${projectName}\n`;
79
+ }
80
+ return {
81
+ content: [{ type: 'text', text }],
82
+ };
83
+ });
84
+ }
85
+ //# sourceMappingURL=agentOnboardTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentOnboardTool.js","sourceRoot":"","sources":["../../src/tools/agentOnboardTool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,aAAa,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DrB,CAAC;AAEF,MAAM,UAAU,wBAAwB,CAAC,MAAiB;IACxD,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,qBAAqB;QAC5B,WAAW,EACT,4HAA4H;YAC5H,0FAA0F;QAC5F,WAAW,EAAE;YACX,WAAW,EAAE,CAAC;iBACX,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,6FAA6F,CAAC;SAC3G;QACD,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1D,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QACxB,IAAI,IAAI,GAAG,aAAa,CAAC;QACzB,IAAI,WAAW,EAAE,CAAC;YAChB,IAAI,IAAI,gCAAgC,WAAW,IAAI,CAAC;QAC1D,CAAC;QACD,OAAO;YACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC;SAC3C,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerAgentQuickstartTool(server: McpServer, version: string): void;
3
+ //# sourceMappingURL=agentQuickstartTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentQuickstartTool.d.ts","sourceRoot":"","sources":["../../src/tools/agentQuickstartTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAoDpE,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAcpF"}
@@ -0,0 +1,60 @@
1
+ function buildQuickstartSchema(version) {
2
+ return {
3
+ server: '@context-forge/mcp',
4
+ version,
5
+ capabilities: {
6
+ projectManagement: {
7
+ description: 'Create, read, update projects with persistent state',
8
+ tools: ['project_list', 'project_get', 'project_create', 'project_update', 'project_schema', 'project_structure'],
9
+ },
10
+ contextGeneration: {
11
+ description: 'Build structured prompts from project state',
12
+ tools: ['context_build', 'context_summarize', 'template_preview', 'prompt_list', 'prompt_get'],
13
+ },
14
+ workflowGuidance: {
15
+ description: 'Phase-aware recommendations and consistency checks',
16
+ tools: ['workflow_next', 'workflow_status', 'workflow_check', 'workflow_future'],
17
+ },
18
+ introspection: {
19
+ description: 'Read project artifacts, slice plans, task state',
20
+ tools: ['introspection_documents', 'introspection_frontmatter', 'introspection_slice_plan', 'introspection_tasks', 'introspection_future_work'],
21
+ },
22
+ guides: {
23
+ description: 'Install and manage the AI project methodology guide',
24
+ tools: ['guide_status', 'guide_install', 'guide_update'],
25
+ },
26
+ worktrees: {
27
+ description: 'Parallel work in git worktrees with slice range isolation',
28
+ tools: ['worktree_list', 'worktree_get', 'worktree_init', 'worktree_update', 'worktree_rm'],
29
+ },
30
+ configuration: {
31
+ description: 'Two-tier config (user + project scope)',
32
+ tools: ['config_get', 'config_set'],
33
+ },
34
+ },
35
+ quickStart: [
36
+ 'Call project_list to find or verify the target project',
37
+ 'Call project_get with the project ID for full state',
38
+ 'Call workflow_next for the recommended action',
39
+ 'Call context_build to generate a session prompt',
40
+ ],
41
+ cliEquivalents: {
42
+ project_list: 'cf list projects --json',
43
+ project_get: 'cf get --json',
44
+ workflow_next: 'cf next --json',
45
+ workflow_status: 'cf status --json',
46
+ context_build: 'cf build --json',
47
+ },
48
+ };
49
+ }
50
+ export function registerAgentQuickstartTool(server, version) {
51
+ server.registerTool('agent_quickstart', {
52
+ title: 'Agent Quickstart',
53
+ description: 'Structured capability schema for machine consumers. Returns tool groupings, quickstart sequence, and CLI equivalents — designed for orchestrators and CI pipelines, not human-supervised sessions.',
54
+ inputSchema: {},
55
+ annotations: { readOnlyHint: true, openWorldHint: false },
56
+ }, async () => ({
57
+ content: [{ type: 'text', text: JSON.stringify(buildQuickstartSchema(version), null, 2) }],
58
+ }));
59
+ }
60
+ //# sourceMappingURL=agentQuickstartTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentQuickstartTool.js","sourceRoot":"","sources":["../../src/tools/agentQuickstartTool.ts"],"names":[],"mappings":"AAEA,SAAS,qBAAqB,CAAC,OAAe;IAC5C,OAAO;QACL,MAAM,EAAE,oBAAoB;QAC5B,OAAO;QACP,YAAY,EAAE;YACZ,iBAAiB,EAAE;gBACjB,WAAW,EAAE,qDAAqD;gBAClE,KAAK,EAAE,CAAC,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,mBAAmB,CAAC;aAClH;YACD,iBAAiB,EAAE;gBACjB,WAAW,EAAE,6CAA6C;gBAC1D,KAAK,EAAE,CAAC,eAAe,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,aAAa,EAAE,YAAY,CAAC;aAC/F;YACD,gBAAgB,EAAE;gBAChB,WAAW,EAAE,oDAAoD;gBACjE,KAAK,EAAE,CAAC,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,CAAC;aACjF;YACD,aAAa,EAAE;gBACb,WAAW,EAAE,iDAAiD;gBAC9D,KAAK,EAAE,CAAC,yBAAyB,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,2BAA2B,CAAC;aAChJ;YACD,MAAM,EAAE;gBACN,WAAW,EAAE,qDAAqD;gBAClE,KAAK,EAAE,CAAC,cAAc,EAAE,eAAe,EAAE,cAAc,CAAC;aACzD;YACD,SAAS,EAAE;gBACT,WAAW,EAAE,2DAA2D;gBACxE,KAAK,EAAE,CAAC,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,CAAC;aAC5F;YACD,aAAa,EAAE;gBACb,WAAW,EAAE,wCAAwC;gBACrD,KAAK,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;aACpC;SACF;QACD,UAAU,EAAE;YACV,wDAAwD;YACxD,qDAAqD;YACrD,+CAA+C;YAC/C,iDAAiD;SAClD;QACD,cAAc,EAAE;YACd,YAAY,EAAE,yBAAyB;YACvC,WAAW,EAAE,eAAe;YAC5B,aAAa,EAAE,gBAAgB;YAC/B,eAAe,EAAE,kBAAkB;YACnC,aAAa,EAAE,iBAAiB;SACjC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,2BAA2B,CAAC,MAAiB,EAAE,OAAe;IAC5E,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,oMAAoM;QACtM,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;KAC1D,EACD,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;KACpG,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ export declare function registerConfigTools(server: McpServer, serverVersion?: string): void;
3
+ //# sourceMappingURL=configTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configTools.d.ts","sourceRoot":"","sources":["../../src/tools/configTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAKpE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAiFnF"}
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import { ConfigManager, getUserConfigPath, getProjectConfigPath } from '@context-forge/core/node';
3
+ import { errorResult, jsonResult } from './contextTools.js';
4
+ export function registerConfigTools(server, serverVersion) {
5
+ // --- config_get ---
6
+ server.registerTool('config_get', {
7
+ title: 'Get Config Value',
8
+ description: 'Get configuration. With a key, returns that key\'s value, source, and description. ' +
9
+ 'Without a key, returns all keys with current values, sources, and defaults. ' +
10
+ 'Resolution order: project config → user config → built-in default.',
11
+ inputSchema: {
12
+ key: z.string().optional().describe('Config key to retrieve (e.g. "guide.source", "guide.git_strategy"). Omit to list all keys.'),
13
+ projectPath: z
14
+ .string()
15
+ .optional()
16
+ .describe('Absolute path to project root, to include project-level config in resolution'),
17
+ },
18
+ annotations: { readOnlyHint: true, openWorldHint: false },
19
+ }, async ({ key, projectPath }) => {
20
+ try {
21
+ const cm = new ConfigManager(projectPath);
22
+ const serverInfo = serverVersion
23
+ ? { serverVersion, hint: 'Call agent_quickstart for tool orientation, agent_onboard for new project setup.' }
24
+ : undefined;
25
+ if (key) {
26
+ const result = await cm.get(key);
27
+ return jsonResult({ ...result, ...(serverInfo && { serverInfo }) });
28
+ }
29
+ const entries = await cm.list();
30
+ return jsonResult({
31
+ entries,
32
+ configPaths: {
33
+ user: getUserConfigPath(),
34
+ project: projectPath ? getProjectConfigPath(projectPath) : null,
35
+ },
36
+ ...(serverInfo && { serverInfo }),
37
+ });
38
+ }
39
+ catch (error) {
40
+ const message = error instanceof Error ? error.message : String(error);
41
+ return errorResult(message);
42
+ }
43
+ });
44
+ // --- config_set ---
45
+ server.registerTool('config_set', {
46
+ title: 'Set Config Value',
47
+ description: 'Set a configuration key to a new value at user or project scope. ' +
48
+ 'Use scope="user" for machine-wide defaults, scope="project" to override for a specific project.',
49
+ inputSchema: {
50
+ key: z.string().describe('Config key to set (e.g. "guide.source", "guide.auto_update")'),
51
+ value: z
52
+ .union([z.string(), z.boolean(), z.number()])
53
+ .describe('Value to set. Must match the key\'s expected type.'),
54
+ scope: z
55
+ .enum(['user', 'project'])
56
+ .describe('Scope: "user" writes to user-level config, "project" writes to project-level config'),
57
+ projectPath: z
58
+ .string()
59
+ .optional()
60
+ .describe('Absolute path to project root. Required when scope is "project".'),
61
+ },
62
+ annotations: { destructiveHint: false, idempotentHint: true, openWorldHint: false },
63
+ }, async ({ key, value, scope, projectPath }) => {
64
+ try {
65
+ const cm = new ConfigManager(projectPath);
66
+ await cm.set(key, value, scope);
67
+ const result = await cm.get(key);
68
+ return jsonResult({ success: true, ...result });
69
+ }
70
+ catch (error) {
71
+ const message = error instanceof Error ? error.message : String(error);
72
+ return errorResult(message);
73
+ }
74
+ });
75
+ }
76
+ //# sourceMappingURL=configTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configTools.js","sourceRoot":"","sources":["../../src/tools/configTools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,UAAU,mBAAmB,CAAC,MAAiB,EAAE,aAAsB;IAC3E,qBAAqB;IACrB,MAAM,CAAC,YAAY,CACjB,YAAY,EACZ;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,qFAAqF;YACrF,8EAA8E;YAC9E,oEAAoE;QACtE,WAAW,EAAE;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KAAc,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,WAAW,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;IACH,CAAC,CACF,CAAC;AAEJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import type { ProjectData } from '@context-forge/core';
3
+ export declare function errorResult(message: string): {
4
+ content: {
5
+ type: 'text';
6
+ text: string;
7
+ }[];
8
+ isError: true;
9
+ };
10
+ export declare function textResult(text: string): {
11
+ content: {
12
+ type: 'text';
13
+ text: string;
14
+ }[];
15
+ };
16
+ export declare function jsonResult(data: unknown): {
17
+ content: {
18
+ type: 'text';
19
+ text: string;
20
+ }[];
21
+ };
22
+ /**
23
+ * Shared context generation helper used by context_build and template_preview.
24
+ * Loads a project, applies optional overrides, generates context via core pipeline.
25
+ */
26
+ export declare function generateContext(projectId: string, overrides?: Partial<ProjectData>, additionalInstructions?: string, worktreeId?: string): Promise<string>;
27
+ export declare function registerContextTools(server: McpServer): void;
28
+ //# sourceMappingURL=contextTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextTools.d.ts","sourceRoot":"","sources":["../../src/tools/contextTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAIpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAKvD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAEzG;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAEtF;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAEvF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,EAChC,sBAAsB,CAAC,EAAE,MAAM,EAC/B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC,CAkCjB;AAsCD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CA2M5D"}