@context-forge/mcp

中文文档
0.19.26发布于 2026/11/07MITTypeScriptES Module近 30 天下载 3716

MCP server for Context Forge — generates structured AI context prompts from project configuration and templates

原始使用文档
文档目录19 节
  1. What is this?
  2. Why?
  3. Quick Start
  4. Install
  5. Configure for Claude Code
  6. Configure for Cursor
  7. Available Tools
  8. Agent Orientation
  9. Project Management
  10. Context Generation
  11. Workflow
  12. Artifact Introspection
  13. Guides
  14. Worktrees
  15. Configuration
  16. Meta
  17. Prerequisites
  18. Related
  19. License

@context-forge/mcp

An MCP server that generates structured context prompts for AI coding sessions. Configure your project once, then generate fresh, consistent context whenever you start a new session with Claude Code, Cursor, or any MCP-compatible tool.

What is this?

Every productive AI coding session starts with context: what project you're working on, what slice or task is active, what conventions to follow, what happened in the last session. Context Forge assembles that context automatically from your project configuration and prompt templates.

This MCP server exposes Context Forge's context engine as a set of tools that your AI assistant can call directly. Instead of manually copying and pasting context blocks, the assistant generates them on demand — staying current as your work progresses.

Why?

Building context by hand is tedious. Every session, you're pulling together the same pieces: project state, current task, coding conventions, template sections. It takes several minutes, it's error-prone, and it breaks your flow.

Context Forge eliminates that overhead. You configure your project once — templates, statements, project structure — and then generate a complete, structured context prompt with a single tool call. When you switch slices, change tasks, or reach a milestone, your assistant updates the project state and the next context generation reflects it automatically.

Quick Start

Install

# Recommended: meta-package installs both MCP server and CLI
npm install -g @context-forge/context-forge

# Or install the MCP server alone
npm install -g @context-forge/mcp

# Or run directly (no install needed)
npx @context-forge/mcp

Configure for Claude Code

Add the server using the Claude Code CLI:

claude mcp add --transport stdio context-forge -- npx @context-forge/mcp

Or add it manually to your project's .mcp.json:

{
  "mcpServers": {
    "context-forge": {
      "type": "stdio",
      "command": "npx",
      "args": ["@context-forge/mcp"]
    }
  }
}

Configure for Cursor

Add the following to your Cursor MCP settings (.cursor/mcp.json in your project root):

{
  "mcpServers": {
    "context-forge": {
      "command": "npx",
      "args": ["@context-forge/mcp"]
    }
  }
}

Available Tools

Agent Orientation

ToolDescription
agent_onboardStep-by-step onboarding recipe for new projects. On an existing codebase the recipe stops after printing the detection notice, which points to sq onboard
agent_quickstartStructured capability schema for machine consumers (orchestrators, CI)

Project Management

ToolDescription
project_listList all configured projects with summary fields
project_getGet full project details by ID (or default project)
project_createCreate a new project (name + path required)
project_updateUpdate project configuration. Setting developmentPhase auto-sets instruction. fileComprehension registers the codebase comprehension doc (checked, stored root-relative; "" clears).
project_schemaFull project data schema with field definitions, aliases, groups, and enum values
project_structureBuild full project model (foundation, initiatives, slices, tasks, future work)
project_detectReport what a directory holds and which adoption outcome applies. Read-only; works on unregistered directories. See Adoption Primitives

Context Generation

ToolDescription
context_buildGenerate a complete context prompt from project configuration. Includes a ### Codebase Reference section when the active prompt's profile lists fileComprehension or fileDocsMap.
context_summarizeUpdate project session state (recent events, notes)
template_previewPreview context output without side effects
prompt_listList available prompt templates for a project
prompt_getGet the full content of a specific prompt template

Workflow

ToolDescription
workflow_nextRecommended next action based on project state
workflow_statusCurrent phase, slice, and task progress
workflow_checkRun consistency checks on project artifacts
workflow_futureAggregate future work items across all slice plans

Artifact Introspection

ToolDescription
introspection_documentsDetect which methodology files exist for a given slice index
introspection_frontmatterExtract YAML frontmatter from any methodology document
introspection_slice_planParse a slice plan with entries, status, and completion counts
introspection_tasksParse a task file with done state, total count, and inferred status
introspection_future_workParse the Future Work section from a slice plan

Guides

ToolDescription
guide_statusCheck if the AI project guide is installed
guide_installInstall the methodology guide
guide_updateUpdate to latest guide version

Worktrees

ToolDescription
worktree_listList all registered worktree contexts
worktree_getGet details for a specific worktree
worktree_initCreate a new worktree context with index range
worktree_updateUpdate worktree fields
worktree_rmRemove a worktree context

Configuration

ToolDescription
config_getGet a config key value (omit key to list all)
config_setSet a config value at user or project scope

Meta

ToolDescription
server_versionServer name and version
storage_backupCreate a versioned backup of project data

Tip: Set default_project once and omit projectId from all other tool calls:

config_set key="default_project" value="project_1739..." scope="user"

For full parameter details, see the Tool Reference.

Prerequisites

  • Node.js 18+
  • ai-project-guide templates set up in your project

Context Forge uses prompt templates and project structure conventions from ai-project-guide. Install via the CLI:

npm install -g @context-forge/cli
cf init              # register project
cf guides install    # install methodology templates

See the ai-project-guide repository for details on the methodology and template system.

License

MIT

版本与发布记录

@context-forge/mcp 共发布 111 个版本,首次发布于 2026/02/24;过去 12 个月发布了 111 个版本。

版本发布日期距今
0.19.26latest2026/11/073 天前
0.19.252026/11/046 天前
0.19.242026/11/019 天前
0.19.232026/10/3011 天前
0.19.222026/10/3012 天前
0.19.212026/10/2714 天前

关于 @context-forge/mcp 的常见问题

@context-forge/mcp 是什么?

MCP server for Context Forge — generates structured AI context prompts from project configuration and templates

如何安装 @context-forge/mcp?

在项目目录运行 npm install @context-forge/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 context-forge-mcp,可以用 npx context-forge-mcp 直接运行。

@context-forge/mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@context-forge/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@context-forge/mcp 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20.18.1。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@context-forge/mcp 可以商用吗?

@context-forge/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@context-forge/mcp 的下载量有多少?

根据 npm 官方下载统计,@context-forge/mcp 在 2026/10/11 – 2026/11/09 这 30 天内被下载 3,716 次,日均约 124 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@context-forge/mcp 还在维护吗?

最新版本 0.19.26 发布于 2026/11/07(3 天前);至今共发布 111 个版本,其中过去 12 个月发布了 111 个;首次发布于 2026/02/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。