A TypeScript-based Node.js MCP (Model Context Protocol) server that exposes local log file access tools.
- 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
npm installEdit src/server.ts and change LOG_ROOT to your desired log directory:
const LOG_ROOT = "/var/log"; // change to your log directoryBuild the TypeScript:
npm run buildStart the server:
npm startOr for development with auto-reload:
npm run devOnce 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
The .vscode/mcp.json file contains the configuration for running this MCP server:
{
"servers": {
"local-log-server": {
"type": "stdio",
"command": "node",
"args": ["server.js"]
}
}
}- Node.js 18.0+
- @modelcontextprotocol/sdk
MIT