Skip to main content

A Model Context Protocol (MCP) server for Context Engineering - file system as external memory for AI agents

Project description

Context Engineering MCP Server

这是一个符合 Model Context Protocol (MCP) 标准的服务器,旨在为 Claude Desktop、Cursor 或其他 AI 助手提供"外部记忆"和"上下文管理"能力。

它实现了 Context Engineering 的核心理念,允许 AI 像操作系统一样管理自己的工作区状态。

✨ 功能

这个插件为你的 AI 助手添加了以下能力(Tools):

  1. context_init: 初始化 .ai/skills.agent_memory 目录结构。
  2. context_state: 获取当前工作区的"快照"(包含目录树、Git状态、当前目标)。
  3. context_save_observation: 将长输出(如日志、API响应)保存到文件,只返回摘要。
  4. context_read_observation: 按需读取之前保存的观察结果。

📦 安装与配置

1. 作为 Python 包安装

# 在你的环境中安装
pip install .
# 或者直接使用 uv 运行(推荐)

2. 配置 Claude Desktop

编辑你的 Claude Desktop 配置文件(通常位于 ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "context-engineering": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/context_mcp",
        "run",
        "context-mcp"
      ]
    }
  }
}

注意:请将 /absolute/path/to/context_mcp 替换为你实际存放此项目的绝对路径。

3. 配置 Cursor (即将支持)

Cursor 目前正在积极集成 MCP,配置方式与 Claude Desktop 类似。

🛠️ 使用示例

一旦配置完成,你可以在对话中直接告诉 Claude:

"初始化一下上下文环境" -> Claude 会调用 context_init

"现在的项目状态是什么?" -> Claude 会调用 context_state

"运行 npm install 并帮我分析错误,输出可能很长,请注意使用外部记忆" -> Claude 会运行命令并使用 context_save_observation 保存结果。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ctx_engine_mcp-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ctx_engine_mcp-0.1.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ctx_engine_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: ctx_engine_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for ctx_engine_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5b85f0bf8c45b387824ce09d50a9a7f056c29ea97a2568736c3ef63e95c7a186
MD5 293745dae27472f6158df2105aeeacbe
BLAKE2b-256 3659bd3aa5195deb2b40c6b8678e64ce97312909226f94910c753bd234c7f411

See more details on using hashes here.

File details

Details for the file ctx_engine_mcp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: ctx_engine_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.3

File hashes

Hashes for ctx_engine_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3491f29ad150d11d913d98b328bc3adaf59e41186f0a1c90e77bc678b5217d22
MD5 e3c82a1f0e5e5f3e14a800041dc72dfa
BLAKE2b-256 a81042861e69e0036dd488f9df15b1f7ca5e163117549840107538ee54d91834

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page