forgein

forgein

Persistent context layer for AI coding assistants. Sync memory files from Claude Code to ChatGPT, Gemini, Cursor, Windsurf, and Copilot via a native MCP endpoint. Bearer token auth, JSON-RPC 2.0 over stateless HTTP. Free tier available.

Category
访问服务器

README

Forgein

The portable context layer for AI coding assistants. Write your context once — every tool you use gets it.

forgein.ai · app.forgein.ai · github.com/forgeinai/forgein


Install

curl -fsSL https://raw.githubusercontent.com/forgeinai/forgein/main/install.sh | bash

One file drops into ~/.claude/commands/forgein.md. Open a new Claude Code session — /forgein appears immediately. No server dependency. Works offline.


What it does

Local (zero server, MIT, free forever):

  • /forgein mem — manage memory files across Claude sessions
  • /forgein sec — heuristic security scan on staged git changes
  • /forgein optimize — discover and install skills matched to your workflow

Cloud sync (free account at app.forgein.ai):

  • /forgein auth — connect your local CLI to your forgein account
  • /forgein mem sync — push your memory files to the cloud
  • /forgein export <target> — write your context into any AI tool's native format

Once synced, every adapter below stays current automatically after every mem sync.


Adapters — 7 tools, one context store

Adapter What it writes How
Claude Code Reads your memory files via the /forgein skill — run /forgein mem sync to push, no auto-injection /forgein mem sync
MCP Server JSON-RPC 2.0 over stateless HTTP, auto-discovered at /.well-known/mcp api.forgein.ai/api/adapters/mcp
Cursor .cursorrules (or ~/.cursor/rules globally) /forgein export cursor
Windsurf .windsurfrules (or Cascade global memory) /forgein export windsurf
GitHub Copilot .github/copilot-instructions.md /forgein export copilot
ChatGPT Custom Instructions (two-field format) /forgein export chatgpt
Gemini Gems system prompt /forgein export gemini

All 7 adapters are free. None are gated to Pro.

The MCP adapter is protocol-native — any MCP-compatible client (Claude Desktop, Cursor, Windsurf Cascade) can connect directly without the CLI.


Commands

/forgein auth                    Authenticate CLI with your forgein account

/forgein mem                     List all memories (default)
/forgein mem list                List memories grouped by type
/forgein mem search <query>      Search memory bodies
/forgein mem add <type> <text>   Add a new memory
/forgein mem prune               Remove stale memories interactively
/forgein mem audit               Check index for structural issues
/forgein mem sync                Sync memory files with forgein cloud

/forgein export cursor           Write context to .cursorrules
/forgein export windsurf         Write context to .windsurfrules
/forgein export copilot          Write context to .github/copilot-instructions.md
/forgein export chatgpt          Format context as ChatGPT Custom Instructions
/forgein export gemini           Format context as a Gemini Gem system prompt

/forgein sec                     Security check on staged git changes
/forgein sec <path>              Security check on a file or directory

/forgein optimize                Discover and install skills for your workflow

How it works

Cloud sync flow

/forgein auth
  → checks ~/.config/forgein/token
  → if missing or stale: prompts user to create token at app.forgein.ai/tokens
  → stores token at ~/.config/forgein/token (chmod 600)

/forgein mem sync
  → computes sha256 of each local memory file
  → diffs against cloud manifest from api.forgein.ai/api/memory/files
  → pushes changed files, pulls files added from another machine
  → auto-runs /forgein export for any adapter files already present in project

/forgein export cursor
  → reads token from ~/.config/forgein/token
  → calls api.forgein.ai/api/adapters/cursor
  → writes response to .cursorrules in project root

/forgein optimize — algorithm

1. FETCH REGISTRY
   gh api repos/forgeinai/forgein/contents/registry.json | base64 -d
   → fallback: WebFetch raw.githubusercontent.com

2. INVENTORY INSTALLED
   ls ~/.claude/commands/
   → set of already-installed skill names (exclude from results)

3. GATHER CONTEXT SIGNALS
   cat ~/.claude/CLAUDE.md          (global instructions)
   cat CLAUDE.md                    (project instructions)
   find ~/.claude/projects -name MEMORY.md | xargs cat  (memory index)
   git log --oneline -20            (recent commit topics)
   → single context string

4. SCORE SKILLS (word-boundary matching)
   for each skill not installed:
     score = 0
     for term in (skill.signals + skill.tags):
       if term matches as a whole word in context (case-insensitive):
         score += 1
   
   Whole-word rule: char before and after match must be non-alphanumeric.
   "pr" does NOT match "sprint". "git" does NOT match "digital".

5. RANK + RECOMMEND
   sort by score desc → take top 5
   show: skill name, score, description, matched terms

6. INTERACTIVE INSTALL
   default: Enter = install all
   or pick by number: "1,3"
   or "none" to cancel
   
   install: gh api .../contents/<file> | base64 -d → write to ~/.claude/commands/

/forgein mem — architecture

