
Logmcp
io.github.kascada由 GitHub 帳號 kascada 發布v0.7.7更新於 Oct 25, 2026
MCP server — read-only log access for AI assistants, without giving AI shell access.
概覽
一個本機 MCP 伺服器,讓 AI 助理以唯讀、權杖驗證的方式存取 Linux 伺服器上的日誌檔案與 systemd journal,無需 shell 權限。
- 可以做什麼
- 列出伺服器設定為可存取的日誌檔案(包含作為虛擬日誌來源的 journald),並顯示檔案大小、行數與最後修改時間等中繼資料。依開頭、結尾、位移量或時間區間讀取日誌行,並以正規表示式搜尋日誌,可附上上下文行與時間篩選。執行伺服器端健康檢查(設定、TLS、白名單、syslog),並顯示目前設定以及 MCP 層與已註冊擴充功能的執行狀態。使用透過擴充功能加入的額外工具,這些擴充功能可包裝外部 CLI 程式或以 Redis 為基礎的 worker,也可使用 YAML 定義的組合巨集工具。
- 適用情境
- 適合需要以 AI 輔助排查 Linux 伺服器日誌、但不想給助理 SSH 或 shell 權限的情境,例如正式環境伺服器、客戶機器或強調最小權限的加固環境。
- 執行需求
- 以本機程序在使用者機器上執行(僅桌面端),連線到 Linux 主機上的 LogMCP 伺服器。伺服器端需要 logmcp 執行檔或 .deb 套件、bearer 權杖,以及 TLS(自簽憑證、自訂憑證或置於反向代理之後)或 SSH 通道。存取日誌檔案需要隸屬於 adm 或 systemd-journal 等群組;設定位於 YAML 檔案中,可引用環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Logmcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
LogMCP
[License: MIT] [logmcp MCP server]
MCP server — read-only log access for AI assistants. Debug your Linux server with AI, without giving the AI shell access.
No SSH. No write permissions. The AI reads your logs over HTTPS and helps you diagnose problems, while your server stays fully under your control.
LogMCP is an open-source MCP server that exposes log files on a remote Linux server to AI assistants (Claude Code, VS Code, Claude Desktop). Access is read-only, token-authenticated, and fully audited via syslog.
Get Started
Option A: Quickstart (no root required)
Try LogMCP in under a minute — no config file, no root, no systemd:
The command checks your group memberships (adm, systemd-journal), generates a bearer token and a self-signed TLS certificate, starts the server, and prints a ready-to-paste claude mcp add command.
Running as root? Pass --user <name> and LogMCP will add the user to the required groups and re-launch as that user — root is not needed for future starts.
Note: Token and certificate are ephemeral. The token changes on every start. For a permanent setup use Option B.
After testing, remove the server from Claude Code:
Option B: Permanent installation (recommended)
1. Install
Or install the pre-built .deb (replace x.y.z with the latest version):
2. Run the setup wizard
Guides you through TLS mode, bearer token, and systemd service — then prints a ready-to-paste client config snippet.
3. Add to your AI client
Paste the output into your MCP client config. Done — your AI can now read the server's logs.
The Key Advantage: Let the AI Debug Without Touching Your Server
You give the AI a read-only window into your logs. That's it.
- No SSH access required — the AI connects like any HTTPS client
- No write permissions — the AI cannot change, delete, or execute anything
- No shell access — not even read access beyond the whitelisted log paths
- Works from anywhere — your laptop, Claude Desktop, a remote CI agent
- Every access is audited via syslog on the server
This makes LogMCP ideal for situations where you need AI-assisted debugging but cannot or do not want to grant shell access: production servers, customer machines, hardened environments, or any setup where least-privilege matters.
SSH is also supported. If your AI client is Claude Code running locally with an SSH key, you can use LogMCP over an SSH tunnel instead of a public HTTPS endpoint. See SSH Tunnel Setup below.
Features
- Read-only access to log files — the AI cannot modify anything
- Whitelist/blacklist glob patterns for fine-grained access control
- systemd journal (
journald://) as a virtual log source - Multi-token auth — per-client bearer tokens with revocation
- External authenticator support — delegate token verification to any CLI program
- TLS support: self-signed, custom cert, or behind Caddy reverse proxy
- Audit trail via syslog (access only, no log content)
- Guided interactive setup wizard
- Systemd service integration
- Extensions — expose external CLI tools or Redis-RPC workers as additional MCP tools
- Macros — define composite MCP tools as YAML files, no code required
- fail2ban integration and in-process rate limiting
Setup Details
The wizard (sudo logmcp setup) covers:
- Deployment mode (direct TLS or behind Caddy)
- Port and bearer token configuration
- Systemd service installation
- Client configuration snippets for Claude Code, VS Code, and Claude Desktop
Whitelist/blacklist and journald are configured directly in /etc/logmcp/config.yaml after setup.
Environment variable substitution
Any value in config.yaml can reference environment variables using ${VAR} or $VAR syntax. The substitution happens before the file is parsed, so it works everywhere — tokens, paths, DSNs, etc.
Unset variables expand to an empty string. To keep a literal $ in a value, use $$.
After setup, start the server:
Commands
MCP Tools
These are the tools LogMCP exposes to AI assistants:
Extensions may add further tools — their names are prefixed with the extension name (e.g. myapp_status for an extension named myapp).
Extensions — Wrapping External Tools as MCP
LogMCP can expose any external program or service as additional MCP tools — no custom MCP server required. The AI sees them alongside the built-in log tools.
CLI extension
Any program that implements the clitool interface (list / call subcommands) can be registered. LogMCP calls <command> list at startup to discover tools, and forwards each tool call to <command> call <tool> --token-stdin.
This spawns a subprocess per call — suitable for any program on the same or a remote host.
RPC extension (Redis)
For programs running on the same host, the RPC variant avoids the per-call process-startup overhead (relevant for Python programs where interpreter startup and imports add noticeable latency). Instead of spawning a subprocess, LogMCP pushes a request onto a Redis list and waits for the worker's reply.
The worker reads requests from a Redis list and pushes its reply to a per-request reply key. See docs/RPC.md for the full protocol.
Auth flow
The bearer token from each incoming MCP request is forwarded to the extension — either via stdin (CLI mode) or as caller metadata in the RPC envelope. The extension can verify it or trust the pre-resolved identity.
Case Studies
Real-world scenarios where LogMCP makes the difference — see docs/case-studies.md:
- Asterisk/VoIP — Paket-Kompilierung und Abhängigkeitsfehler debuggen
- Webserver mit Caddy Reverse Proxy — produktive Installation
- Standalone-Betrieb mit eigenem TLS
SSH Tunnel Setup
If you are using Claude Code locally and already have SSH access to the server, you can run LogMCP without a public HTTPS endpoint:
LogMCP still requires a bearer token over the tunnel — the SSH layer adds transport security, the token controls which client can connect.
License
MIT License — see LICENSE.
來源:README.md,提交 672c2fe
工具
0版本歷史
1- v0.7.7最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分

