=== MCPKit ===
Contributors: abdulwahabtaqi
Tags: mcp, ai agents, wordpress diagnostics, site health, automation
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 0.1.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Safe AI-agent access for WordPress with permissions, approvals, rate limits, and audit logs.

== Description ==

MCPKit helps site owners connect trusted AI clients to WordPress through authenticated, scoped endpoints.

Version 1 focuses on a safe foundation for local and administrator-controlled AI workflows. The free plugin is useful without payment, license validation, time limits, or feature expiry.

== Features available free ==

* Site information.
* Theme diagnostics.
* Plugin diagnostics.
* Site health summary.
* Post and page inspection.
* Scoped WordPress Application Password connections.
* OAuth browser authorization with PKCE for compatible MCP clients.
* MCP JSON-RPC endpoint with tool discovery and tool calls.
* Codex, Claude Code, and Claude-compatible JSON configuration snippets.
* Built-in external-client simulation test for OAuth and MCP tool calls.
* Per-ability rate limits.
* Connection revocation.
* Audit logging.
* Draft-post proposals stored for human review.
* Privacy exporter and eraser support for user-linked audit data.

== What MCPKit does not allow ==

MCPKit does not execute arbitrary PHP, JavaScript, shell commands, SQL, WP-CLI commands, or file-manager actions.

MCPKit does not edit plugin files, edit theme files, install plugins, activate plugins, install themes, load remote executable code, or let an AI client publish content directly.

Write-style work in V1 is stored as a proposal for administrator review.

== Installation ==

1. Upload the plugin files to `/wp-content/plugins/mcpkit`, or install MCPKit from the WordPress Plugins screen.
2. Activate MCPKit.
3. Open MCPKit > Connect.
4. Enable MCPKit abilities.
5. Create a scoped connection for a supported AI client.
6. Copy the generated WordPress Application Password into your trusted AI client.

Additional setup notes are included in `docs/client-setup.md`.

== Connection setup ==

MCPKit supports two V1 authentication paths: WordPress Application Passwords and OAuth bearer tokens for compatible MCP clients.

Each AI client connection should use its own Application Password. MCPKit stores connection metadata such as the connection UUID, user ID, client label, scopes, status, and Application Password identifier. It does not store the raw Application Password.

OAuth clients can use the metadata, registration, authorization, and token endpoints exposed by MCPKit. OAuth authorization uses a browser approval screen and PKCE S256. Access tokens are stored only as hashes and expire after one hour. Refresh tokens are rotated and expire after one week.

OAuth metadata discovery is available at:

`/.well-known/oauth-authorization-server/`

Revoking a connection in MCPKit immediately blocks MCPKit abilities for that connection.

== MCP endpoint ==

The MCP endpoint is:

`/wp-json/mcpkit/v1/mcp`

It accepts JSON-RPC 2.0 POST messages and supports:

* `initialize`
* `ping`
* `tools/list`
* `tools/call`
* `prompts/list`
* `resources/list`

MCPKit exposes only the same safe V1 abilities available elsewhere in the plugin. Tool calls still require a linked active connection, an allowed scope, rate limiting, and audit logging.

== Client configuration ==

Open MCPKit > Client Config to copy generated configuration for:

* Codex Streamable HTTP MCP `config.toml`
* Codex MCP add and OAuth login commands
* Claude Code HTTP MCP command and exact `add-json` command
* Claude Desktop `claude_desktop_config.json` snippet

The Codex configuration includes the MCP endpoint URL, OAuth mode, explicit scopes, enabled tool names, timeout settings, and a prompt requirement for proposal-style tools. Claude Code and Claude Desktop snippets include the HTTP transport type, MCP endpoint URL, and OAuth scopes. The same screen runs an external-client simulation covering metadata discovery, dynamic registration, PKCE token exchange, MCP initialize, tools/list, and tools/call.

== Supported/tested AI clients ==

The V1 setup screen includes connection labels for:

* Codex
* Claude Code
* Claude Desktop

Other clients may work if they can call authenticated WordPress REST endpoints with a WordPress Application Password.

== Security model ==

MCPKit abilities require:

* MCPKit enabled by an administrator.
* An authenticated WordPress user with the required capability.
* A linked, active MCPKit connection.
* A WordPress Application Password captured by WordPress authentication.
* The required MCPKit connection scope.
* The per-user, per-ability rate limit.

MCPKit validates and sanitizes inputs, escapes output in admin screens, and uses prepared SQL values for dynamic query values. Custom database table names are limited to MCPKit-owned tables.

More detail is included in `docs/security-model.md`.

== Data handling and privacy ==

MCPKit stores the minimum data needed for connection control, audit review, and proposal review.

Audit events may include event type, WordPress user ID, connection UUID, client label, ability name, a short redacted message, a hashed IP value, and timestamps.

MCPKit does not store raw AI prompts, raw MCP requests, WordPress login passwords, raw Application Passwords, raw OAuth bearer tokens, AI provider keys, cookies, or secrets.

Admins can set audit retention days in MCPKit settings. MCPKit registers WordPress personal-data exporter and eraser callbacks for user-linked audit data.

Suggested privacy policy text:

MCPKit records limited audit events when administrator-approved AI client connections use MCPKit abilities. These events may include a WordPress user ID, connection label, ability name, redacted event summary, hashed IP value, and timestamp. MCPKit does not store raw Application Passwords, AI provider keys, or raw prompts by default.

== External services ==

MCPKit does not contact external services by itself in V1.

The site administrator chooses whether to configure an AI client outside WordPress. Any data sent by that client is controlled by the administrator's client configuration, not by MCPKit telemetry.

== Frequently Asked Questions ==

= Does MCPKit publish content automatically? =

No. V1 stores write-style work as a proposal for review.

= Does MCPKit store my generated Application Password? =

No. WordPress shows the raw Application Password once. MCPKit stores only connection metadata and an Application Password identifier/name for matching future authenticated requests.

= Does MCPKit require an external service? =

No. MCPKit exposes authenticated local WordPress endpoints for compatible AI clients.

= Can I use MCPKit Pro? =

MCPKit Free does not require MCPKit Pro. A separate paid add-on may exist later, but the free plugin remains useful by itself.

== Screenshots ==

1. Dashboard with status, active connections, pending approvals, and site information.
2. Connection setup with OAuth and Application Password options.
3. V1 abilities list with scopes, methods, and REST routes.
4. Client Config page with MCP endpoint, OAuth metadata, and Codex setup.
5. Approvals workflow for reviewing AI-proposed draft posts.
6. Activity Log showing recent ability calls and approval events.

== Changelog ==

= 0.1.4 =
* Added support for WordPress 6.4 and newer while retaining native Abilities API integration when available.

= 0.1.3 =
* Improved Codex setup guidance with an install step, copyable terminal commands, and clearer OAuth login instructions.

= 0.1.1 =
* Added exact Codex, Claude Code, and Claude Desktop client configuration generation.
* Added OAuth and MCP compatibility hardening for V1 client workflows.
* Verified auth, scopes, revocation, kill switch, rate limits, proposals, audit logs, and redaction with automated local tests.

= 0.1.0 =
* Initial V1 foundation with read-only abilities, scoped connections, approval proposals, rate limits, privacy tools, and audit logs.