Claude Code's auto-memory system stores context across sessions as markdown files. MEMORY.md is the index; each linked file is one memory with frontmatter:

---
name: feedback-commits
description: Commit message rules — no Claude/AI attribution
metadata:
  type: feedback        # user | feedback | project | reference
---

Commit messages must not mention Claude, AI, or any collaboration.

**Why:** commits must appear as the user's own organic work.
**How to apply:** never add Co-Authored-By lines. Write messages in first person.

Operations:

Subcommand What it does
list Read MEMORY.md, fetch each file's type from frontmatter, group and display
search <q> Read all linked files, return whole-word matches in body
add <type> <content> Write new file with frontmatter, append pointer to MEMORY.md
prune For each memory, verify referenced artifacts still exist (PRs, files, functions). Flag stale.
audit Structural checks: broken links, duplicates, missing frontmatter, lines > 150 chars
sync Push/pull from forgein cloud. Requires /forgein auth first.

Memory types:

  • user — who the user is, expertise, working style
  • feedback — how Claude should behave (corrections AND confirmed approaches)
  • project — active work, goals, deadlines
  • reference — where to find things (Linear boards, dashboards, docs)

/forgein sec — scan algorithm

1. GET CODE
   git diff --staged          (default)
   <path>                     (if argument given)
   
   If staged diff is empty → ask user for a path. Never silently scan.

2. SCAN 8 VULNERABILITY CLASSES
   
   Class              Severity  What to look for
   ─────────────────────────────────────────────────────────────────
   Secrets            critical  Long string literals in key/secret/token vars
   Command injection  critical  User input in subprocess/eval/shell=True
   SQL injection      high      User input concatenated into SQL strings
   Path traversal     high      User input in open()/join() without realpath
   SSRF               high      User-controlled URLs fetched server-side
   XSS                medium    User input in innerHTML/unescaped templates
   Insecure deser.    medium    pickle.loads / yaml.load / eval on external data
   Hardcoded creds    medium    Literal passwords/tokens in source or config

3. OUTPUT
   Sort: critical → high → medium → low
   Each finding: severity, file:line, class, snippet (≤80 chars), attack scenario
   
   If no findings: "✓ Clean"
   Always: remind user to run a real SAST tool for production

Registry format

registry.json is the skill index. Each entry:

{
  "id": "commit",
  "command": "commit",
  "name": "Smart Commit",
  "description": "Generates conventional commit messages from staged changes.",
  "tags": ["git", "productivity", "conventional commits"],
  "signals": ["commits", "commit messages", "changelog", "semantic versioning"],
  "author": "forgein-ai",
  "version": "1.0.0",
  "file": "skills/commit.md",
  "install_as": "commit.md"
}
  • tags — broad categories (used in scoring)
  • signals — specific phrases that indicate a user needs this skill (used in scoring)
  • file — path to the skill .md file in this repo
  • install_as — filename written to ~/.claude/commands/

Scoring weight: tags and signals are treated equally. A skill with 3 tag matches and 2 signal matches scores 5.


Skills in the registry

Skill Command Description
Forgein /forgein Auth, memory sync, multi-tool export, security check, skill optimizer
Vibe Sec /sec Standalone security check
Claude Mem /mem Standalone memory manager
Code Review /review Bugs, perf, security, style — parallel passes
Smart Commit /commit Conventional commit messages from staged diff
Standup /standup Daily standup from git log + open PRs
PR Monitor /pr-monitor CI status across all open PRs
Test Gen /test-gen Generate tests — auto-detects pytest/jest/go
Explain Codebase /explain Architecture map for new contributors
Changelog /changelog CHANGELOG.md from git log between tags

Submit a skill

  1. Add your .md file to skills/
  2. Add an entry to registry.json
  3. Open a PR

Skill file format: A markdown file with a YAML frontmatter description field. The body is instructions to Claude — what to do, what tools to use, what output to produce. Written in second person imperative. See any existing skill file as a template.

Good signals are specific phrases that appear in someone's CLAUDE.md or git log when they need your skill. Bad signals are things everyone has ("code", "files", "project").


How Claude skills work

Skills are markdown files in ~/.claude/commands/. When you type /forgein, Claude reads forgein.md and follows its instructions — using your local shell, files, and APIs. No server. No telemetry. Runs entirely in your Claude Code session.

The skill file is the product. It tells Claude: what the user wants, what tools to call, what output format to use.


Free vs. Pro

Free Pro ($4.99/mo) Team
All 7 adapters + MCP server
Memory projects 3 Unlimited Unlimited
Files per project 100 Unlimited Unlimited
Contexts (Work/Home/Family) Work only All 3 All 3
Private skills
Team memory sharing
Org baseline templates
AI adoption analytics
API tokens 1 5 Unlimited

The portability mechanism — every adapter, the full MCP server — is free. Pro gates scale (more projects, more contexts). Team gates organizational features.


License

MIT — CLI and skill files in this repo (forgeinai/forgein)

The hosted sync service at app.forgein.ai is separate and not MIT-licensed.

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选