claude-historian-mcp

作者 Vvkmnn

📜 An MCP server for conversation history search and retrieval in Claude Code

176
Stars
18
Forks
TypeScript
语言
2026/8/23
添加时间

⚠️ 第三方软件声明

本 Skill 为第三方开源软件,独立托管于 GitHub。SkillTip 仅为信息目录,不控制或维护底层仓库。所显示的安全检查为自动化且范围有限,安装前请自行审查源码。

阅读服务条款

安装

添加到你的 Claude Code skills 目录:

# Add to your Claude Code skills
git clone https://github.com/Vvkmnn/claude-historian-mcp

快速入门

使用 claude-historian-mcp 等 Skills 的指南。

安全报告

已验证

上次扫描:—

{
  "status": "PASSED",
  "issues": []
}

README.md

claude-historian-mcp

claude-historian-mcp

An Model Context Protocol (MCP) server for searching your Claude Code conversation history. Find past solutions, track file changes, and learn from previous work.


claude-historian-mcp

npm version License: MIT TypeScript Node.js Claude GitHub stars CodeRabbit Pull Request Reviews


install

Requirements:

Claude Code

From shell:

claude mcp add claude-historian-mcp -- npx claude-historian-mcp

From inside Claude (restart required):

Add this to our global mcp config: npx claude-historian-mcp

Install this mcp: https://github.com/Vvkmnn/claude-historian-mcp

From any manually configurable mcp.json: (Cursor, Windsurf, etc.)

{
  "mcpServers": {
    "claude-historian-mcp": {
      "command": "npx",
      "args": ["claude-historian-mcp"],
      "env": {}
    }
  }
}

There is no npm install required -- no external dependencies or local databases, only search algorithms.

However, if npx resolves the wrong package, you can force resolution with:

npm install -g claude-historian-mcp

renamed: This project was renamed from claude-historian to claude-historian-mcp. Existing users should update your install command and MCP config args to claude-historian-mcp.

skill

Optionally, install the skill to teach Claude when to proactively use historian:

npx skills add Vvkmnn/claude-historian-mcp --skill claude-historian --global
# Optional: add --yes to skip interactive prompt and install to all agents

This makes Claude automatically check your history before web searches, when encountering errors, or at session start. The MCP works without the skill, but the skill improves discoverability.

plugin

For automatic history search with hooks and commands, install from the claude-emporium marketplace:

/plugin marketplace add Vvkmnn/claude-emporium
/plugin install claude-historian@claude-emporium

The claude-historian plugin provides:

Hooks (targeted, zero overhead on success):

  • Before WebSearch/WebFetch → Check search scope="similar"
  • Before EnterPlanMode → Check search scope="plans"
  • Before Task agents → Check search scope="tools"
  • After Bash errors → Check search scope="errors"

Command: /historian-search <query>

Requires the MCP server installed first. See the emporium for other Claude Code plugins and MCPs.

features

MCP server that gives Claude access to your conversation history. Two tools, 11 scopes, zero dependencies.

Runs locally (with cool shades [⌐■_■] 📜):

search

Search across conversations, files, errors, plans, config, tasks, sessions, tools, similar queries, and memories.

search query="docker auth error"                          # default scope: all
search query="fix build" scope="conversations"            # past solutions
search query="ENOENT" scope="errors"                      # error patterns + fixes
search query="auth" scope="plans"                         # implementation plans
search query="hooks" scope="config"                       # rules, skills, CLAUDE.md
search query="git push" scope="similar"                   # related questions asked before
search query="Edit" scope="tools"                         # tool usage workflows
search filepath="package.json" scope="files"              # file change history
search scope="sessions"                                   # recent sessions
search scope="memories"                                   # project memory files
search query="deploy" scope="all" detail_level="detailed" # full context
search query="auth" timeframe="7d" project="my-app"       # filtered
📜 ── search "docker auth" ── 5 results · 405 tokens

{
  "results": [{
    "type": "assistant",
    "ts": "2h ago",
    "content": "Fixed Docker auth by updating registry credentials...",
    "project": "my-app",
    "score": 100,
    "ctx": { "filesReferenced": ["docker-compose.yml"], "toolsUsed": ["Edit", "Bash"] }
  }]
}
📜 ── files "package.json" ── 92 operations · 1594 tokens

{
  "filepath": "package.json",
  "operations": [{
    "type": "edit",
    "ts": "1d ago",
    "changes": ["Changed: \"version\": \"1.0.3\" → \"version\": \"1.0.4\""],
    "content": "Updated version for release"
  }]
}
📜 ── tools "Bash" ── 5 patterns · 427 tokens

