Skip to content

Releases: Yaici-Yacine/mcp-logs

v0.1.1

06 Jan 22:00

Choose a tag to compare

🎉 MCP Logs v0.1.1 - Configuration System Complete

🚀 New Features

1. config set Command

Modify configuration values directly from CLI:

mcp-log-agent config set agent.verbose true
mcp-log-agent config set agent.connection_timeout 10
mcp-log-agent config set output.format plain
mcp-log-agent config set filters.min_level warn
mcp-log-agent config set agent.default_command '["npm", "run", "dev"]'

Supports all types: boolean, integer, string, enum, array

2. Field-by-Field Config Merging

True hierarchical config merging that preserves unset fields:

  • Local configs only override specified fields
  • Unset fields inherit from global config or defaults
  • Proper TOML table merging at file level
    Priority: ENV > Local > Global > Default

3. Extended Environment Variables

New environment variables for complete control:
Colors:

MCP_LOG_COLOR_ERROR_FG=bright_red
MCP_LOG_COLOR_WARN_FG=bright_yellow
MCP_LOG_COLOR_INFO_FG=cyan
MCP_LOG_COLOR_DEBUG_FG=bright_blue

Filters:

MCP_LOG_FILTER_MIN_LEVEL=warn

All settings:

  • Agent: socket_path, default_project, verbose, connection_timeout, retry_attempts
  • Output: colors, format, show_timestamps, show_pid
  • Performance: buffer_size, flush_interval

4. Partial Config Support

All structs now have serde defaults:

  • Create minimal configs with only the fields you need
  • Missing fields automatically use defaults
  • No need to specify every parameter

📦 Installation

Debian/Ubuntu (.deb package):

wget https://github.com/Yaici-Yacine/mcp-logs/releases/download/v0.1.1/mcp-log-agent_0.1.1-1_amd64.deb
sudo dpkg -i mcp-log-agent_0.1.1-1_amd64.deb

From source:

git clone https://github.com/Yaici-Yacine/mcp-logs.git
cd mcp-logs/log-agent
cargo install --path .

📚 Documentation

🐛 Bug Fixes

  • Improved config merging logic
  • Better error handling for config set command
  • Fixed TOML parsing for partial configs

🔧 Technical Details

Changes:

  • ~370 lines of code + documentation
  • 3 major features implemented
  • 9 test scenarios validated
  • Zero compilation warnings
    Files modified:
  • log-agent/src/config/loader.rs: Complete refactor
  • log-agent/src/config/types.rs: Serde defaults
  • log-agent/src/main.rs: Config set integration
  • Documentation updates across all READMEs

📝 Full Changelog

See log-agent/README.md#changelog for complete details.

Author: Yacine Yaici (@Yaici-Yacine)
License: MIT

v0.1.0

28 Dec 15:00

Choose a tag to compare

MCP Logs - Installation Guide

Prerequisites

  • Bun runtime (for MCP server)
  • Linux or macOS (Windows not supported yet)

Install Bun

curl -fsSL https://bun.sh/install | bash

Installation

Step 1: Install the Log Agent

Option A: From .deb package (Debian/Ubuntu)

# Download the package
wget https://github.com/Yaici-Yacine/mcp-logs/releases/download/v0.1.0/mcp-log-agent_0.1.0_amd64.deb

# Install
sudo dpkg -i mcp-log-agent_0.1.0_amd64.deb

# Verify installation
mcp-log-agent --version

Option B: From crates.io

cargo install mcp-log-agent

Option C: From source

git clone https://github.com/Yaici-Yacine/mcp-logs.git
cd mcp-logs/log-agent
cargo install --path .

Step 2: Install the MCP Server

# Using npm
npm install -g mcp-logs

# Or using bun
bun install -g mcp-logs

# Or using pnpm
pnpm install -g mcp-logs

Configuration

Step 3: Configure your MCP Client

Choose your client and add the configuration:

OpenCode

Edit ~/.config/opencode/mcp.json:

{
  "mcpServers": {
    "mcp-logs": {
      "command": "mcp-logs"
    }
  }
}

ou

{
  "mcpServers": {
    "mcp-logs": {
      "type": "local",
      "enabled": true,
      "command": ["bun","x","mcp-logs@latest"]
    }
  }
}

Claude Desktop

Edit the config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcp-logs": {
      "command": "mcp-logs"
    }
  }
}

Cline (VSCode Extension)

Edit VSCode settings.json:

{
  "cline.mcpServers": {
    "mcp-logs": {
      "command": "mcp-logs"
    }
  }
}

Step 4: Restart your MCP Client

Restart OpenCode, Claude Desktop, or VSCode to load the MCP server.


Usage

Capture logs from your application

# Basic usage
mcp-log-agent run --project my-app npm run dev

# Node.js project
mcp-log-agent run --project api npm start

# Rust project
mcp-log-agent run --project backend cargo run

# Python project
mcp-log-agent run --project ml-script python train.py

# Any shell command
mcp-log-agent run --project demo bash ./script.sh

Multiple projects simultaneously

Run multiple agents in separate terminals to monitor multiple projects:

