=== MCP Tracker ===
Contributors: wpvibes, gajendrasingh
Tags: mcp, rest-api, logging, developer-tools, debugging
Requires at least: 6.9
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Records and displays MCP-related REST API requests made to your WordPress site.

== Description ==

MCP Tracker is an admin-only WordPress plugin designed to monitor and log MCP (Model Context Protocol) requests made to the Abilities API on your WordPress site.
If you are using the Abilities API to power AI-driven tools or MCP-based integrations, MCP Tracker gives you complete visibility into how those tools interact with your REST endpoints â€” without modifying or interfering with request flow.
The plugin automatically detects MCP requests (identified via the `Mcp-Session-Id` header), records detailed request and response data, and presents everything in a structured, filterable interface inside WordPress Admin.
Whether you're debugging Abilities API integrations, auditing MCP tool usage, or analyzing response behavior, MCP Tracker provides the observability layer you need.

= Features =

* **Automatic MCP Detection**  
Identifies MCP requests related to Abilities API using the `Mcp-Session-Id` header.
* **Comprehensive Logging**  
Logs route, method, headers, request payload, response status, and response body.
* **User Attribution**  
Displays which WordPress user (or guest) initiated the MCP request.
* **Advanced Filtering**  
Filter logs by date range, tool name, and user for targeted analysis.
* **Formatted JSON Inspection**  
View complete request and response data in a structured format.
* **Privacy Focused**  
All logs remain stored in your WordPress database. No external transmission or telemetry.
* **Performance Optimized**  
Efficient logging using native WordPress REST hooks and optimized queries.

= Use Cases =

* Debug Abilities API integrations  
* Monitor MCP-based AI tool usage  
* Analyze REST response patterns  
* Audit MCP activity on production sites  
* Investigate failed or unexpected tool executions  

= Technical Details =

* Uses WordPress REST API hooks for non-intrusive logging  
* Custom indexed database table for efficient storage  
* Admin-only access with capability checks  
* Nonce verification for secure actions  
* Prepared SQL statements for database safety  
* Self-healing table creation on activation 

== Installation ==

1. Upload the `mcp-tracker` folder to the `/wp-content/plugins/` directory
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Navigate to 'MCP Tracker' in the WordPress admin menu
4. Start monitoring MCP requests!

== Frequently Asked Questions ==

= What is MCP? =

MCP (Model Context Protocol) is a protocol for communication between AI models and external tools or services. This plugin helps you monitor MCP-related requests to your WordPress site.

= Does this plugin modify REST requests? =

No. MCP Tracker only logs requests for monitoring purposes. It does not modify, block, or alter any REST API requests or responses.

= Where is the data stored? =

All logged data is stored in a custom database table in your WordPress database. No data is sent to external services.

= Will this slow down my site? =

No. The plugin uses efficient WordPress hooks and database queries with minimal performance impact. Logging only occurs for MCP requests (identified by the `Mcp-Session-Id` header).

= Can I delete old logs? =

Currently, logs are stored indefinitely. You can manually clear the database table if needed. Future versions may include automatic cleanup options.

= Who can access the MCP Tracker interface? =

Only users with the `manage_options` capability (typically administrators) can access the MCP Tracker admin interface.

== Screenshots ==

1. MCP Tracker dashboard showing all logged MCP requests in a structured, filterable table view. Quickly identify MCP method, Ability name, response status, user, and API endpoint.
2. Detailed Request Information view displaying MCP method (`tools/call`), Ability name, API endpoint, session ID, and complete JSON request body for Aibilities API interactions.
3. Response Information panel with formatted JSON output, including structured content, Ability execution result, and HTTP response status â€” making debugging and inspection easy.

== Changelog ==

= 1.0.1 =
* Added: URL-based filtering by MCP server slug (e.g. `?server=mcp-adapter-default-server`) for easier integration with other plugins
* Improved: Redesigned filter header with a cleaner action bar layout
* Improved: Resized and respaced action bar buttons (Delete, Settings, Filter, Reset) for better visual balance

= 1.0.0 =
* Initial release
* MCP request detection and logging
* Filtering by date, tool, and user
* Detailed request viewer