{
  "tool": "Bash",
  "patterns": [{
    "name": "Bash",
    "uses": 10,
    "workflow": "$ npm run build 2>&1",
    "practice": "Used with: ts, js, json, md files"
  }]
}

inspect

Get an intelligent summary of any session by ID (full UUID or short prefix).

inspect session_id="latest"                      # most recent session
inspect session_id="d537af65"                    # short prefix works
inspect session_id="d537af65" focus="files"      # only file changes
inspect session_id="d537af65" focus="tools"      # only tool usage
inspect session_id="d537af65" focus="solutions"  # only solutions
📜 ── inspect my-app (68d5323b)

{
  "session": {
    "id": "68d5323b",
    "ts": "2h ago",
    "duration": 45,
    "messages": 128,
    "project": "my-app",
    "tools": ["Edit", "Bash", "Read"],
    "files": ["src/auth.ts", "package.json"],
    "accomplishments": ["fixed auth bug", "added unit tests"],
    "decisions": ["chose JWT over sessions"]
  }
}

methodology

How claude-historian-mcp works:

"docker auth" query
      |
      ├─> Parallel Processing (search.ts:174): 15 projects × 10 files concurrently
      |   • Promise.allSettled for 6x speed improvement
      |   • Early termination when sufficient results found
      |   • Enhanced file coverage with comprehensive patterns
      |
      ├─> Enhanced Classification (search.ts:642): implementation → boost tool workflows
      |   • Workflow detection for tool sequences (Edit → Read → Bash)
      |   • Semantic boundary preservation (never truncate mid-function)
      |   • Claude-optimized formatting with rich metadata
      |
      ├─> Smart Ranking (utils.ts:267):
      |   ├─> Core Terms (scoring-constants.ts): "docker" +10, "auth" +10
      |   ├─> Supporting Terms: context words +3 each
      |   ├─> Tool Usage: Edit/Bash references +5
      |   ├─> File References: paths/extensions +3
      |   └─> Project Match: current project +5
      |
      ├─> Results sorted by composite score:
      |   • "Edit workflow (7x successful)" (2h ago) ***** [score: 45]
      |   • "Docker auth with context paths" (yesterday) **** [score: 38]
      |   • "Container debugging patterns" (last week) *** [score: 22]
      |
      └─> Return Claude Code optimized results

Core optimizations:

Search strategies:

Design principles:

  • Universal engine -- single search backend for all Claude Code conversations
  • Parallel processing -- concurrent file scanning across session directories
  • Semantic expansion -- query synonyms and related terms for better recall
  • Zero dependencies -- only @modelcontextprotocol/sdk, no databases required
  • Offline -- never leaves your machine, scans local JSONL files only

File access:

  • Reads from: ~/.claude/conversations/
  • Zero persistent storage or indexing
  • Never leaves your machine

Performance: See PERFORMANCE.md for benchmarks, optimization history, and quality scores.

alternatives

Every conversation history tool either loads context always (burning tokens when unused) or requires external runtimes and databases. Historian searches on-demand with zero dependencies.

FeaturehistorianClaude Memoryclaude-memdejaconversation-search
DependenciesZeroBuilt-inBun + Python + SQLite + ChromaPythonRust toolchain
Background serviceNoNoYes (port 37777)NoNo
Writes to diskNeverYes (auto-memory files)Yes (SQLite + Chroma DB)Yes (breadcrumbs)Yes (~10% index overhead)
Session startup0 tokens~200 lines loaded5-8k tokens every sessionSkill prompt loaded0 tokens
Token cost (idle)0200 lines/session5-8k/sessionSkill prompt/session0
Search algorithms12None (file read)Vector + keywordWeighted signalsBM25 full-text
Fuzzy matchingYesNoYes (vector similarity)NoNo
Workflow detectionYesNoNoNoNo
Raw conversationsYesNo (summaries only)No (compressed observations)YesYes (filtered)
MaintenanceZeroZeroWorker daemons, migrationsSkill configIndex rebuilds

Claude Memory -- Claude's built-in memory (CLAUDE.md + auto-memory). Persists project rules and preferences across sessions. Forward-looking ("always use ESM imports"); not conversation search. Complementary: memory for rules, historian for past solutions.

claude-mem -- Plugin that captures observations via lifecycle hooks, compresses them into SQLite + Chroma, and loads context every session. Requires Bun, Python, and a background worker on port 37777. Real-world testing (270+ sessions): 95% of sessions never query history -- always-on tools pay 5-8k tokens per session regardless. Historian pays 0 tokens idle, 500-2k per query, saving ~475k tokens over 100 sessions. Known issues: creates stub session files that break --continue, worker daemon version conflicts, security hooks blocking valid edits.

deja -- Python skill that indexes sessions by episodes and accomplishments. Uses weighted signal ranking (todos > files > text). Requires Python and TodoWrite integration.

