home / mcp / console mcp server
Provides a bridge between console processes and Copilot with SQLite-backed log storage and rich search capabilities.
Configuration
View docs{
"mcpServers": {
"bvelasquez-console_mcp": {
"url": "https://mcp.example.com/mcp",
"headers": {
"CONSOLE_LOG_DIR": "~/.console-logs",
"CONSOLE_LOG_MAX_AGE_HOURS": "336"
}
}
}
}You run a Console MCP Server to bridge external console processes with Copilot, storing logs in an optimized SQLite database for fast search and analysis. This setup lets you capture stdout and stderr from your commands, search through logs with full-text capabilities, and query aggregated log statistics to understand activity across multiple processes, all while keeping memory usage efficient and enabling concurrent access.
Start by launching the MCP server in your environment. You can then wrap any command with the console logger to capture its output, and use the MCP tools to search, tail, and summarize logs from multiple processes. The workflow is practical for monitoring development servers, build pipelines, or any multi-process setup. Use the MCP client to issue searches, retrieve recent errors, list active processes, tail logs for a given process, or obtain a summary of log activity across all processes.
Prerequisites: Node.js is required to build and run the Console MCP server and tools.
1) Clone the repository and navigate into the project directory.
2) Install dependencies and build the project.
3) Install the package globally so you can run the tools from anywhere.
4) Verify installation by checking help for each tool.
5) Start the MCP server and begin logging your commands.
The server stores logs in a dedicated directory and provides pruning and statistics features. Environment variables control log location and log retention window.
CONSOLE_LOG_DIR β Directory for the SQLite database that stores logs (default: ~/.console-logs) CONSOLE_LOG_MAX_AGE_HOURS β Auto-prune logs older than this many hours (default: 336, i.e., 2 weeks)
Start logging a development server and then query the collected logs from Copilot or the MCP client.
If you encounter permission or path issues, ensure the script binaries are executable and that the log directory is writable. Restart the MCP server after configuration changes.
In addition to logging individual commands, you can perform full-text searches, retrieve recent errors, list processes, tail logs for a specific process, and obtain aggregated log statistics using the MCP tools.
When you run the MCP server locally, ensure you start it with the runtime that points to the built index. If you modify code, rebuild before starting the server again.
Full-text search through all console logs using FTS5 to quickly locate relevant messages across processes.
Retrieve recent error messages from all tracked processes to help identify failures.
List all processes with their status and recent activity to understand the logging landscape.
Get the latest log entries for a specific process to monitor ongoing activity.
Provide aggregated statistics across all processes to see overall logging trends.
Remove logs older than a specified retention window with dry-run support to forecast changes.
Return database statistics including size and age information for maintenance planning.