Project management MCP server for Claude Code & Codex CLI — track tasks, visualize progress, and manage decisions across AI coding hosts
pip install pmlens==0.16.0 Copy PIP instructions
PM Lens for Claude Code, Codex CLI, Cursor and Grok Build — a project management MCP server that works across multiple AI coding assistants.
Track tasks, visualize progress, record decisions — through natural language in whichever host you happen to be in. One PM substrate, multiple hosts.
> 進捗は? ✓ Phase 1 "Backend API": 60% complete (12/20 tasks) - 3 tasks in progress, 1 blocked - Velocity: 8 tasks/week (↑ trending up) > 次にやること 1. [P0] MYAPP-014: Add user authentication endpoint 2. [P1] MYAPP-015: Implement rate limiting 3. [P1] MYAPP-018: Write integration tests > MYAPP-014 に着手 ✓ MYAPP-014 → in_progress HTML dashboard (pm_dashboard) — phase progress, velocity, blockers, and risks at a glance:
pipx install pmlens pmlens install # Registers MCP server in Claude Code # Restart Claude Code Update pipx upgrade pmlens # Restart Claude Code Note: pipx is recommended because pmlens is a command-line tool — it gets its own isolated environment, and a plain pip install outside a virtualenv is refused outright on Homebrew and Debian/Ubuntu Pythons (PEP 668, error: externally-managed-environment). Inside a virtualenv, pip install pmlens and pip install -U pmlens work the same way.
After upgrading, each project's rule section is updated with the user's agreement:
> CLAUDE.md を更新して # or: pm_update_rules The legacy pm_update_claudemd tool is still available as a back-compat alias (CLAUDE.md only). It emits a DeprecationWarning since v0.6.0 and is slated for removal in v1.0.0 (PMSERV-055).
If Claude Code reports an MCP connection failure (or pmlens: ENOENT) right after pip install --upgrade, the usual cause is an interrupted install. If pip is stopped mid-extraction (Ctrl-C, sleep, low disk), the package can be left half-written: pip list still shows it as installed, but some modules and the pmlens console script are missing — so the launcher can't be found.
Recover with a forced clean reinstall of the code package (pmlens):
pip install --force-reinstall --no-deps pmlens== pyenv rehash # pyenv users only — regenerate the shim pmlens --help # verify → "PM Lens — ..." MCP servers connect only at startup, so restart Claude Code afterward (a failed connection is not retried within a running session).
# In Claude Code, cd to your project directory > PM初期化して ✓ .pm/ created ✓ Registered in global registry ✓ Detected: name=my-app, version=1.2.0 (from package.json) PM Lens automatically detects project info from package.json, pyproject.toml, Cargo.toml, .git/config, and README.md.
PM Lens registers as an MCP server in four hosts, each of which keeps its MCP configuration in a completely separate store:
Three of the four read AGENTS.md, so rule injection is keyed on the rule file, not the host: --target all writes AGENTS.md exactly once and reports which hosts read it.
Grok Build note. Grok Build already reads Claude Code's and Cursor's MCP configs as compatibility sources, so if you installed PM Lens for Claude Code it very likely works in Grok already. Registering natively still helps: the compatibility scan is opt-out ([compat.claude] mcps = false) and is merged at lower priority than ~/.grok/config.toml.
Grok Build also loads every recognised rule file in a directory — both AGENTS.md and CLAUDE.md. In a project managed for Claude Code and Codex it therefore sees the PM rules twice. Neither file can be dropped, so pm_status reports this in warnings[] rather than "fixing" it.
pmlens install and pmlens uninstall accept a --target (alias -t) flag. The default is conservative on purpose: existing scripts and documentation that say pm-server install continue to register only Claude Code, exactly as in v0.4.x.
The companion command pmlens update-rules (introduced in v0.5.0 alongside this feature) defaults to --target auto because it is a brand-new command with no v0.4.x baseline to preserve.
# Default (back-compat) — Claude Code only pmlens install # Add PM Lens to whichever host(s) are detected on this machine pmlens install --target auto # Force registration in both, creating ~/.codex/config.toml if needed pmlens install --target all # Preview what would happen, don't touch any files pmlens install --target auto --dry-run # Symmetric removal (same --target semantics) pmlens uninstall --target auto See docs/design.md §5.2 and ADR-007 for the detailed rationale (detect-then-patch, backup, dry-run, absolute-path embedding).
pm_init and pm_update_rules keep PM Lens's auto-action rules synced into the appropriate per-host instruction file:
The rules section is bracketed by / markers and updated in place — user content outside the markers is never touched.
pm_update_rules (and its CLI sibling pmlens update-rules) defaults to --target auto: it detects which host(s) are present on this machine and updates only those instruction files. Detection runs four signals (filesystem, marker, CLAUDECODE env, fallback) — see ADR-008 amendment A3 in docs/design.md §6.4.
Both files are backed up to .bak. before each write.
Rule sections only move forward: a pmlens whose template is older than the section on disk leaves it alone and reports rules_newer_than_server (pass force to downgrade on purpose). pm_status also warns when a section is older than the running pmlens (rules_outdated) or when CLAUDE.md and AGENTS.md carry different versions (rule_file_version_mismatch).
--all touches every registered repository, and those often commit their rule files, so it defaults to --target existing (only files that already carry the section; nothing is created) and prints the plan without writing until you add --apply.
See docs/design.md §6 and ADR-008 for the multi-host rules-injection design (claudemd → rules module rename, marker convention, dataclasses, atomic-write helpers).
Credentials are scrubbed on the way into the index. Ingest is the moment a note written in one repo becomes searchable from every other repo, and auto-memory notes are free-form text nobody wrote expecting an index. High- severity credential patterns (AWS keys, GitHub/Slack tokens, private-key headers, …) are removed from the indexed copy by default and reported as per-category counts — never echoed back. redact=false indexes verbatim.
Only the credential category is touched. Paths, IP addresses and ticket references stay: an index on your own machine that has lost them returns hits nobody can act on. And the scrub applies to the derived index only — the source .md still holds the credential, so a real leak still has to be rotated.
Deleting large rows can leave the text in the file — on some builds. Measured, because both the general claim and its opposite are wrong. A row small enough to fit in one SQLite page is rewritten in place and the WAL checkpoint copies the post-delete version over it, so nothing readable survives anywhere. A row big enough to spill onto overflow pages — roughly past ~4 KB — depends on how your SQLite was compiled:
So on macOS a purged 64 KB note is still largely readable with grep, and on a typical Linux box it is not.
Free-form auto-memory notes routinely clear that bar. So the case that matters is: you ingested a note, later realised it contained a secret or personal data, and purged it — the index no longer returns it, but a grep of the file still finds most of it.
pm_memory_ingest(purge=true, vacuum=true) follows the delete with a VACUUM and a WAL truncate, which removes it on either build (and reclaims the file size in both cases). It is off by default: it takes an exclusive lock and rewrites the whole file, a poor trade for a routine scope-fix purge. If a concurrent session blocks it, the purge still succeeds and the response carries vacuum_error rather than failing — the rows are gone either way.
This is hygiene, not secure erasure. It only touches ~/.pm/memory.db. Backups, Time Machine snapshots, an SSD's remapped blocks, and the source .md notes themselves are all untouched — and the note is the original, so a leaked secret still has to be rotated. pm-server deliberately does not set PRAGMA secure_delete globally: it would make every user pay a write cost on every delete for a risk specific to ingested content, and it would not clear pages that were already freed.
What "latest" means (ADR-042/043). Every recency read — pm_recall (with or without track), pm_session_summary get/list, and the CLI context injection — returns the session you last worked on, not the one you last started. Re-saving an existing summary moves it back to the top, and timestamps are recorded with millisecond precision, so multiple saves within the same second stay correctly ordered. A summary saved while the system clock was ahead (NTP skew, restored VM snapshot) is clamped back to now on the next open, so "the next save wins" always self-heals — nothing to configure. Recency lookups are index-backed and stay fast as summaries accumulate; the indexes are created only on read-write opens (never by read-only Lens viewers) and require SQLite >= 3.9 of any reader of the DB file — a bar already cleared by anything that reads the FTS5 tables.
Pruning session summaries. pm_memory_cleanup(summaries_keep_latest=N) keeps the newest N summaries (same last-worked order recall uses) and always additionally keeps the newest summary of every branch group — so track= recall and tracks.yaml glob resolution never lose a line's last context, even on non-git projects. N >= 1 is enforced, dry-run is the default, and a prune whose delete set reaches into the recent ambiguity window is refused rather than merely reported — it would disable concurrent-session detection for a session that may still be live, so the call returns summaries.blocked=true with nothing deleted and a warnings[] entry (a dry-run predicts this via summaries.would_block). Pass summaries_force=true to execute it anyway. The same N >= 1 floor applies to keep_latest for memories. Pruning is irreversible and does not shrink the DB file.
Turns knowledge already recorded in .pm — a lesson, an insight, an adopted ADR — into a publishable draft. Destination-agnostic: a blog post, an internal write-up, a social thread. The server holds credentials for none of them and has no network egress in scope, so publishing from here is structurally impossible; a human takes the redacted draft out of the system and publishes it wherever they choose. Deterministic redaction is the one safety layer, and raw content never leaves the store.
The preferred names above were added in v0.16.0. pm_draft_x and pm_x_drafts_pending remain supported compatibility aliases, using the same arguments, results and project-local store. New projects use .pm/drafts.db; existing .pm/x_drafts.db files stay in place and remain in use. v0.15.1 and earlier use only the legacy tool names and database filename. Existing permissions keep working for the legacy tool names; see the migration guide for older-client limits and recovery when both database names exist.
Two env flags gate what a build can reach: PM_LENS=1 switches a build into read-only "Lens viewer" mode (Claude Desktop, Cowork); adding PM_DESKTOP_WRITE=1 on top of that makes it a "Desktop outbox host" that may also write to its own outbox database. The table below reflects the actual RO_ALLOWLIST / OUTBOX_READ_ALLOWLIST / OUTBOX_WRITE_ALLOWLIST gates in server.py, not aspirational design:
Why Desktop can't merge (R5). You'll notice pm_outbox_merge and pm_outbox_reject stay unavailable even from a Desktop outbox host with write access. That's on purpose, not an oversight: merging is the step that actually writes into a project's main .pm/memory.db, and keeping that one step on the Claude Code side means two hosts can never race to merge the same entry twice. In the meantime, review what's pending from either side with pm_outbox_pending, then merge or reject it from Claude Code. A future cross-machine cloud-sync feature is the intended way to close this gap.
Scope: per-HOME, not cross-machine. ~/.pm/desktop/desktop.db lives under your home directory, so it bridges Claude Desktop and Claude Code sessions on the same machine — a note captured on Desktop this morning shows up in Code this afternoon. It does not sync between two different computers; carrying outbox entries across machines is future cloud-sync scope, not something this feature does today.
# Overlay unmerged Desktop entries onto recall context pm_recall(project_path=".", include_outbox=true) # -> adds outbox_entries[] + outbox_summary{pending_total, project_pending, # unscoped_pending, scope} to the normal pm_recall response # Saving from Desktop into a project Claude Code hasn't pm_init'd yet still # succeeds -- it's guidance, not a failure pm_outbox_remember(content="...", source_project="/path/to/new-project") # -> status: "saved", plus a warnings[] entry: # {"code": "unregistered_project", # "remediation": "If Claude Code is available: run pm_init on that # path, then pm_outbox_merge ..."} Maintenance Tool Description pm_update_rules Update PM Lens rules section in CLAUDE.md and/or AGENTS.md (multi-host, ADR-008). Default target=auto detects installed hosts pm_update_claudemd Legacy alias of pm_update_rules(target="claude-code") — deprecated since v0.6.0, removal in v1.0.0 Parallel Work Lines (Branch-Aware Continuity) Running several streams of work in one repo — e.g. a mainline, a paper, and teaching material? PM Lens gives each line its own session-continuity context. Two topologies are supported (ADR-028).
PM Lens scopes everything — tasks, memories, and session summaries — to the directory that contains .pm/. Because .pm/memory.db is git-ignored, every git worktree gets its own independent store automatically:
git worktree add ../myproj-paper paper # 論文 line git worktree add ../myproj-edu edu # 教材 line # the original checkout stays the mainline (本流) Now cd ../myproj-paper and pm_recall returns the paper line's last session — no flags, no schema, no branch detection. Three lines = three editor windows, no stash dance, no merge conflict on switch.
Prefer a single directory and git checkout between lines? Pass the branch as a track:
pm_recall(track="paper") # last session recorded while on the `paper` branch The branch is recorded automatically when pm_session_summary(action="save") runs. It is read from .git/HEAD as text — PM Lens never shells out to git, so a hostile .git/config can't execute code (CVE-2026-45033 / git config-exec class). Under the bundled plugin, the SessionStart hook surfaces the current branch so the model can pass track= on its first recall; re-pass it after any git checkout. If a line has no recorded summary yet (e.g. an existing DB from before this feature), pm_recall(track=...) gracefully falls back to the overall-latest and sets track_matched: false — so it never breaks on day one. Logical track labels (.pm/tracks.yaml) A work line is a concept; branches are implementation detail that get renamed and split. Map a logical label to one or more branch globs so continuity follows the line, not the branch name:
# .pm/tracks.yaml tracks: 本流: [main] 論文: [feat/p3-*, research/wave-scattering-*] 教材: [edu/*] pm_recall(track="論文") # latest session across ANY branch matching the 論文 globs Resolution is at query time, so renaming or adding a branch within a line never breaks history (rename-resistant). track accepts a logical label OR a raw branch name — labels resolve first; anything else is matched as a raw branch. Backward compatible: with no tracks.yaml, every track is a raw branch (the v1 behavior). When matched, the response includes track_branch (which actual branch the context came from); a malformed tracks.yaml degrades to raw-branch matching and surfaces a warnings[] entry. See ADR-028 (design) and ADR-035 on the SynapticLedger side (unified .pm/ + track=).
PM Lens stores task data as plain YAML and memories in SQLite:
your-project/ └── .pm/ ├── project.yaml # Project metadata ├── tasks.yaml # Tasks with status, priority, dependencies ├── decisions.yaml # Architecture Decision Records (ADR) ├── knowledge.yaml # Structured knowledge records ├── workflows.yaml # Workflow instances and state ├── milestones.yaml # Milestone definitions ├── risks.yaml # Risks and blockers ├── memory.db # Session memories (SQLite + FTS5) ├── workflow_templates/ # Custom workflow templates (optional) └── daily/ └── 2026-04-08.yaml # Auto-generated daily log ~/.pm/ ├── registry.yaml # Global project index └── memory.db # Cross-project memory index YAML files are human-readable and hand-editable. Memory DB is the source of truth for session data; the global index at ~/.pm/memory.db enables cross-project search.
pm_init adds a PM Lens section to CLAUDE.md, and pmlens update-rules keeps it (and AGENTS.md for Codex, Cursor and Grok Build) current. Let the tool write the section rather than copying it by hand: it is versioned, the version is shown in its heading, and pmlens warns when a project's copy falls behind.
What the section asks of the model (template v15, ADR-054):
1. Install & register → pipx install pmlens && pmlens install 2. Start Claude Code → (restart after install) 3. Initialize project → "PM初期化して" or "Initialize PM" 4. Add tasks → "Add task: implement user auth" 5. Work on tasks → "Start MYAPP-001" 6. Complete tasks → "MYAPP-001 done" 7. Issues found in review → "MYAPP-001 has an issue: ..." (creates child issue) 8. End session → "Session wrap-up" (triggers summary + log) Protecting Context from Compaction Claude Code automatically compresses (compacts) conversation context when sessions get long. This means detailed information from earlier exchanges can be lost. PM Lens's memory tools protect against this:
Key principle: Save early, save often. Compaction timing is unpredictable — if a finding is worth keeping, record it now.
PM Lens's memory layer ensures nothing is lost between sessions:
Session 1 Session 2 │ │ ├─ pm_remember (findings) ├─ pm_recall ← restores context ├─ pm_remember (decisions) ├─ pm_status ← current state ├─ pm_session_summary │ └─ (session ends) └─ (continues seamlessly) Automatic Hooks (Lifecycle Enforcement) PM Lens automatically installs Claude Code hooks at first session start (pm_status). After a git ... commit command in a PM Lens project with a task in progress, a PostToolUse hook adds a reminder (as hookSpecificOutput.additionalContext): if the commit completed a task, mark it done with pm_update_task and record it with pm_log; an intermediate commit changes nothing.
> "Discover projects under ~/projects" # Auto-scan & register > "Show all projects" # Portfolio overview > "Search memories for 'auth' globally" # Cross-project search > "Show dashboard for all projects" # Portfolio HTML dashboard CLI Commands pmlens install # Register MCP server (default: Claude Code only — back-compat). # Pass --target {auto,all,claude-code,codex,cursor,grok} for multi-host. # Pass --dry-run to preview without writing. See "Multi-Host Support" below. pmlens uninstall # Symmetric to install (same --target / --dry-run semantics). pmlens serve # Start MCP server (called by Claude Code automatically) pmlens discover . # Scan for projects with .pm/ directories pmlens status # Show project status from terminal pmlens context-inject # Print session context to stdout (for hook integration) pmlens prompt-pack # Export backlog tasks as a paste-ready prompt pack (ADR-041) # --tag/--phase/--priority/--task-id/--format {markdown,html} # --group-by {none,phase,track} / --out / --project pmlens migrate # Migrate from pm-agent (rename transition) pmlens update-rules # Inject PM Lens rules into CLAUDE.md and/or AGENTS.md (ADR-008). # --target {auto,all,claude-code,codex,cursor,grok} (default: auto) # --dry-run / --all (apply to every registered project) pmlens update-claudemd # Legacy: CLAUDE.md of this project only (--all is retired; use update-rules --all). Deprecated since v0.6.0. pmlens install-hooks # Manually install Claude Code hooks (auto-installed via pm_status) pmlens uninstall-hooks # Remove PM Lens hooks from Claude Code settings Architecture For a graphical overview (module map, MCP tool catalog with Lens RO_ALLOWLIST, Lens mode flow, workflow state machines, task/issue lifecycle, data layout, and distribution channels), see docs/architecture.html. Open it directly in a browser — it is a single self-contained static file (no external dependencies).
Claude Code Session │ ├── CLAUDE.md auto-action rules ├── PostToolUse hooks (auto-installed) ├── Skills (super-research, etc.) │ └── MCP Server (stdio) └── pmlens serve │ ├── server.py → 44 MCP tools + 2 compatibility aliases (FastMCP) ├── models.py → Pydantic v2 data models (18 models, 16 enums) ├── storage.py → YAML read/write ├── workflow.py → Workflow engine (state machine) ├── memory.py → SQLite memory store + FTS5 search ├── recall.py → Session context builder (token-budgeted) ├── hooks.py → Claude Code hook handler + installer ├── context.py → CLI context injection ├── velocity.py → Velocity calculation & risk detection ├── dashboard.py → HTML/text dashboard (Jinja2) + workflow progress + knowledge map ├── discovery.py → Auto-detect project info └── installer.py → Multi-host MCP registration (ADR-007) ├─ install_claude_code() → claude mcp add (subprocess) ├─ install_codex() → ~/.codex/config.toml (tomlkit) └─ install(target=...) → orchestrator + InstallSummary Data layer (operated on through pmlens serve): ├── project-A/.pm/ (YAML + workflows + knowledge + memory.db) ├── project-B/.pm/ (YAML + workflows + knowledge + memory.db) └── ~/.pm/registry.yaml + memory.db Migrating from pm-server If you installed this project under its previous name, PM Server (pm-server):
Nothing breaks — pip install pm-server / uvx pm-server keep working (the pm-server distribution is now a thin wrapper that depends on pmlens). To move to the new identity:
pip install -U pmlens # or: pipx install pmlens pmlens migrate-from-pm-server # re-register the MCP server + migrate settings # Restart Claude Code migrate-from-pm-server will:
Your .pm/ data is unchanged. See docs/MIGRATION.md for details.
If you were using the earlier pm-agent package:
pip uninstall pm-agent pip install -U pmlens pmlens migrate # Switches MCP registration from pm-agent to pmlens # Restart Claude Code The migrate command will:
Your .pm/ data directories are unchanged — no data migration needed.
git clone https://github.com/flc-design/pmlens.git cd pmlens pip install -e ".[dev]" pytest # 1,000+ tests pytest --cov # with coverage (branch coverage, show missing) ruff check src/ # Lint ruff format src/ # Format Design Principles Zero Configuration — pip install + one command, done Auto-everything — detection, registration, and inference are fully automatic Git-friendly — plain text YAML, trackable with git diff Human-readable — safe to hand-edit, won't break AI-native — formats that Claude Code can naturally read and write Non-invasive — only adds .pm/, never modifies your project Trademark notice "PM Lens"™ is a trademark of FLC design Co., Ltd., used as the display name of this project. The project is published on PyPI as pmlens; the Python import name (pmlens), the console binary (pmlens), and the MCP tooling all use the pmlens identifier. A compatibility wrapper distribution named pm-server is retained on PyPI so existing pip install pm-server / uvx pm-server invocations keep working during the transition to the PM Lens brand.
This project is not affiliated with, endorsed by, or sponsored by:
All trademarks are the property of their respective owners.
MIT — Shinichi Nakazato / FLC design Co., Ltd.
ai-agents ai-coding-assistant claude-code codex-cli mcp mcp-server project-management
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.




