Skip to content

nrpog/log-mcp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Local Log Server - MCP Implementation

A TypeScript-based Node.js MCP (Model Context Protocol) server that exposes local log file access tools.

Features

  • list_logs - List available log files in a directory
  • read_log - Read a section of a log file with optional filtering
  • search_logs - Search a log file for matching patterns

Quick Start

1. Install Dependencies

npm install

2. Configure Log Directory

Edit src/server.ts and change LOG_ROOT to your desired log directory:

const LOG_ROOT = "/var/log"; // change to your log directory

3. Build and Start the Server

Build the TypeScript:

npm run build

Start the server:

npm start

Or for development with auto-reload:

npm run dev

Usage Examples

Once connected to an MCP client (like Claude Desktop), you can use:

  • "Show me all error logs from yesterday" → search_logs
  • "Open the last 200 lines of server.log" → read_log
  • "List all logs in /var/log/myapp" → list_logs

Configuration

VS Code Integration

The .vscode/mcp.json file contains the configuration for running this MCP server:

{
  "servers": {
    "local-log-server": {
      "type": "stdio",
      "command": "node",
      "args": ["server.js"]
    }
  }
}

Requirements

  • Node.js 18.0+
  • @modelcontextprotocol/sdk

Documentation

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors