ctxfile

MCP文档知识

提供方 ctxfile · 包名 ctxfile

文档知识 stdio · 本地进程 OAuth 授权 社区 / 第三方 Claude DesktopClaudeCursorGemini CLI
查看接入方式

Local-first MCP server that snapshots your project's working state into one context object. Open-core, privacy-first.

一句话选型结论

按资料字段整理

ctxfile 属于文档知识类 MCP 服务器,stdio · 本地进程,OAuth 授权,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类文档知识 传输方式stdio · 本地进程 鉴权OAuth 授权 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

文档知识
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

mcpmodel context protocolcontext

安装与配置

stdio · 本地进程 OAuth 授权
客户端在本机拉起子进程,数据不出本机
npx -y ctxfile

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
文档检索问答

在你的文档库里按问题找答案。

知识库读写

把新资料写进知识库,随用随取。

内容整理

把零散资料归纳成结构化笔记。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好OAuth 授权对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
ctxfile当前 未标注 stdio · 本地进程 本地部署 有 未标注
dify 未标注 stdio · 本地进程 本地部署 有 2026-04-11
open-webui 未标注 stdio · 本地进程 本地部署 有 2026-04-11
JeecgBoot 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Cherry Studio 未标注 未标注 未标注 无 2026-05-17
mempalace 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

文档知识
字段来自项目仓库与公开索引,中文说明由本站标注
提供方ctxfile上游标注的维护方 ctxfile
分类文档知识本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式OAuth 授权远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时ctxfile · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

7.9 KB
来自项目仓库与上游目录的原文,未做删改

ctxfile

One context, every agent, all local.

Website ·
Docs ·
Quickstart ·
Clients ·
The .ctxfile convention ·
Security


You work with more than one AI agent. Claude Code in the terminal, Cursor in the editor, a chat tab for thinking. Each one starts cold, because your working state (the plan, the key files, the git state, what you decided an hour ago) lives in your head and in scrollback.

ctxfile is a local-first MCP server that snapshots your project's working state into one structured context object, and hands it to any MCP agent in a single call. Save a session in one agent, continue it in another. Nothing leaves your machine.```
you → ctxfile → the same context, in every agent


## 30-second quickstart

**Every client on your machine at once**```bash
npm install -g ctxfile
ctxfile connect          # lists the MCP clients it found
ctxfile connect --all    # adds ctxfile to each (backups kept, other servers untouched)

Or tell any coding agent: "Set up ctxfile for me by following https://ctxfile.dev/setup.md".

Claude Code (as a plugin, or one command)```bash
/plugin install ctxfile --marketplace ctxfile/ctxfile
claude mcp add --scope user ctxfile -- npx -y ctxfile


**Cursor** (`.cursor/mcp.json` in your project, or `~/.cursor/mcp.json` globally)```json
{
  "mcpServers": {
    "ctxfile": { "command": "npx", "args": ["-y", "ctxfile", "--root", "${workspaceFolder}"] }
  }
}

Codex CLI```bash
codex mcp add ctxfile -- npx -y ctxfile --root .


**Claude Desktop** (no terminal needed): download `ctxfile-macos-arm64.mcpb` and drag it into Settings → Extensions. The bundle carries a compiled native module, so it is macOS (Apple Silicon) only for now; on Windows or an Intel Mac, add the stdio JSON above to `claude_desktop_config.json` instead.

**Every other client**: ctxfile is a standard stdio server, so `npx -y ctxfile` is the whole command. One-click install links and copy-paste setup for **VS Code, Windsurf, Zed, Cline, Gemini CLI, OpenCode, Warp, Goose, LM Studio, Kiro, JetBrains, Visual Studio, Amp, OpenClaw, Hermes**, and more are on the per-client tabs at ctxfile.dev/docs/clients.

Then, in your agent: *"load my context"* (or call `get_context`). Requires Node ≥ 20 (≥ 22 on Windows).

## Make it automatic