conversation-search -- Rust MCP server using Tantivy BM25 full-text search. Fast indexing (~1000 conversations/second) but requires Rust toolchain and persistent disk index.

desktop

Note: Claude Desktop stores conversations server-side, not locally. The local LevelDB files (~/Library/Application Support/Claude/) contain only session tokens, UI preferences, and Intercom state - not conversation content. Claude Desktop support is also blocked by LevelDB locks and Electron sandboxing.

This means local history search for Claude Desktop is not currently possible. This project focuses on Claude Code, which stores full conversation history locally in ~/.claude/projects/.

You may get some Claude Desktop from Claude Code, but only when the Claude app is closed. Furthermore A DXT package and build is available for future compatibility; further investigations are ongoing. Feel free to test with it.

development

git clone https://github.com/Vvkmnn/claude-historian-mcp && cd claude-historian-mcp
npm install && npm run build
npm test

Package requirements:

  • Node.js: >=20.0.0 (ES modules)
  • Runtime: @modelcontextprotocol/sdk
  • Zero external databases -- works with npx

Development workflow:

npm run build          # TypeScript compilation with executable permissions
npm run dev            # Watch mode with tsc --watch
npm run start          # Run the MCP server directly
npm run lint           # ESLint code quality checks
npm run lint:fix       # Auto-fix linting issues
npm run format         # Prettier formatting (src/)
npm run format:check   # Check formatting without changes
npm run typecheck      # TypeScript validation without emit
npm run test           # Lint + type check
npm run prepublishOnly # Pre-publish validation (build + lint + format:check)

Git hooks (via Husky):

  • pre-commit: Auto-formats staged .ts files with Prettier and ESLint
  • pre-push: Runs full validation (format, lint, type-check, build) before push

Contributing:

  • Fork the repository and create feature branches
  • Test with large conversation histories before submitting PRs
  • Follow TypeScript strict mode and MCP protocol standards

Learn from examples:

license

MIT


Appius Claudius Caecus in the Senate -- Cesare Maccari

Appius Claudius Caecus in the Senate by Cesare Maccari (1888). Roman statesman and father of Latin prose.

常见问题

What is claude-historian-mcp?

claude-historian-mcp is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Vvkmnn. 📜 An MCP server for conversation history search and retrieval in Claude Code. It has 176 GitHub stars.

Is claude-historian-mcp safe to use?

claude-historian-mcp failed SkillsLLM's automated security scan, which flagged one or more high-severity issues. Review the Security Report section carefully before using it.

How do I install claude-historian-mcp?

Clone the repository with "git clone https://github.com/Vvkmnn/claude-historian-mcp" and add it to your Claude Code skills directory (see the Installation section above).

What programming language is claude-historian-mcp written in?

claude-historian-mcp is primarily written in TypeScript. It is open-source under Vvkmnn on GitHub, so you can review or fork the full source.

Are there alternatives to claude-historian-mcp?

Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh claude-historian-mcp against similar tools.

评论 (0)

暂无评论,成为第一个分享想法的人!

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

Scrapling

by D4Vinci

🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl!

75,9137,581Python
MCP 服务器
查看详情

TrendRadar

by sansan0

⭐AI-driven public opinion & trend monitor with multi-platform aggregation, RSS, and smart alerts.🎯 告别信息过载,你的 AI 舆情监控助手与热点筛选工具!聚合多平台热点 + RSS 订阅,支持关键词精准筛选。AI 智能筛选新闻 + AI 翻译 + AI 分析简报直推手机,也支持接入 MCP 架构,赋能 AI 自然语言对话分析、情感洞察与趋势预测等。支持 Docker ,数据本地/云端自持。集成微信/飞书/钉钉/Telegram/邮件/ntfy/bark/slack 等渠道智能推送。

61,65224,883Python
MCP 服务器
查看详情

context7

by upstash

Context7 Platform -- Up-to-date code documentation for LLMs and AI code editors

61,0602,938TypeScript
MCP 服务器
查看详情

High-performance code intelligence MCP server. Indexes codebases into a persistent knowledge graph — average repo in milliseconds. 158 languages, sub-ms queries, 99% fewer tokens. Single static binary, zero dependencies.

39,9393,219C
MCP 服务器
查看详情

开发者还喜欢

基于喜欢此 Skill 的开发者投票和收藏

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI 智能体ai-agentsbrainstorming
查看详情

hermes-agent

by NousResearch

10

The agent that grows with you

234,43747,175Python
AI 智能体ai-agentsagent-orchestration
查看详情

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP 服务器apisai-tools
查看详情

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI 智能体ai-agentsanthropicclaude-code
查看详情

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI 智能体claude-codeai-tools
查看详情