KC

kirachon/context-engine

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

48 stars 8 forks 质量 60 趋势 14

本地原生的上下文引擎MCP服务器,用于代码库索引、语义检索、规划和审查工作流程。

概览

一款本地优先、与代理无关的模型上下文协议(MCP)服务器,用于工作区的索引、检索、规划和审核工作流,其设置路径适合Codex及其他OpenAI驱动的代理。 这里是新手吗?先从下面初学者快速入门开始。如果你需要针对客户端的设置帮助,可以参考 docs/MCP_CLIENT_SETUP.md。如果你用的是 Windows,可以看 docs/WINDOWS_DEPLOYMENT_GUIDE.md。历史文档可以存放在 docs/archive/INDEX.md,如果你需要旧的规划和迁移笔记。 如果你想了解这个项目在OpenAI风格代理工作流程中所展示的内容,可以从这里开始: - 本地工作区索引与检索 - 查看和规划叠加在同一MCP服务器上的工作流程 - 适合初学者安装和客户端设置 - Windows支持及复制粘贴设置示例 - AI代理友好的自我设置说明 - 它展示了由OpenAI驱动的代理如何连接到真实工作空间并立即开始使用工具。

概述(AI 翻译)

一款本地优先、与代理无关的模型上下文协议(MCP)服务器,用于工作区的索引、检索、规划和审核工作流,其设置路径适合Codex及其他OpenAI驱动的代理。

新来的吗?从下面的新手快速入门开始。

如果你想要针对客户端的设置帮助,请参见文档/MCP_CLIENT_SETUP.md。

如果你用的是Windows,请查看文档/WINDOWS_DEPLOYMENT_GUIDE.md。

历史文档存档在docs/archive/INDEX.md,如果你需要旧的规划和迁移笔记。

OpenAI / Codex 展示

如果你想了解这个项目在OpenAI风格代理工作流程中所展示的内容,可以从这里开始:

  • 本地工作区索引与检索
  • 审查和规划叠加在同一MCP服务器上的工作流程
  • 适合初学者的安装和客户端设置
  • Windows 支持及复制粘贴设置示例
  • AI代理友好的自我设置指令

为什么这很重要

  • 它展示了由OpenAI驱动的代理如何连接到真实工作空间并立即开始使用工具。
  • 它将检索、审查和规划整合在同一个MCP服务器上,而非依赖一次性脚本。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Context Engine MCP Server

A local-first, agent-agnostic Model Context Protocol (MCP) server for workspace indexing, retrieval, planning, and review workflows, with a setup path that works well for Codex and other OpenAI-powered agents.

New here? Start with the beginner quick start below.

If you want client-specific setup help, see docs/MCP_CLIENT_SETUP.md.

If you are on Windows, see docs/WINDOWS_DEPLOYMENT_GUIDE.md.

Historical docs live in docs/archive/INDEX.md if you need the old planning and migration notes.

OpenAI / Codex Showcase

If you want to see what this project demonstrates for OpenAI-style agent workflows, start here:

  • Local workspace indexing and retrieval
  • Review and planning workflows layered on top of the same MCP server
  • Beginner-friendly install and client setup
  • Windows support and copy-paste setup examples
  • AI-agent-friendly instructions for self-setup

Why This Matters

  • It shows how an OpenAI-powered agent can connect to a real workspace and start using tools right away.
  • It combines retrieval, review, and planning in one MCP server instead of relying on one-off scripts.
  • It gives both humans and AI agents a simple, repeatable setup path, which makes demos and onboarding easier.

Fastest demo path:

npm install
npm run build
codex mcp add context-engine -- node dist/index.js

Then in Codex, confirm the tools are visible and try:

use semantic_search to find authentication logic

Beginner Quick Start

If you just want to get Context Engine running locally, follow these steps:

  1. Install Node.js 18+.
  2. Clone this repository and open it in a terminal at the repo root.
  3. Install dependencies:
npm install
  1. Build the server:
npm run build
  1. Run the verification checks:
npm run verify
  1. Start the MCP server:
node dist/index.js

By default, Context Engine now resolves the workspace like this:

  • explicit --workspace wins
  • otherwise it uses the current folder
  • if you launched from a nested folder inside a git repo, it falls back to the nearest git root
  • if no git root exists, it stays on the current folder and logs a warning

On first run, if the index is missing or stale, startup can kick off background indexing automatically. The server still starts first, but the first query may be slower until indexing finishes.

Connect It To Your MCP Client

The server speaks MCP over stdio, so most clients can launch it with the same command.

First-Time Setup vs Daily Use

Use this mental model:

  1. First-time setup: Register the MCP server once in your client.
  2. Daily use: Open any repo and let the server resolve the workspace automatically.
  3. Override only when needed: Pass --workspace if the client launches from the wrong folder or you want a different repo on purpose.

Codex CLI

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →