Auto-detects project context from git repositories, including changed files from git status, staged/unstaged changes, and recent commits for session summaries and project organization.
Provides high-performance log storage and search capabilities using SQLite with FTS5 full-text search, enabling structured logging, process tracking, and real-time log analysis for console applications.
Console MCP Server
An MCP (Model Context Protocol) server that provides a bridge between external console processes and Copilot through SQLite-based log storage and search capabilities.
π Key Features
High-Performance SQLite Storage
10-100x faster searches with indexed queries and FTS5 full-text search
Reduced memory usage with streaming results instead of loading entire files
Better concurrency with SQLite WAL mode for simultaneous read/write operations
Scalable architecture handles large log volumes efficiently
Console Logger
Wraps any command and captures stdout/stderr to structured SQLite database
Real-time log storage with proper indexing
Automatic log level detection (info, warn, error, debug)
Process lifecycle tracking with start/end times and exit codes
MCP Server Tools
search_logs- Full-text search through all console logs using FTS5get_recent_errors- Get recent error messages from all processeslist_processes- List all processes with their status and activitytail_process_logs- Get latest entries from a specific processget_log_summary- Get aggregated statistics across all processesprune_old_logs- Remove old console logs to free up space (with dry-run support)get_log_statistics- Get database statistics including size and age information
π Installation
There are several ways to install and use the Console MCP tools:
Option 1: Global npm Installation (Recommended)
Install globally to use console-logger and console-mcp from any directory:
After global installation, you can use the tools from any terminal session:
Option 2: Local Installation with PATH
Add the built binaries to your PATH for the current session or permanently:
Option 3: Shell Aliases
Create convenient shell aliases for the tools:
Option 4: Local Development
For development or testing without global installation:
Quick Setup Script
For the fastest setup, you can use this one-liner:
Or create a setup script:
Make it executable and run:
Verification
Test that the installation works:
π Updating
Updating Global Installation
If you have the Console MCP installed globally and want to update to the latest version:
Or use the full command:
Quick Update Script
You can also use the convenience script added to package.json:
Both scripts do the same thing: build the project and install it globally.
Verifying the Update
After updating, verify the new version is active:
Automatic Update Detection
The console-logger includes automatic update detection that warns when a newer version is available:
How it works:
Compares build timestamps between your global installation and local project
Only shows warnings when genuinely outdated (not during development)
Provides clear update instructions
Never blocks operation - warnings are informational only
Update detection triggers when:
You have a global installation that's older than your local build
You're working on console_mcp improvements and haven't updated globally
Someone else updated the project and you need to pull + update
Dependencies
better-sqlite3- High-performance SQLite3 bindings@modelcontextprotocol/sdk- MCP protocol implementation
π Usage
1. Start Console Logger
Wrap any command to capture its output to the SQLite database:
Simple Commands
Complex Commands with Shell Operators
The console-logger automatically detects and supports complex shell commands:
Shell Mode Features:
π Auto-detection: Automatically detects shell operators (
&&,||,;,|,eval,cd, etc.)π Environment preservation: Maintains all environment variables and shell features
π Full logging: Captures output from all commands in the pipeline
β‘ Efficient: Simple commands still use direct execution for better performance
Help and Options
Get help for either tool:
Environment Variables
CONSOLE_LOG_DIR- Directory for SQLite database (default:~/.console-logs)CONSOLE_LOG_MAX_AGE_HOURS- Auto-prune logs older than this many hours (default: 336 = 2 weeks)
Example:
2. Use MCP Server
The MCP server provides tools to search and analyze the captured logs:
Log File Structure
Each log entry is a JSON object:
Using the MCP Server
The MCP server provides tools that Copilot can use to search and analyze your logs:
Search logs: Find specific text across all log files
Get recent errors: Quickly identify recent error messages
List processes: See all processes that have logs
Tail logs: Get the latest entries from a specific process
Get summary: Overview of log activity across all processes
Configuration
Environment Variables
CONSOLE_LOG_DIR- Directory to store log files (default:./console_logs)
π Session Summaries
The Console MCP server now includes powerful session summary capabilities that allow Copilot sessions to store and search context across different VS Code instances and sessions.
Creating Session Summaries
Session summaries capture important information about your development sessions:
Auto-Detection Features
The session summary system automatically detects:
Project name from
package.jsonor git repository nameChanged files from git status (unstaged, staged, and recent commits)
Git repository context for better organization
Searching Session Summaries
Use the MCP tools to find relevant context from previous sessions:
search_session_summaries- Full-text search across titles, descriptions, and tagsget_session_summaries_by_project- Find all summaries for a specific projectget_session_summaries_by_tags- Filter by specific tags like "bug-fix" or "feature"get_recent_session_summaries- Get recent development activity
Use Cases
Cross-Session Context: When starting work on a project, search for related summaries to understand recent changes
Team Collaboration: Share development insights and lessons learned
Project Documentation: Maintain a searchable history of development decisions
Debugging: Find similar issues and solutions from previous sessions
MCP Configuration
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):
Examples
Example 1: Monitor a Development Server
Example 2: Debug Multiple Services
Example 3: Build Process Monitoring
Development
Building
Running the MCP Server
Running the Console Logger
Architecture
Benefits
Non-intrusive: Your existing commands work exactly the same
Real-time: See output immediately while logging in background
Structured: Searchable JSON format with metadata
AI-powered: Ask Copilot natural language questions about your logs
Multi-process: Monitor multiple services simultaneously
Persistent: Logs are saved and can be analyzed later
Troubleshooting
Permissions
If you get permission errors, make sure the scripts are executable:
Log Directory
If logs aren't being created, check that the log directory is writable:
MCP Connection
If the MCP server isn't connecting to Claude Desktop:
Check the absolute path in your MCP configuration
Ensure the project is built (
npm run build)Restart Claude Desktop after configuration changes
π§ Troubleshooting
Global Installation Issues
If console-logger or console-mcp commands are not found after global installation:
Check npm global bin directory:
npm config get prefix npm bin -gEnsure global bin directory is in PATH:
echo $PATH # Should include your npm global bin directoryAdd npm global bin to PATH if missing:
# Add to ~/.zshrc or ~/.bashrc export PATH="$PATH:$(npm bin -g)" source ~/.zshrcAlternative: Use npx (no global install needed):
npx /path/to/console_mcp/build/logger.js "my-app" npm start
Permission Issues
If you get permission errors during global installation:
Database Location
By default, logs are stored in ~/.console-logs/. To check or change:
Shell Integration Tips
For an even better experience, consider these shell enhancements:
Create shell functions for common patterns:
# Add to ~/.zshrc or ~/.bashrc # Function to easily start dev servers with logging dev-with-logs() { local name="${1:-dev-server}" shift console-logger "$name" "$@" } # Function to tail logs for a process logs() { local process="$1" console-mcp tail_process_logs --process="$process" } # Function to search recent logs search-logs() { console-mcp search_logs --query="$1" --limit=20 }Quick aliases for common commands:
alias clog='console-logger' alias cmcp='console-mcp' alias show-logs='ls -la ~/.console-logs/'Usage examples with shell functions:
# Start development server with logging dev-with-logs "my-app" npm run dev # Search for errors search-logs "error" # View logs for specific process logs "my-app"
License
ISC