home / mcp / console mcp server

Console MCP Server

Provides a bridge between console processes and Copilot with SQLite-backed log storage and rich search capabilities.

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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.

Configuration and usage notes

The server stores logs in a dedicated directory and provides pruning and statistics features. Environment variables control log location and log retention window.

Environment variables

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)

Examples

Start logging a development server and then query the collected logs from Copilot or the MCP client.

Troubleshooting

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.

Notes on session usage and tooling

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.

Developer notes

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.

Available tools

search_logs

Full-text search through all console logs using FTS5 to quickly locate relevant messages across processes.

get_recent_errors

Retrieve recent error messages from all tracked processes to help identify failures.

list_processes

List all processes with their status and recent activity to understand the logging landscape.

tail_process_logs

Get the latest log entries for a specific process to monitor ongoing activity.

get_log_summary

Provide aggregated statistics across all processes to see overall logging trends.

prune_old_logs

Remove logs older than a specified retention window with dry-run support to forecast changes.

get_log_statistics

Return database statistics including size and age information for maintenance planning.