You stop typing "save this." One command installs a **skill** that teaches any agent, while doing its normal work, *when* to checkpoint context and to announce every save (never silent, paused any time, reviewable always):```bash
ctxfile init

It renders from one canonical spec into whatever each harness reads: an Agent SKILL.md for Claude Code, OpenCode, OpenClaw, and Hermes (one portable file across all four skill systems), a Cursor rule, and managed GEMINI.md / AGENTS.md blocks. Details at ctxfile.dev/docs/automatic.

It follows you into the chat tabs, too

The same context your CLI and editor agents load over MCP can travel to web chatbots. Connect Grok, ChatGPT, Claude web, or Perplexity to your encrypted Sync vault as a custom MCP connector, or ctxfile export and paste the envelope into any prompt box (Gemini, and anything else). Walkthrough: ctxfile.dev/docs/webchat.

Private by default

This is the part we care about most, so it goes first:

  • The default path makes zero network calls. Files and git only.
  • Secret-looking content (cloud keys, tokens, private keys, JWTs, password= assignments) is redacted before it enters the snapshot. .env*, key files, and credential files are never read at all.
  • Core is read-only over your project. It never writes to your repo, your git state, or anything else.
  • No telemetry by default. An anonymous weekly install ping exists, and it is opt-in only.
  • Network connectors (Notion, local Ollama summarization, Sync) activate only when you explicitly configure them.

The full model, including what Pro and Sync add and what they can never see, is documented at ctxfile.dev/security.

What it does

Snapshot · get_context returns one structured ContextObject: plan docs, ranked key files fitted to a token budget, git state, optional Notion pages and local-LLM summary.
Save and resume · save_session stores an agent-written summary of the current conversation. continue_thread hands the merged, provenance-labeled history to the next agent. Different harness, different provider, cold start: it picks up where you left off.
Threads · Durable identities for a piece of work ("Q3 campaign"), spanning agents and machines. handoff: true enforces a complete takeover package: state, decisions with rationale, ordered open items, gotchas.
Memory import · ingest_memory moves what ChatGPT, Grok, Claude or any assistant knows about you into ctxfile: one prompt (ctxfile memory prompt), a strict schema, global or per-project scope. Instructions and identity wait for your approval; duplicates merge; rejections stick. Every agent then gets it in get_context. Docs.
Tasks · post_task, list_tasks, update_task: one agent leaves work on a thread for another ("have ChatGPT draft the lead emails"), the assignee finds it in its inbox and asks you before starting. Agent-posted tasks are proposals until you approve them in the dashboard or CLI; approvals are signed on your device, and anything that sends, publishes, pushes code, or spends needs its own yes. Docs.
Universal ingest · ingest_context is the schema-enforced door for any harness without a native parser. The prompt is the adapter, so every MCP-speaking agent is supported, including ones that do not exist yet.
Cloud agents · ctxfile export writes a static, repo-safe artifact for agents that never touch your machine (hosted coding agents, CI). The format is an open spec: the .ctxfile convention.
Dashboard · ctxfile ui: a local cockpit on 127.0.0.1. Run snapshots, watch connectors, browse context, inspect git state.
Sync (optional) · An end-to-end encrypted vault through a relay you can self-host. Argon2id key derivation, XChaCha20-Poly1305 per blob. The relay stores ciphertext only.

The monorepo

Package What License
packages/core ctxfile on npm: the MCP server, snapshot engine, threads, ingest, export, Sync client, dashboard host Apache-2.0
packages/relay @ctxfile/relay on npm: the self-hostable Sync relay and team hub (encrypted vaults, /mcp endpoint, federation, audit log). One Docker image Apache-2.0
packages/dashboard + packages/ui-kit The local instrument UI served by ctxfile ui Apache-2.0
apps/web ctxfile.dev: site and docs Apache-2.0

Open core, honestly

Everything in this repo is Apache-2.0 and works standalone, forever. The paid Pro add-on (a separate, closed package) adds session connectors that read your recent sessions from Claude Code, Cursor, Codex CLI, OpenCode, Gemini CLI, Aider, OpenClaw, and Hermes Agent, encrypted cross-session memory, multi-provider consult (Anthropic, OpenRouter for hundreds of models on one key, any OpenAI-compatible endpoint, or local Ollama), AI-distilled prompt Playbooks, and local voice capture. Licensing is an Ed25519-signed key verified offline. No phone-home, ever. Pro funds the open-source work.

Contributing

We want your issues, your PRs, and your weird harness reports. Start with CONTRIBUTING.md. Every ingested format, every MCP client quirk, every redaction gap you find makes the whole thing better.

  • Bugs and features: issues
  • Questions and show-and-tell: discussions
  • Security reports: SECURITY.md (please do not open public issues for vulnerabilities)bash git clone https://github.com/ctxfile/ctxfile.git && cd ctxfile npm install npm run build && npm test # the whole gate: lint, typecheck, tests

Star history

If ctxfile saves you a cold start, a star is how other people find it.

License

Apache-2.0. "ctxfile" and the ctxfile logo are trademarks of ctxfile; the license covers the code, not the name.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
ctxfile 怎么安装?

在客户端按下面的安装命令接入:npx -y ctxfile。对应的包名是 ctxfile。装完在客户端配置里引用同一个包或端点。

ctxfile 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

ctxfile 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

ctxfile 需要 API Key 吗?

资料标注需要OAuth 授权认证,使用前准备好对应凭据,并按最小权限配置。

ctxfile 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、Gemini CLI、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

ctxfile 能提供哪些能力?

资料显示能力标签包括 mcp、model context protocol、context、claude、cursor、local first。具体工具清单以官方文档为准。

ctxfile 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

ctxfile 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。