VibeDoctor
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., "@VibeDoctor revert last change"
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.
VibeDoctor 🩺 v2.0
Your Claude Code CLI Development Companion - An MCP server that intelligently reverts Claude Code CLI changes by analyzing conversation JSONL files. Automatically finds active sessions and reverts file modifications using structured patch data.
✨ Features
🎯 Auto Session Detection: Automatically finds your active Claude Code session by analyzing your message
🔄 Smart Revert Logic: Intelligently reverts both additions and deletions
📁 Session Integration: Works directly with your Claude Code CLI sessions
🏷️ Sequential Operations: Handles multiple revert commands with perfect state tracking
🔢 Flexible Count: Revert last 1, 2, 3... up to 10 changes in one command
📍 Correct Working Directory: Uses the exact working directory from your Claude Code session
🔒 Precise Reverts: Accurately identifies and reverts specific changes
⚡ Claude Code CLI Integration: Works exclusively with Claude Code CLI sessions
Related MCP server: mcp-session-insight
🚀 Installation
Via npm (Recommended)
npm install -g vibedoctorManual Installation
git clone https://github.com/pathakmukul/vibe-doctor.git
cd vibe-doctor
npm install
npm link⚙️ Setup
1. Add to Claude Code CLI
Add VibeDoctor to your Claude Code CLI using the built-in MCP management:
claude mcp add-json "vibedoctor" '{"command":"vibedoctor","args":[]}'2. Alternative: Manual Configuration
If you prefer manual configuration, you can also add it to other MCP-compatible clients:
{
"mcpServers": {
"vibedoctor": {
"command": "vibedoctor",
"args": []
}
}
}🎯 Usage
Natural Language Commands (Recommended)
revert last 2 changes
undo the last 3 operations
revert last change
fix my last mistake
undo that last update
revert the most recent 4 changesExplicit VibeDoctor Calls
use VibeDoctor to revert last 2
VibeDoctor revert 3 operations
vibedoctor undo last change
call VibeDoctor to fix last 5 changes
run VibeDoctor revert last operation
use vibedoctor to undo last 3 updates🔧 How It Works
VibeDoctor intelligently analyzes your Claude Code CLI session to identify and revert recent changes. Simply ask it to revert your last changes, and it handles the rest automatically.
📋 Supported Operations
✅ Pure Additions (only
+lines) → Deletes added content✅ Pure Deletions (only
-lines) → Restores removed content✅ Mixed Changes (both
+and-) → Deletes additions AND restores deletions✅ Sequential Reverts → "revert 2 more" works correctly with state tracking
🎨 Example Workflow
# 1. Install VibeDoctor in Claude Code CLI
$ claude mcp add-json "vibedoctor" '{"command":"vibedoctor","args":[]}'
# 2. Make changes with Claude Code CLI
> add emoji to each section @index.html
# 3. Claude Code makes changes
⏺ Update(index.html) - adds emojis
# 4. Revert if needed
> revert last change
# 5. Works! Emojis are removed
✅ Successfully reverted last 1 changes. [VIBEDOCTOR CHANGES: 1]
Session: d9e3caf1-0ca2-490d-b914-012e952193fe
Working Directory: /Users/username/projects/myproject🔍 Advanced Features
State Tracking
VibeDoctor automatically tracks what's been reverted:
> revert last 2 # Reverts operations 1-2
> revert 2 more # Reverts operations 3-4 (not 1-2 again!)Conversation History Integration
Seamlessly integrates with your session history for accurate tracking.
🐛 Troubleshooting
"Could not find Claude Code session"
Make sure you're running this from the same Claude Code CLI session where you made changes
Verify your message contains the keywords you're trying to revert
"No changes found to revert"
Ensure Claude Code CLI has made file modifications in this session
Verify you haven't already reverted all available changes
"File not found"
The working directory from Claude Code CLI session may differ from current directory
Files may have been moved or deleted since the changes were made
"Line out of range"
Files may have been modified outside Claude Code CLI between changes and revert
Manual review may be needed for complex changes
🏗️ Technical Details
Platform: Node.js 18+
Protocol: Model Context Protocol (MCP)
Dependencies:
@modelcontextprotocol/sdkProcessing: Pure JavaScript with shell command integration
📄 License
MIT License - See LICENSE file for details.
🤝 Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
📝 Note
VibeDoctor is designed specifically for Claude Code CLI and will not work with other Claude interfaces (web, desktop app, etc.).
🙋 Support
GitHub Issues: Report bugs or request features
GitHub Discussions: Ask questions or share tips
VibeDoctor - Keeping your code healthy, one revert at a time 🩺✨
Available Tools
1 toolrevert_last_changesB
Intelligently reverts the last N changes made by Claude Code CLI by analyzing conversation JSONL files. Automatically finds the active session and reverts file modifications using structured patch data.
Inputs: count, user_message, conversation_history.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool exposed, there is no possibility of confusion or misselection. The single tool's purpose—reverting the last N changes from a Claude Code session—is clearly stated and unmistakable.
The lone tool follows a clean snake_case verb_noun convention (revert_last_changes). There is no competing convention to create inconsistency, and the name is descriptive and predictable.
A single tool is thin for the apparent domain; there is no way to list revertable changes, preview a revert, or redo. The narrow scope (undo recent edits) makes one tool defensible, but the surface feels minimal rather than well-scoped.
The tool can only perform a blind revert of the last N changes; there is no dry-run/preview, no listing of what is revertable, no redo, and no session-selection option. These are significant gaps that could cause an agent to revert the wrong changes with no way to inspect state first.
Maintenance
Related MCP Connectors
Sync coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Your own computer's files from ChatGPT or Claude: folder rules, confirmations and undo.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Path-scoped team memories, rules and skills for Claude Code, Cursor, Codex and other MCP clients.
Related MCP Servers
- AlicenseAqualityDmaintenanceA smart, checkpoint‑based undo system for Claude Code. Automatically snapshots file states before modifications, deduplicates unchanged checkpoints, and enables lightning‑fast restoration so you can experiment confidently with AI‑driven edits.513MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query and analyze past Claude Code sessions, providing structured insights like file changes, decisions, errors, and git history across projects.111MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to develop within a local project workspace by reading and modifying files, running commands and tests, checking Git state, and persisting progress as history sessions that can be restored in later conversations.Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables coding agents and their users to roll back unwanted file changes by recording workspace state before, during, and after a turn and restoring it selectively. It supports undoing, redoing, and diffing turns across Claude Code, Codex, Gemini CLI, Cursor, OpenCode, and Antigravity CLI.67 npm1MIT