EGC

EGC

Local MCP runtime that gives persistent cross-session memory to 12 AI coding agents (Claude Code, Cursor, Codex, Gemini CLI, Windsurf, Amp, and more). SQLite-backed state survives context resets. Install: npm install -g @egchq/egc

Category
访问服务器

README

<img src="assets/hero.png" alt="EGC - Extended Global Context" width="100%" />

npm version Node.js >= 18 TypeScript Discord PRs Welcome Stars Forks Issues Maintained OpenSSF Scorecard EGC MCP server

<div align="center">

EGC - Extended Global Context

Your AI remembers your project across sessions and tools.

</div>


This is what EGC looks like in practice

You open Claude Code on a project you haven't touched in two weeks. Without typing anything:

State loaded from egc-memory via ~/.egc/state/Projects--MyApp.md

Context and preferences acknowledged (terse responses).

Ready to pick up the next items:
• Test full install on a clean machine
• Add GEMINI.md with session memory protocol
• Publish v1.0.1 fix to npm after clean install test passes
• Add mcp_server_count to audit.js

The AI already knows what you were building, what decisions you made, what failed, and exactly where you stopped. You didn't type anything. You just started working.

After sh install.sh, the memory protocol is injected into the global instruction files for Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Windsurf, Amp, VS Code Copilot, Kiro, Trae, and CodeBuddy, so the AI reads state at the start of each session and saves it at the end. For tools where the AI instruction file isn't read automatically (varies by tool version), you may need to add the project's CLAUDE.md or equivalent to the session context manually.


The problem

Every AI coding session starts from zero. Close the window and the context is gone. Your stack preferences, the architectural decisions you made last week, the approach that failed after three attempts. Next session you spend the first ten minutes re-explaining ground you already covered.

It gets worse when you switch tools. Move from Cursor to Claude Code and you start over again. The AI doesn't know you. It never did.


How EGC fixes it

One install. Every tool. Permanent memory.

sh install.sh detects which AI tools you have installed (Claude Code, Cursor, Codex, Gemini CLI, OpenCode, Windsurf, Amp, VS Code Copilot, Kiro, Trae, CodeBuddy) and registers the MCP servers in all of them. It also runs a cognitive bootstrap that writes the memory protocol into the global instruction files for each tool, so the AI is instructed to call get_state({}) at the start of every session and update_state({...}) at the end.

For every supported tool:

  • Open any session → AI reads your project state → picks up where you left off
  • Close any session → AI saves decisions, preferences, next steps
  • Switch tools → same state file → same context → no re-explaining

The memory protocol requires the AI to call get_state and update_state via the egc-memory MCP tool. The bootstrap injects the instruction; the tool must support MCP to execute it.

The memory lives at ~/.egc/state/ on your machine, not inside any tool. It follows the project, not the IDE.


Token savings

Rebuilding context from scratch costs ~1,500 tokens per session. EGC's state file delivers the same information in ~200 tokens.

Without EGC With EGC
Context overhead per session ~1,500 tokens ~200 tokens
20 sessions/month ~$0.08–$0.09 ~$0.011–$0.012
Time re-explaining context 10 min/session 0

The money saved is small. The time and interrupted flow are not.


Installation

Via npm (recommended)

npm install -g @egchq/egc
egc install

Linux / macOS

You need Node.js 18 or later. Not sure if you have it? Open a terminal and run node --version. If it shows 18 or higher, you're ready.

git clone https://github.com/Fmarzochi/EGC.git
cd EGC
sh install.sh

The installer runs these steps:

  1. Compiles the MCP servers (egc-guardian, egc-memory)
  2. Initializes the local SQLite database
  3. Runs the cognitive bootstrap: writes the memory protocol into ~/.claude/CLAUDE.md (Claude Code) and ~/.gemini/GEMINI.md (AGY), creating the files if they don't exist, idempotent
  4. Registers both MCP servers in every detected tool's config file
  5. Asks interactively whether to install the prompt library (63 agents, 229 skills, 76 commands), skipped automatically in CI

The installer will print which tools it found and registered:

EGC install
  node v22.0.0
  building egc-guardian...
  building egc-memory...
  initializing database...
  bootstrapping cognitive protocol...
  ✓ ~/.claude/CLAUDE.md updated
  ✓ ~/.gemini/GEMINI.md updated
  registering MCP servers...
  ✓ registered in Antigravity CLI
  ✓ registered in Claude Code (global)
  ✓ registered in Cursor

Install prompt library? (63 agents, 229 skills, 76 commands) [y/N]:

Installation complete.
Run 'egc doctor' to verify.

Windows

git clone https://github.com/Fmarzochi/EGC.git
cd EGC
.\install.ps1

Prompt library

The prompt library is optional. During sh install.sh, you'll be asked whether to install it. In CI or non-interactive shells, this step is skipped. Install once to get access to 63 agents, 229 skills, and 76 commands written from real experience, not generated.

Type Count What it is
Agents 63 agents Persona and behavior definitions
Skills 229 skills Domain-specific workflow runbooks
Commands 76 commands Command definitions and lifecycle hooks
Rules 111 Constraints and governance directives

Organized per harness under .cursor/, .claude/, .gemini/, .kiro/, and four others. Switch tools and the same workflows follow you.

Cross-harness distribution

