[WordPress] 外掛分享: MCP Logs

首頁外掛目錄 › MCP Logs
WordPress 外掛 MCP Logs 的封面圖片
全新外掛
安裝啟用
尚無評分
30 天前
最後更新
問題解決
WordPress 6.9+ PHP 7.4+ v1.1.0 上架:2026-05-10

內容簡介

MCP Logs 外掛能夠記錄所有來自 AI 代理的請求,並提供詳細的請求與回應紀錄,讓使用者能夠追蹤與管理這些互動。透過即時警報與檢測規則,確保網站安全並維持完整的審計紀錄。

【主要功能】
• 實時記錄每個 MCP 請求的詳細資訊
• 設定檢測規則以監控請求流量
• 提供搜尋與過濾功能以便查詢紀錄
• 支援一鍵關閉所有 MCP 存取權限
• 發送 HTML 郵件警報以通知異常請求
• 具備完整的 REST API 供開發者使用

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「MCP Logs」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

AI agents talk to WordPress sites directly now. Claude, ChatGPT, Cursor, and a growing list of MCP clients can connect to your site, read content, place orders, edit posts, or call any custom tool you expose. The Model Context Protocol (MCP) is the open standard that makes this possible.
The problem is that by default you cannot see any of it. Requests arrive, things change, and there is no record of what an agent did, when it did it, or which user it acted as.
MCP Logs writes a row for every MCP request the moment it hits your site. You get the route, the ability that was called, the user it acted as, the request body, the response, and whether it succeeded. All of it is browsable in a React admin page built with @wordpress/components, so it looks and behaves like the rest of WordPress.
Version 1.1.0 adds the other half: detection rules that watch the traffic as it arrives, email alerts when one trips, and a kill switch that stops all MCP access in one click.
A log you can actually search
Filter by date range, ability name, and user. Sort any column, set page size between 10 and 500, and run full-text search across stored request and response bodies. Click a row to open the request and response in collapsible panels, copy either to your clipboard, or trace a single agent session end to end. Export the current view to CSV when you need to hand findings to someone else.
Detection rules that run on every request
Three rules evaluate after each logged request:

Request velocity per session. Catches an agent stuck in a loop.
Destructive tool use. Watches a list of abilities you nominate. It can populate that list for you by scanning previously seen tool names for delete, remove, and drop.
Error storms. Catches an integration that has started failing.

Each rule has its own enable toggle, threshold, time window, severity, and auto-disable setting. Detected events land in a Security Events tab with filters, stat cards, CSV export, and a per-event “mark as reviewed” so your queue reflects what you have already handled. Open any event and Session Replay steps through the full request timeline for that MCP session.
Alerts arrive as HTML email stating whether the offending request ran or was blocked, with a one-click, nonce-protected link to disable MCP access. A 15-minute cooldown per rule and per session stops an alert storm. There is an optional daily digest, separate recipient lists for alerts and digests, and a test button so you can confirm delivery before you rely on it.
A kill switch that keeps the record
Turn off all MCP access from the admin screen, or let a detection rule trip it for you. Blocked requests are still logged before they are rejected, so the audit trail stays complete while access is off. Callers get a 503 explaining why access was disabled and when. A site-wide admin notice stays up until you turn it back on.
Works with whichever MCP server you run
MCP Logs is not an MCP server for your site and does not expose your content to agents. It detects requests by the Mcp-Session-Id header, which is part of the MCP transport spec, so traffic from any compliant server lands in the same table. If your site runs more than one, you get one log instead of several.
Built for both halves of the audience
If you run the site: install, activate, and open Tools then MCP Logs. There is no setup screen and no configuration. Logging starts the moment an MCP client makes a request.
If you build on it: there is a full REST API covering every admin feature, authenticated via WordPress Application Passwords or WooCommerce API keys. The plugin is also MCP-aware itself, registering a server with ten abilities so an agent can introspect its own activity log. Source ships under src/ and builds with npm run build.
Why log deletion is not exposed to AI agents
The plugin registers ten MCP abilities. The two log-deletion abilities, clear-old-logs and clear-all-logs, are deliberately left out of that set.
The same tool set reads log content that an untrusted caller can influence. Pairing that with a one-call wipe would let planted text steer an administrator’s agent into erasing the audit trail. Deletion stays available in the admin screen and over REST, where a human is doing it. Sites that accept the trade-off can re-add the abilities with the alfmcp_mcp_server_abilities filter.
REST API
Eighteen endpoints under /wp-json/activity-log-for-mcp/v1/:

GET /requests for a list with filters, sort, and pagination
GET /stats for totals, success rate, and calls per ability
GET /sessions/{id} for every request in a session, in order
GET /search for full-text search across routes, abilities, and bodies
GET /errors for recent failed executions and HTTP errors
GET /tool-performance for per-ability call count, error rate, and unique users
GET /filters for distinct ability names and users
GET /export-csv for a server-side streamed CSV download
DELETE /requests to clear all logs
DELETE /retention to delete logs older than a given date
GET /security-events for detected events with filters and pagination
GET /security-events/stats for alert counts, active sessions, and top rule over 7 days
GET /security-events/export-csv for a CSV of detected events
PUT /security-events/{id}/acknowledge to mark an event reviewed
DELETE /security-events/clear-acknowledged to remove reviewed events
GET|PUT /security-settings to read or update detection and alerting settings
POST /security-settings/test-alert to send a test alert email

MCP abilities
The plugin registers an MCP server (activity-log-for-mcp-server) with ten abilities:

get-activity for paginated log retrieval with filters
get-stats for summary metrics with an optional date range
get-activity-by-session for a full session trace, with optional body exclusion for lighter payloads
search-activity for full-text search across stored requests and responses
analyze-errors for recent errors with full details
get-tool-performance for per-ability performance metrics
get-security-events for detected events with filters
get-security-stats for alert counts, active sessions, and top rule over 7 days
acknowledge-event to mark a security event reviewed
test-alert to send a test alert email

Privacy and data handling
Everything stays in your WordPress database. Logs live in {prefix}alfmcp_requests and detected events in {prefix}alfmcp_security_events. There is no telemetry, no third-party call, and no external dependency at runtime.
Credential-bearing headers including Authorization, Cookie, and X-Api-Key are replaced with [redacted] before anything is written, so the log never becomes a store of replayable credentials. Add your own header names with the alfmcp_sensitive_headers filter. Request and response bodies are stored up to 64 KB each and truncated beyond that, adjustable with alfmcp_max_body_bytes.
You control retention and can clear everything from the admin screen or over REST.
Disclaimer
MCP Logs is not affiliated with, endorsed by, or sponsored by any AI provider or the Model Context Protocol project. “MCP” and “Model Context Protocol” are referenced solely to describe the open protocol that this plugin observes.
Privacy Policy
MCP Logs records REST API requests that contain the Mcp-Session-Id header. Logged data includes request routes, methods, headers, bodies, response data, user IDs, and timestamps. Credential-bearing headers are redacted before storage. All data is stored in your WordPress database and is never transmitted to external services.

延伸相關外掛

文章
Filter
Mastodon