# Terminal 1 - Frontend
mcp-log-agent run --project frontend npm run dev

# Terminal 2 - Backend
mcp-log-agent run --project backend cargo run

# Terminal 3 - API
mcp-log-agent run --project api python main.py

All logs are captured by the same MCP server and can be queried together.

Query logs via MCP

In your MCP client, you can ask in natural language:

Show me the recent logs
What errors occurred in my-app?
Search for "database" in the logs
List all connected projects
Show log statistics
What warnings happened in the last 5 minutes?

Available MCP Tools

Tool Description Parameters
get_recent_logs Get the most recent logs count (optional, max 500)
get_logs Advanced filtering project, level, source, search, limit
search_logs Text search across all logs query, project, limit
get_errors Get only error-level logs project, limit
get_stats Statistics about captured logs -
list_projects List all connected log agents -
clear_logs Clear all logs from memory -

Features

  • 🎨 Colorized logs: Errors in red, warnings in yellow, debug in blue
  • 🔍 Real-time search: Search logs as they arrive
  • 📊 Multi-project support: Monitor multiple projects simultaneously
  • 🚀 Zero configuration: Works out of the box
  • 🔌 Fast communication: Unix socket for minimal latency
  • 💾 In-memory storage: 10,000 logs max (FIFO)
  • 🎯 Automatic log level detection: Based on message keywords

Troubleshooting

"mcp-logs: command not found"

Ensure Bun is installed and in your PATH:

curl -fsSL https://bun.sh/install | bash
source ~/.bashrc  # or restart terminal

Verify Bun is accessible:

bun --version

"Socket not found" error

The MCP server must be running. It starts automatically when your MCP client (OpenCode, Claude Desktop, Cline) loads it based on the configuration in mcp.json.

Check that:

  1. The MCP server is configured correctly in your client's config file
  2. Your MCP client has been restarted after adding the configuration
  3. Bun is installed and accessible

Logs not appearing in MCP client

  1. Verify the MCP server is configured correctly
  2. Restart your MCP client completely
  3. Check that log-agent is running: mcp-log-agent run --project test echo "hello"
  4. Check for errors in your MCP client's logs/console

Permission denied on .deb installation

Use sudo for installation:

sudo dpkg -i mcp-log-agent_0.1.0_amd64.deb

"Failed to connect to socket" in log-agent

The MCP server might not be running. Make sure your MCP client (OpenCode, Claude Desktop, Cline) is running with the correct configuration.

If the error persists, the log-agent will still display logs in the terminal, but they won't be sent to the MCP server for querying.


Advanced Configuration

Change socket path

If you need to change the Unix socket path, edit the source files:

MCP Server (mcp-logs/src/server/index.ts):

export const SOCKET_PATH = "/tmp/log-agent.sock";

Log Agent (log-agent/src/socket.rs):

pub const SOCKET_PATH: &str = "/tmp/log-agent.sock";

Then rebuild both components.

Adjust log storage limit

Edit mcp-logs/index.ts:

const logStore = new LogStore(10000); // Change to desired limit

Enable verbose mode

For debugging, enable verbose logging in the MCP server:

{
  "mcpServers": {
    "mcp-logs": {
      "command": "bun",
      "args": ["run", "/path/to/mcp-logs/index.ts"],
      "env": {
        "VERBOSE": "true"
      }
    }
  }
}

Uninstall

Remove log-agent

From .deb:

sudo dpkg -r mcp-log-agent

From cargo:

cargo uninstall mcp-log-agent

Remove MCP server

# npm
npm uninstall -g mcp-logs

# bun
bun pm uninstall -g mcp-logs

# pnpm
pnpm uninstall -g mcp-logs

Remove MCP client configuration

Remove the mcp-logs entry from your MCP client's configuration file.


Getting Help


License

MIT License - see LICENSE file for details.

Author

Yacine Yaici - yaiciy01@gmail.com

v0.0.2

24 Dec 20:51

Choose a tag to compare

📦 Installation
Prérequis

Installer Bun (requis)

curl -fsSL https://bun.sh/install | bash
Installer les composants

1. CLI Rust

cargo install mcp-log-agent

2. Serveur MCP

bun install -g mcp-logs
🚀 Utilisation
Étape 1 : Démarrer le serveur
mcp-logs
Étape 2 : Capturer les logs

Syntaxe générale

mcp-log-agent run --project

Exemples

mcp-log-agent run --project frontend bun dev
mcp-log-agent run --project backend npm start
mcp-log-agent run --project api cargo run
mcp-log-agent run --project ml python train.py
Étape 3 : Analyser dans OpenCode/Claude
Configuration OpenCode (~/.config/opencode/opencode.json) :

{
  mcp: {
    mcp-logs: {
      type: local,
      enabled: true,
      command: ["mcp-logs"]
    }
  }
}

Commandes dans Claude/OpenCode :
Montre les 100 derniers logs
Cherche "error" dans les logs
Quelles sont les erreurs du projet "frontend" ?
Affiche les statistiques des logs
🔧 Test de connexion
mcp-log-agent test --message "Test connexion"