Component Total Claude Code Gemini CLI Claude Code native
Agents 63 Shared (AGENTS.md) Shared (AGENTS.md) 12
Commands 76 Shared Instruction-based 31
Skills 229 Shared 10 (native format) 37

Supported tools

Tool Skills MCP registered Cognitive bootstrap
Claude Code ~/.claude/skills/<name>/ Yes Yes: protocol injected into ~/.claude/CLAUDE.md
Antigravity CLI (AGY) .agents/skills/<name>/ Yes Yes: protocol injected into ~/.gemini/GEMINI.md
Gemini CLI ~/.gemini/ Yes Yes: protocol injected into ~/.gemini/GEMINI.md
Cursor ~/.cursor/ Yes Yes: protocol injected into global cursor.rules setting
Codex CLI ~/.agents/skills/<name>/ Yes Yes: persistent_instructions appended to ~/.codex/config.toml
OpenCode ~/.config/opencode/skills/<name>/ Yes Yes: protocol written to ~/.opencode/instructions/EGC_MEMORY.md
Windsurf ~/.codeium/windsurf/skills/<name>/ Yes Yes: protocol injected into ~/.codeium/windsurf/
Amp ~/.amp/skills/<name>/ Yes Yes: protocol injected into ~/.amp/
VS Code Copilot ~/.github/skills/<name>/ Yes Yes: protocol injected into ~/.github/
CodeBuddy .codebuddy/skills/<name>/ Context injection Yes: protocol written to ~/.codebuddy/MEMORY.md
Kiro ~/.kiro/hooks/ Yes Yes: session hooks installed to ~/.kiro/hooks/
Trae ~/.trae/ Context injection Yes: protocol written to ~/.trae/MEMORY.md
Obsidian Yes, if already configured, synced to all tools N/A N/A

If you use Obsidian and have the Obsidian MCP server configured, the installer detects it automatically and gives every AI tool in your setup direct access to your vault: read notes, search, and write without any extra configuration.


MCP servers

EGC runs two local MCP servers over stdio.

egc-memory: the one you'll use every session

Tool What it does
get_state Reads project memory at session start
update_state Saves this session's decisions, preferences, and next steps
store_decision Persists a decision to SQLite
query_history Returns past decisions by timestamp

egc-guardian: runs in the background

Tool What it does
validate_command Blocks shell injection and unsafe binaries
validate_write Blocks writes to sensitive paths (~/.ssh, /etc)
reduce_context Deduplicates and trims Markdown payloads
orchestrate_task Routes prompts to relevant agents and skills

CLI

egc doctor         # verify both servers are built and working
egc status         # show the last 5 decisions in memory
egc install        # install prompt library to a target harness
egc catalog        # list available profiles and components
egc repair         # restore drifted or missing managed files
egc auto-update    # pull latest changes and reinstall managed targets

Architectural consolidation

Earlier versions of EGC explored distributed runtime concepts: FederationManager, ReplayEngine, cognitive orchestration layers, multi-provider dispatching. Those experiments were real explorations, not deception. They helped define what the project actually needed to be.

What the project actually needed was simpler and more useful: persistent memory across sessions, a validation layer, and a prompt library that works in every tool without reconfiguration.

The current runtime reflects that consolidation. Two MCP servers, local SQLite, plain Markdown state files, one install command. Everything else was removed or isolated.

The branch legacy-runtime preserves the full historical architecture for anyone who wants to study the evolution.


Community

Join the EGC Discord server to ask questions, share your setup, and follow development.

Join on Discord

  • #help — questions about EGC
  • #installation — setup issues
  • #show-and-tell — share your workflow
  • #feature-requests — propose ideas
  • #contributing — coordinate contributions

Support EGC

EGC solves a problem that no company has solved: AI memory that persists across sessions, across tools, and across CLIs.

Close Claude Code and open Cursor. The AI already knows your project. Switch to Codex. Same context. No re-explaining. No lost decisions. No starting from zero.

That's not a feature. It's a shift in how AI-assisted engineering works.

EGC is built by one developer, maintained in the open, and used by people who are done re-explaining context every session. If it saves you time, consider giving back:

  • Join the Discord (ask questions, share feedback, meet other users)
  • Sponsor on GitHub (for GitHub users, any amount)
  • Donate via PayPal (no GitHub account needed)
  • Star the repository (helps other developers find it)
  • Contribute (agents, skills, commands, bug fixes, docs via CONTRIBUTING.md)
  • Share (if EGC changed how you work, tell someone)

Every contribution, financial or otherwise, goes toward keeping this maintained, documented, and free.

Sponsors

Support from the community keeps this project alive and independent.

Backers

<a href="https://github.com/chizormaangel-commits"><img src="https://avatars.githubusercontent.com/u/291871326?v=4" width="48" height="48" alt="@chizormaangel-commits" title="@chizormaangel-commits" /></a>

Monthly sponsors · be the first


<div align="center">

License: MIT   OpenSSF Best Practices   OpenSSF Baseline Level 1   OpenSSF Baseline Level 2   OpenSSF Baseline Level 3

<br/>

<a href="https://bestpractices.dev/projects/13099"><img src="assets/images/openssf-best-practices-badge.svg" alt="OpenSSF Best Practices" width="110" /></a>         <a href="https://linkedin.com/in/felipemarzochi"><img src="assets/images/egc-logo.png" alt="EGC" width="110" /></a>

</div>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选