pathmark

pathmark

Local-first memory for MCP clients. It provides shared durable memory without requiring hosted accounts, vector databases, or API keys, and works with Codex, Claude Code, Cursor, and other MCP clients.

Category
访问服务器

README

Pathmark

Stop re-explaining your repo each time you switch agents.

<p align="center"> <img src="assets/pathmark-hero.png" alt="Pathmark local memory layer shared by Codex, Claude Code, opencode, and Gemini CLI" width="100%"> </p>

Pathmark gives Codex, Claude Code, opencode, Gemini CLI, Cursor, and any MCP-capable harness one local memory layer. Save decisions, project rules, preferences, and conclusions once. Use them from the next agent without pasting a recap.

Your context stays on disk at ~/.pathmark/memory/memory.jsonl. You do not need an account, hosted database, API key, or vendor backend to start.

Why Pathmark

You do not work in one tool. You ask Codex to patch, Claude Code to review, opencode to clean up, and Gemini CLI to challenge the plan. Each tool starts cold unless you carry the context across.

Pathmark gives those tools one place to read and write memory:

  • One local JSONL store across harnesses.
  • Standard MCP tools: remember, search_memory, get_context, and ask_memory.
  • Client-side synthesis by default, so your coding agent reads the context and answers.
  • Optional Codex CLI, local command, and OpenAI-compatible synthesis modes.
  • Plain files you can inspect, back up, delete, or migrate.

Pathmark stays provider-neutral. Codex gets one optional synthesis preset. The core server works with any MCP client that can use local tools.

Cross-Harness Memory

You switch tools during a coding session:

  • Codex fixes the failing test.
  • Claude Code reviews the patch.
  • opencode cleans the diff.
  • Gemini CLI challenges the approach.

Pathmark keeps the notes in one store.

Point each harness at the same store:

Codex       \
Claude Code \
opencode     >  Pathmark MCP  >  ~/.pathmark/memory/memory.jsonl
Gemini CLI  /
Cursor     /

Install Pathmark in each harness and point them at the same PATHMARK_STORE_DIR. One tool saves context with remember or create_conclusion; the next tool recovers it with search_memory, get_context, or ask_memory.

Pathmark sits below the agents as a memory bus for your coding workflow.

Tools

Pathmark exposes these MCP tools:

Tool Purpose
remember Save a raw memory item.
create_conclusion Save a higher-signal durable conclusion or preference.
search_memory Search memories and conclusions.
get_context Return compact context for a task or question.
list_conclusions List saved conclusions.
delete_memory Soft-delete a memory or conclusion by id.
ask_memory Return relevant context, or synthesize with PATHMARK_CHAT_COMMAND if configured.
chat Chat-compatible alias for ask_memory; returns the retrieved context so the client can show what was used.
get_config Show local store configuration.

Quick Start

npm install -g pathmark

Then add the MCP server to your client.

Prefer npm for normal installs. To test the current GitHub main branch directly:

npm install -g --install-links=true github:hacksurvivor/pathmark

Generate a setup snippet for your harness:

pathmark setup list
pathmark setup claude-code
pathmark setup opencode --json
pathmark setup gemini-cli
pathmark setup kimi

See docs/compatibility.md for Codex, Claude Code, opencode, Gemini CLI, OpenClaw, Hermes Agent, Grok CLI, Kimi, GLM, and generic MCP setups.

Codex

codex mcp add pathmark -- pathmark

Codex users can also enable auto-capture:

pathmark codex install --replace-legacy-hooks

Claude Code

claude mcp add pathmark -- pathmark

opencode / Gemini CLI

Use the generated snippets:

pathmark setup opencode
pathmark setup gemini-cli

Claude Desktop

Add this to your Claude Desktop MCP config:

{
  "mcpServers": {
    "pathmark": {
      "command": "pathmark",
      "env": {
        "PATHMARK_STORE_DIR": "~/.pathmark/memory"
      }
    }
  }
}

Cursor

Add the same command to Cursor's MCP server settings:

{
  "mcpServers": {
    "pathmark": {
      "command": "pathmark"
    }
  }
}

Local Development

npm install
npm run build
npm run smoke

Run directly:

PATHMARK_STORE_DIR=.pathmark npm run dev

Import Legacy Memory

Pathmark can import a compatible local JSONL memory store without deleting or moving the source files.

npm run import:legacy -- --source-dir ~/old-codex-memory

Defaults:

Legacy source:   ~/.pathmark/legacy/codex
Pathmark target: ~/.pathmark/memory/memory.jsonl

The importer creates a memory.jsonl.backup-* file before writing, uses deterministic ids so reruns skip duplicates, and redacts obvious KEY=..., TOKEN=..., PASSWORD=..., and Bearer ... values.

Use a dry run first when migrating another machine:

npm run import:legacy -- --source-dir ~/old-codex-memory --dry-run

