No description
Find a file
autocommit 2aa788f58e
Some checks failed
Build and Publish / build-and-publish (push) Failing after 41s
deps-upgrade(dependencies): ⬆️ Update all dependencies to latest stable versions for bug fixes, performance, and new features
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-06-11 01:22:10 -07:00
.forgejo/workflows fix(ci): fix backslash-bang syntax error in workflow 2026-01-30 15:49:41 -08:00
node_modules deps-upgrade(sdk): ⬆️ Update @modelcontextprotocol/sdk, @lilith/ml-provider-clients, and @types/node to latest versions 2026-04-19 18:49:11 -07:00
src chore: initial commit 2026-01-21 11:37:37 -08:00
.gitignore chore(gitignore): Add missing patterns 2026-01-22 11:09:17 -08:00
package.json deps-upgrade(dependencies): ⬆️ Update all dependencies to latest stable versions for bug fixes, performance, and new features 2026-06-11 01:22:10 -07:00
README.md chore: trigger CI publish 2026-01-30 11:56:04 -08:00
tsconfig.json chore: initial commit 2026-01-21 11:37:37 -08:00
tsup.config.ts chore(build): 🔧 Update tsup config for optimized bundle performance with minification & tree-shaking 2026-01-21 15:31:00 -08:00

@lilith/mcp-session-analyzer

MCP server for ML-powered analysis of Claude Code session transcripts.

Features

  • list_sessions - Browse recent sessions from Claude's history
  • search_sessions - Search across all transcripts using regex patterns
  • analyze_session - Full ML-powered analysis (summary, sections, topics, evaluation)
  • summarize_session - Quick summary generation with style options
  • get_session_topics - Extract topic changes and discussion flow

Installation

pnpm add @lilith/mcp-session-analyzer

Configuration

Add to ~/.claude/mcp-config.json:

{
  "mcpServers": {
    "session-analyzer": {
      "command": "node",
      "args": ["/path/to/mcp-session-analyzer/dist/index.js"]
    }
  }
}

Requirements

  • Local Llama service running on port 41221 (lilith-llama-service)
  • ripgrep (rg) installed for search functionality

Data Sources

The server reads from Claude's native storage:

  • ~/.claude/history.jsonl - Session index
  • ~/.claude/projects/{escaped-path}/{sessionId}.jsonl - Full transcripts

Tools

list_sessions

Browse recent Claude Code sessions.

list_sessions({
  project?: string,  // Filter by project path
  limit?: number,    // Max results (default: 20)
  since?: string,    // ISO date filter
})

search_sessions

Search across all transcripts using ripgrep.

search_sessions({
  query: string,     // Regex pattern
  project?: string,  // Filter by project
  limit?: number,    // Max matches (default: 50)
})

analyze_session

Full ML-powered session analysis.

analyze_session({
  sessionId: string,
  provider?: 'llama' | 'claude' | 'openai',  // Default: llama
})

// Returns:
interface SessionAnalysis {
  summary: string;
  sections: ConversationSection[];
  topics: TopicChange[];
  evaluation: ConversationEvaluation;
  keyDecisions: string[];
  filesModified: string[];
  toolsUsed: string[];
}

summarize_session

Quick summary generation.

summarize_session({
  sessionId: string,
  style?: 'brief' | 'detailed' | 'bullet-points',
})

get_session_topics

Extract topic flow from a session.

get_session_topics(sessionId: string)

// Returns:
interface SessionTopics {
  mainTopics: string[];
  topicFlow: TopicChange[];
  timeOnTopic: { topic: string; lines: number }[];
}

Caching

Analysis results are cached in ~/.local/share/claude/mcp/cache/session-analyzer/ for 24 hours.

Dependencies

  • @lilith/mcp-common - Shared MCP utilities
  • @lilith/ml-provider-clients - LLM provider clients
  • @modelcontextprotocol/sdk - MCP framework

License

MIT