
Cosmos Mcp
io.github.teampolarity由 GitHub 账号 teampolarity 发布v0.7.1更新于 Oct 24, 2026
Personal knowledge graph every MCP client reads from and writes to. Portable across agents.
概览
让助手读写个人 Cosmos 知识图谱,使观察、事件和偏好可在多个 MCP 客户端之间持续保留。
- 可以做什么
- 提供十一个工具:四个读取工具(whoami、export、get_graph、ask)和七个写入工具(observe、record_event、record_preference、capture_turn、reconstruct_hours、dump、checkin、declare),用于把观察、事件、偏好、位置记录和签到写入 Cosmos 图谱。命令行还提供 iMessage、Claude Code 会话记录、shell 历史、浏览器和日历的本地同步子命令,以及 macOS 后台守护进程。图谱保存在用户的 Cosmos 账户中,设计上可跨客户端携带。
- 适用场景
- 当你希望多个 MCP 客户端(Claude Code、Claude Desktop、Cursor、Codex、Zed、Continue)共用一个记忆层,而不是各自保留私有上下文时,适合使用。也适合希望把本地消息、笔记或 shell 历史汇入该图谱的用户。若只需要单个客户端的会话记忆,则用处不大。
- 运行要求
- 通过 npx 运行 npm 包 @polarity-lab/cosmos-mcp 的本地 Node.js 进程,使用 stdio 传输。需要从 Cosmos 连接器页面获取 pmk_ 密钥,通过 COSMOS_TOKEN 提供或存入 macOS 钥匙串;可选变量包括 COSMOS_URL、COSMOS_MCP_KEY、COSMOS_USER_ID 和 COSMOS_SYSTEM_KEY。需要访问 cosmos.polarity-lab.com 的网络。macOS 专属功能(钥匙串、深链接处理器、后台守护进程、iMessage 与日历同步)需要完全磁盘访问权限。
安装
在 SourceWeft 中
- 打开 控制台中的 Cosmos Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
cosmos-mcp
One exocortex. Every agent.
MCP server for your Cosmos graph.
[npm] [license] [site] [glama]
Every AI you use is building its own private graph of you. Claude has one. ChatGPT has one. Cursor has one. None of them talk to each other, and none of them are yours.
Cosmos inverts that. Your knowledge graph lives in one place, and any MCP-capable client (Claude Code, Claude Desktop, Cursor, Codex, Zed, Continue) reads and writes to the same one. When an agent notices something durable about you, it lands in the graph. When you switch tools, the graph follows. The user, not the platform, owns the integration layer.
The thing you carry is a .polarity file. Yours.
One-line install
On macOS this installs the MCP server, registers cosmos-mcp://, wires Claude Desktop, Claude Code, Cursor, Codex, Zed, and Continue, then installs Cosmos Sync.app so iMessage, browser history, calendar, Claude Desktop transcripts, and shell history can sync in the background. On linux and windows it installs the MCP server path only.
If you want to inspect before changing anything:
Provisioning
There are two ways to get a pmk_… key onto your Mac.
Automatic. Sign in at cosmos.polarity-lab.com/connectors, tap "open in cosmos-mcp." The OS opens a one-shot handler that writes the key into your system keychain. You never see the raw key.
For that deep link to work, register the URL scheme once:
This drops a tiny .app into ~/Library/Application Support/cosmos-mcp/ and registers cosmos-mcp:// with Launch Services. macOS-only.
Manual. If you already have a pmk_… key, or you do not want to install the handler:
The CLI validates the key against cosmos, then stores it in the macOS system keychain under service cosmos-mcp-key. Subsequent imessage sync, browser sync, calendar sync calls read from the keychain. No env var needed.
Confirm iMessage access.
Verifies Full Disk Access is granted and reports how many chats are visible. If you see an EACCES message, open System Settings, Privacy & Security, Full Disk Access, and add Terminal (or whichever app runs the CLI).
CI. Set COSMOS_TOKEN=pmk_… in env. It takes precedence over the keychain, so existing pipelines keep working untouched.
Manual MCP config
The installer handles this for common clients. If you want to wire a client by hand, point it at the package.
This opens your browser. Sign in at cosmos.polarity-lab.com, approve a per-user key, and the token lands at ~/.config/cosmos-mcp/token (0600). Then point any MCP client at it:
That config drops into ~/Library/Application Support/Claude/claude_desktop_config.json for Claude Desktop, your .cursor/mcp.json for Cursor, the equivalent for whichever client.
What you get
Eleven tools, four read, seven write.
Read
Write
Sources
The MCP server is one way to write to the graph. Cosmos accepts source pages from anywhere you keep notes, and the MCP read tools see all of it through the same view.
Unchanged pages are skipped server-side, so re-syncing a quiet vault or stable Notion workspace costs almost nothing. The iMessage sync is incremental too, watermarked on the last successful run, so re-running it is a no-op until new messages arrive.
iMessage sync
cosmos-mcp ships an imessage subcommand that reads your local Messages database and lands every conversation in your graph.
A three-rule slop filter (no-reply senders, short-code numbers, low-volume contacts) keeps the graph clean. Your AddressBook resolves phone numbers and emails into real contact names. The reading is local to your Mac; only the extracted, normalized turns go into your cosmos graph, which is your account.
Claude Desktop sync
cosmos-mcp ships a claude-desktop subcommand that watches Claude Code session transcripts and lands each turn in your graph. The desktop chat surface itself stores conversations server-side, so the live, watchable on-disk source is ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl.
Tool-use blocks, hook plumbing, and sub-agent (sidechain) turns are stripped client-side; only the visible text the user and the assistant exchanged is shipped. Each session id becomes its own thread node, keyed by (user_id, "claude-desktop", session_id).
Background sync (macOS)
cosmos-mcp daemon install drops a LaunchAgent that ticks every four hours and runs the browser, iMessage, calendar, claude-desktop, and shell-history syncs back-to-back. The agent fires a signed, notarized Cosmos Sync.app bundle that ships inside the npm package and gets copied into ~/Applications/Cosmos Sync.app at install time.
After install, grant the bundle Full Disk Access once:
- open System Settings → Privacy & Security → Full Disk Access
- click +, then drag
~/Applications/Cosmos Sync.appinto the list - make sure the checkbox next to it is on
- run
cosmos-mcp daemon kickto fire a tick now
Browser sync works without that step. iMessage and Calendar need it because they read TCC-protected SQLite databases on the user side. cosmos-mcp daemon status reports the signing team id, the plist + runner paths, and whether launchd has the agent loaded. cosmos-mcp daemon uninstall removes the plist, runner, and ~/Applications/Cosmos Sync.app.
Configuration
The pitch in three lines
Your AI tools each know fragments of you. They are not allowed to share. Cosmos is the layer that lets them. You hold the key. The graph is portable. When you leave, you take the understanding with you.
License
MIT.
来源:README.md,提交 3d04c64
工具
0版本历史
1- v0.7.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分