Codex Auto-Capture

Install Pathmark as the Codex memory adapter:

pathmark codex install --replace-legacy-hooks

This registers the Pathmark MCP server, enables Codex hooks, and removes old compatible hook commands from Codex. It does not delete or move memory files.

Use --replace-legacy-hooks when you want Pathmark hooks to take over from earlier compatible hook commands. Without it, Pathmark installs alongside existing hook commands.

Check the adapter status:

pathmark codex status

The status output is JSON and includes Pathmark hook state, MCP registration state, legacy hook presence, the active store paths, and the current record count.

Remove Pathmark hooks and MCP registration without deleting memory:

pathmark codex uninstall

Configuration

Variable Default Description
PATHMARK_STORE_DIR ~/.pathmark/memory Directory for memory.jsonl.
PATHMARK_MAX_SEARCH_RESULTS 12 Default search limit.
PATHMARK_SYNTHESIS_PROVIDER client client, command, codex, or openai-compatible.
PATHMARK_CHAT_COMMAND unset Command provider: receives a synthesized prompt on stdin and writes an answer on stdout.
PATHMARK_CODEX_COMMAND codex Codex provider command.
PATHMARK_CODEX_MODEL unset Optional Codex model override.
PATHMARK_OPENAI_BASE_URL https://api.openai.com/v1 OpenAI-compatible API base URL.
PATHMARK_OPENAI_API_KEY unset OpenAI-compatible API key.
PATHMARK_OPENAI_MODEL unset Model id for OpenAI-compatible synthesis.
PATHMARK_CHAT_TIMEOUT_MS 120000 Synthesis command timeout.

Synthesis Modes

Pathmark separates memory from reasoning.

client

Default. The MCP server returns relevant memory context, and your MCP client model synthesizes the answer. This works across Codex, Claude Desktop, Cursor, and any other MCP client without giving Pathmark a model credential.

PATHMARK_SYNTHESIS_PROVIDER=client pathmark

command

Use any local subscription or model CLI that accepts a prompt on stdin and writes an answer to stdout:

PATHMARK_SYNTHESIS_PROVIDER=command \
PATHMARK_CHAT_COMMAND="your-ai-cli --model your-model" \
pathmark

This is the general path for users with another paid subscription CLI or a local model runner.

codex

Use the proven Codex CLI bridge. It runs a controlled, non-interactive codex exec turn with hooks and memories disabled to avoid recursion:

PATHMARK_SYNTHESIS_PROVIDER=codex \
PATHMARK_CODEX_MODEL=gpt-5.5 \
pathmark

This is useful for Codex users who have ChatGPT/Codex subscription auth locally but do not want to add an OpenAI API key.

openai-compatible

Use any provider that exposes /chat/completions, including many Kimi, GLM/Z.ai, OpenRouter, LiteLLM, Ollama-compatible gateways, and self-hosted routers:

PATHMARK_SYNTHESIS_PROVIDER=openai-compatible \
PATHMARK_OPENAI_BASE_URL=https://api.provider.example/v1 \
PATHMARK_OPENAI_API_KEY=... \
PATHMARK_OPENAI_MODEL=... \
pathmark

This mode only affects ask_memory. Regular MCP tools still store and retrieve local memory without a model provider.

Setup CLI

pathmark setup <client> prints copy-paste setup for common harnesses. Add --json when you want structured output for scripts.

Supported targets:

codex
claude-code
claude-desktop
cursor
opencode
gemini-cli
generic
openai-compatible
command

Aliases include claude, gemini, kimi, glm, and z-ai.

Data Format

Pathmark stores newline-delimited JSON at:

~/.pathmark/memory/memory.jsonl

Each record is inspectable:

{
  "id": "uuid",
  "kind": "memory",
  "text": "The user prefers local-first tools.",
  "tags": ["preference"],
  "source": "mcp",
  "createdAt": "2026-06-29T00:00:00.000Z",
  "updatedAt": "2026-06-29T00:00:00.000Z"
}

Deletes are soft deletes: the record gets a deletedAt timestamp.

Roadmap

  • Harness installers for Codex, Claude Code, opencode, Gemini CLI, and other MCP clients.
  • Optional auto-capture hooks/importers per harness, so useful context can be saved with less prompting.
  • Provider presets for common local AI CLIs where stable commands exist.
  • Import/export commands for other memory systems.
  • Better ranking with optional local embeddings.
  • Namespaces for projects, teams, and clients.
  • Encrypted store option.
  • Hosted sync as an opt-in layer, not a requirement.
  • Example recipes for Codex, Claude Desktop, Cursor, ChatGPT, and local LLM tools.

Positioning

Pathmark gives your agents a shared working memory that stays on your machine.

Switch agents. Keep the context.

Bring your own subscription. Keep your memory local.

License

MIT

推荐服务器

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

官方
精选