Context7
Up-to-date docs for AI agents
作者による説明(英語の原文)
Personal knowledge graph every MCP client reads from and writes to. Portable across agents.
この3つを1つのスコアにまとめることはしません。意見、測定、人気はそれぞれ別のものだからです。
このサーバーのやさしい解説はまだ書いていません。以下はレジストリから読み取った事実です。
使っているAIアプリを選んで、設定をコピーしてください。
COSMOS_TOKEN「秘密」と表示された値は、あなたのアカウントの鍵です。絶対に人に教えたり、チャットに貼り付けたりしないでください。
必要なもの
どのアプリを使っていますか?
上でアプリを選んでください。選んだアプリを覚えておくので、次からはボタンに「…にインストール」と表示されます。
Claude Desktop → Settings → Developer → Edit Config を開き、claude_desktop_config.json にこれを貼り付けます
{
"mcpServers": {
"cosmos": {
"command": "npx",
"args": [
"-y",
"@polarity-lab/cosmos-mcp"
],
"env": {
"COSMOS_TOKEN": "your-value"
}
}
}
}ターミナルでこれを実行します
claude mcp add cosmos --env COSMOS_TOKEN=your-value -- npx -y @polarity-lab/cosmos-mcp動かす前に、空欄の値を入力してください。
プロジェクトの .cursor/mcp.json、または ~/.cursor/mcp.json に貼り付けます
{
"mcpServers": {
"cosmos": {
"command": "npx",
"args": [
"-y",
"@polarity-lab/cosmos-mcp"
],
"env": {
"COSMOS_TOKEN": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
プロジェクトの .vscode/mcp.json に貼り付けます
{
"servers": {
"cosmos": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@polarity-lab/cosmos-mcp"
],
"env": {
"COSMOS_TOKEN": "your-value"
}
}
}
}ブラウザがアプリを開いてよいか確認し、そのあとアプリが設定を表示して確認を求めます。キーの値は空欄のままなので、自分で入力してください。
これはパソコンで動くサーバーですが、ChatGPTがつなげるのはインターネット上のサーバーだけです。ほかのアプリを選んでください。
選んだアプリは、この端末のCookieに保存されます。アカウントは不要です。
この設定は、作者のレジストリ登録情報から作成しています。READMEと違う場合は、READMEに従ってください。
パソコンで動くサーバーです。インストールすると、ツール一覧がAIアプリに表示されます。
誰でも見られる情報をチェックしており、コードは読んでいません。当てはまらない項目は数に入れていません。 · 2026年11月8日にチェック
レジストリ名は、リポジトリを所有するGitHubアカウント teampolarity で確認済みです
このリポジトリはまだGitHubから読み取っていません
このリポジトリはまだGitHubから読み取っていません
これはパソコンで動くため、インターネット上のエンドポイントはありません
パソコンで動き、代わりにローカルの設定を使います
パソコンで動くサーバーです。ツール一覧を読み取れるのは、インターネット上のエンドポイントがある場合だけです
レジストリでこのカテゴリにある有効なすべてのサーバーと比較しています。スターは、公開者がリポジトリの所有者である場合だけ数えます。
当てはまる基本チェック1項目のうち1項目に合格しました。コードは読んでいません。キーやトークンを追加する前に、サーバーがどんなアクセスを求めているかを確認し、必要な権限だけを持つキーを使ってください。
入力が必要なもの:COSMOS_TOKEN
あなたのパソコンで動きます。必要なときにAIアプリが起動し、データは作者のサーバーを通りません(サーバー自体がオンラインサービスを呼び出す場合を除きます)。
GitHubリポジトリの最終更新は–、最新バージョン(0.7.1)がレジストリに届いたのは6 か月前です。
Claude Desktop、Claude Code、Cursor、VS CodeなどのMCP対応アプリで使えます。パソコンにNode.jsも必要です。
同じカテゴリには:Context7, Codebase Memory, Exa
同じカテゴリで、ほかの作者が作ったサーバー。スターの多い順。
カードの見方:★ GitHubスターi3つの柱:レビュー · チェック · 利用状況i更新=最新バージョンをレジストリに公開した日i
Up-to-date docs for AI agents
Codebase knowledge graph for AI agents — 162 languages, sub-ms queries, 99% fewer tokens.
Connect AI agents to Exa for web search, content fetching, and multi-step research.
作者のリポジトリから書かれたとおりにコピーしたものです。PopNx MCPは内容を確認・推奨していません。HTML、画像、スクリプトは取り除いています。リンクはこのサイトの外へ移動します。
cosmos-mcp
One exocortex. Every agent.
MCP server for your Cosmos graph.
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.
curl -fsSL https://mcp.polarity-lab.com/install.sh | sh
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:
curl -fsSL https://mcp.polarity-lab.com/install.sh -o install.sh
bash install.sh --dry-run bash install.sh
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:
npx -y @polarity-lab/cosmos-mcp install-handler
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:
npx -y @polarity-lab/cosmos-mcp provision pmk_xxx
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.
npx -y @polarity-lab/cosmos-mcp imessage probe
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.
The installer handles this for common clients. If you want to wire a client by hand, point it at the package.
npx -y @polarity-lab/cosmos-mcp init
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:
{
"mcpServers": { "cosmos": { "command": "npx", "args": ["-y", "@polarity-lab/cosmos-mcp"] } } }
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.
Eleven tools, four read, seven write.
Read
| Tool | Calls | What it returns |
|---|---|---|
polarity_whoami | GET /api/polarity/whoami | Bound user + scopes. Cheap probe. |
polarity_export | POST /api/polarity/export | Full personal graph as polarity/v1 JSON. |
polarity_get_graph | GET /api/polarity | Graph view, scoped by entity (user, cosmos, polarity). |
polarity_ask | POST /api/polarity/ask | NL question synthesized over the graph. |
Write
| Tool | Calls | What it does |
|---|---|---|
polarity_observe | POST /api/polarity/observe | Freeform observation. Cosmos extracts. |
polarity_record_event | POST /api/polarity/observe (kind=event) | Something happened at a point in time. |
polarity_record_preference | POST /api/polarity/observe (kind=preference) | A like, dislike, working-style rule. |
polarity_capture_turn | POST /api/polarity/capture-turn | Hand a whole user/assistant exchange to cosmos. Pulls every durable observation in one call. Prefer over multiple polarity_observe calls. |
polarity_reconstruct_hours | POST /api/polarity/reconstruct-hours | Persist life-hour receipts onto the skill-map sky (per user only). Use from Cursor/Cosmos IDE after substantive work. |
polarity_dump | POST /api/polarity/dump | Location-anchored short message. |
polarity_checkin | POST /api/polarity/checkin | Check-in at a waypoint. Triggers co-presence detection. |
polarity_declare | POST /api/polarity/declare | Declare future presence at a waypoint. |
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.
| Source | How it connects | What lands |
|---|---|---|
| iMessage | Local CLI: npx -y @polarity-lab/cosmos-mcp imessage sync. Mac only. Grant Terminal Full Disk Access first. | Conversational turns from chat.db, with text content. People appear as person nodes in your graph, sized by conversation weight, named via your local AddressBook, dated by your real message timestamps. |
| Claude Desktop | Local CLI: npx -y @polarity-lab/cosmos-mcp claude-desktop sync. Reads Claude Code session transcripts at ~/.claude/projects/. | Every Claude Code session becomes a thread node; user and assistant turns land in conversation_turns with full text. Tool-use plumbing is stripped client-side. |
| Shell history | Local CLI: npx -y @polarity-lab/cosmos-mcp shell-history sync. Reads ~/.zsh_history (falls back to bash/fish) with a byte-offset watermark. | Each sync window lands as one source_page keyed by shell-history: , body = newline-joined commands. Trivial commands (ls, cd .., single chars) and consecutive duplicates are filtered client-side. |
| Notion | OAuth at cosmos.polarity-lab.com/connectors. Pick the pages and databases you want shared. | Each Notion page becomes a source_page node, keyed by Notion id, kept fresh by a daily sync. |
| Obsidian | Community plugin: polarity-lab/obsidian-cosmos. Paste your pmk_ key, point at your vault. | Each note becomes a source_page node keyed by vault-relative path. Tags and wikilinks resolve into edges. |
| MCP clients | This package. | Observations, events, preferences, location dumps, check-ins, declarations. |
| Direct API | POST /api/polarity/observe with your key. | Anything you can express as an observation. |
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.
cosmos-mcp ships an imessage subcommand that reads your local Messages database and lands every conversation in your graph.
# default: incremental sync, 90-day window on first run
npx -y @polarity-lab/cosmos-mcp imessage sync
npx -y @polarity-lab/cosmos-mcp imessage sync --backfill
npx -y @polarity-lab/cosmos-mcp imessage sync --since 2024-01-01
npx -y @polarity-lab/cosmos-mcp imessage status
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.
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/ / .jsonl.
# default: incremental, watermarked per session
npx -y @polarity-lab/cosmos-mcp claude-desktop sync
npx -y @polarity-lab/cosmos-mcp claude-desktop sync --since 2026-05-01
npx -y @polarity-lab/cosmos-mcp claude-desktop sync --dry-run
npx -y @polarity-lab/cosmos-mcp claude-desktop status
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).
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.
npx -y @polarity-lab/cosmos-mcp daemon install
After install, grant the bundle Full Disk Access once:
~/Applications/Cosmos Sync.app into the listcosmos-mcp daemon kick to fire a tick nowBrowser 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.
| Env var | Default | When you set it |
|---|---|---|
COSMOS_URL | https://cosmos.polarity-lab.com | Override the cosmos API endpoint. |
COSMOS_TOKEN | (from keychain) | pmk_... per-user key for CLI subcommands. Takes precedence over the macOS keychain entry. Set this in CI. |
COSMOS_MCP_KEY | (from token file) | pmk_... per-user key. Honored for back-compat. |
COSMOS_USER_ID | (from token file) | Polarity user id. |
COSMOS_SYSTEM_KEY | (unset) | Single-tenant mode. Sends X-System-Key instead of X-MCP-Key. Requires COSMOS_USER_ID. For internal testing before per-user keys are deployed. |
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.
MIT.