claude-sessions-mcp
The claude-sessions-mcp server manages Claude Code project sessions and chat history through MCP tools and a web interface.
Core Features:
Project Management: List all Claude Code projects with session counts
Session Operations: List, rename (via title prefixes), and delete sessions (safely moved to .bak folder for recovery)
Message Management: Delete individual messages with automatic UUID chain repair
Cleanup Operations: Preview and execute bulk cleanup to remove empty sessions, invalid API key sessions, and orphaned agent files
File Tracking: Get lists of files changed in sessions and view diff summaries with snapshot information
Web Interface: Start/stop a SvelteKit-based GUI (default port 5173) with auto-open browser, providing visual management of projects, sessions, conversation history, inline editing, and bulk cleanup operations
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@claude-sessions-mcp list my recent Claude Code sessions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-sessions-mcp
⚠️ DEPRECATED: This package has been replaced by claude-code-sessions.
Please migrate to the new package:
npm uninstall claude-sessions-mcp npm install claude-code-sessions
MCP (Model Context Protocol) server and Web UI for managing Claude Code sessions.
Features
Project Listing: Browse Claude Code project folders
Session Management: List, rename, and delete sessions
Message Management: View and delete messages within sessions
Cleanup: Clear empty sessions and remove invalid API key messages
Web UI: SvelteKit-based web interface
Related MCP server: Claude Orchestrator MCP
Installation
# Using npx (recommended)
npx claude-sessions-mcp
# Or install globally
npm install -g claude-sessions-mcpUsage
Claude Code MCP Integration
Add to Claude Code:
claude mcp add claude-sessions -- npx claude-sessions-mcpOr manually edit ~/.claude.json:
{
"mcpServers": {
"claude-sessions": {
"command": "npx",
"args": ["claude-sessions-mcp"]
}
}
}Web GUI
Launch the web interface via MCP tool (from Claude Code):
> Use the start_gui tool to launch web interfaceThe GUI opens at http://localhost:5050 with features:
Browse all projects and sessions
View full conversation history
Rename sessions with inline editing
Delete unwanted sessions
Bulk cleanup of empty sessions
Development
# Enable corepack
corepack enable
# Install dependencies
pnpm install
# Start web development server
pnpm dev
# MCP server development mode
pnpm dev:mcpBuild
pnpm buildMCP Server Tools
Available Tools
Tool | Description |
| List Claude Code projects |
| List sessions in a project |
| Rename a session |
| Delete a session (moves to backup folder) |
| Delete a message and repair UUID chain |
| Preview sessions to be cleaned |
| Clear empty sessions and invalid messages |
| Start the web UI |
| Stop the web UI |
Tech Stack
MCP Server: Node.js + TypeScript + Effect
Web UI: SvelteKit + Svelte 5
Build: tsup (MCP), Vite (Web)
Package Manager: pnpm (corepack)
Effect-TS Patterns
This project uses Effect for functional async operations:
import { Effect, pipe, Array as A, Option as O } from 'effect'
// Define an Effect (lazy, composable)
const listProjects = Effect.gen(function* () {
const files = yield* Effect.tryPromise(() => fs.readdir(dir))
return files.filter((f) => f.endsWith('.jsonl'))
})
// Parallel execution with concurrency control
const results =
yield *
Effect.all(
items.map((item) => processItem(item)),
{ concurrency: 10 }
)
// Option for nullable values
const title = pipe(
messages,
A.findFirst((m) => m.type === 'user'),
O.map((m) => extractTitle(m)),
O.getOrElse(() => 'Untitled')
)
// Run in SvelteKit endpoint
export const GET = async () => {
const result = await Effect.runPromise(listProjects)
return json(result)
}License
MIT
Available Tools
12 toolsclear_sessionsB
Delete all empty sessions and invalid API key sessions
Inputs: project_name, clear_empty, clear_invalid, clear_orphan_agents.
delete_messageC
Delete a message from a session and repair the parentUuid chain
Inputs: project_name (required), session_id (required), message_uuid (required).
delete_sessionB
Delete a session (moves to .bak folder for recovery)
Inputs: project_name (required), session_id (required).
get_session_diffC
Get diff summary for a session including file changes and snapshot info
Inputs: project_name (required), session_id (required).
get_session_filesB
Get list of all files changed in a session (from file-history-snapshot and tool_use)
Inputs: project_name (required), session_id (required).
list_projectsB
List all Claude Code projects with session counts
Inputs: no named parameters.
list_sessionsC
List all sessions in a project
Inputs: project_name (required).
preview_cleanupC
Preview sessions that would be cleaned (empty and invalid API key sessions)
Inputs: project_name.
rename_sessionC
Rename a session by adding a title prefix to the first message
Inputs: project_name (required), session_id (required), new_title (required).
split_sessionB
Split a session at a specific message, creating a new session with messages from that point onwards
Inputs: project_name (required), session_id (required), message_uuid (required).
start_guiB
Start the web GUI for session management and open it in browser
Inputs: port, open_browser, restart.
stop_guiB
Stop the web GUI server
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have clearly distinct purposes targeting different session management operations, with good separation between listing, deletion, modification, and GUI control. However, clear_sessions and preview_cleanup have some conceptual overlap around session cleanup, though their descriptions clarify that one previews while the other executes.
All tools follow a consistent verb_noun naming pattern with snake_case throughout. The verbs are appropriately descriptive (list, get, delete, rename, split, start, stop) and consistently applied to their respective nouns (sessions, projects, messages, GUI).
12 tools is well-scoped for a session management system, covering core operations without bloat. Each tool serves a distinct purpose in the session lifecycle from creation/listing to modification/deletion, with GUI management as a logical extension.
The toolset provides comprehensive coverage of session management including CRUD operations (list, delete, rename), content manipulation (delete_message, split_session), and analysis (get_session_diff, get_session_files). The main gap is the lack of a tool to create new sessions, though agents could work around this by using the GUI or external methods.
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
MCP server for AI dialogue using various LLM models via AceDataCloud
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
An MCP server that provides an API to LLMs to manage their JumpCloud resources.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP Memory Server for Claude Code that provides persistent context across sessions using semantic search (RAG).Apache 2.0
- AlicenseAqualityFmaintenanceAn MCP server for coordinating multiple Claude Code sessions across related projects.11MIT
- AlicenseAqualityDmaintenanceMCP server for orchestrating multiple Claude Code instances via tmux, enabling spawning, reading, sending, listing, and killing sessions.519 npm2MIT
- AlicenseNot gradedqualityDmaintenanceA flexible MCP server enabling multiple Claude AI sessions to coordinate work across machines through shared state management.1MIT