| 开发者 | kevp75 |
|---|---|
| 更新时间 | 2026年5月8日 20:23 |
| PHP版本: | 8.2 及以上 |
| WordPress版本: | 7.0 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
Link headers pointing agents to your API catalog, agent skills index, and MCP server card. This is how agents find your discovery documents without having to guess URLs.
API Catalog — /.well-known/api-catalog
Publishes a machine-readable catalog of your site's APIs in the application/linkset+json format defined by RFC 9727. Each entry in the catalog can point to an OpenAPI specification, human-readable documentation, and a health/status endpoint. If you have not configured any entries yet, the plugin serves a sensible fallback automatically so the endpoint is always valid.
Agent Skills Index — /.well-known/agent-skills/index.json
Publishes a skills discovery index per the Agent Skills Discovery RFC v0.2.0. This tells agents what your site can do — search your blog, browse your portfolio, submit a contact form, and so on.
Skills are built from three sources:
/.well-known/mcp/server-card.json
Publishes an MCP Server Card (SEP-1649) identifying your site to Model Context Protocol clients. Configurable name, version, description, transport endpoint, and a capability list. If you do not have an MCP server running yet, just leave the transport blank — the card is still valid and useful for discovery.
OAuth / OIDC Discovery — /.well-known/openid-configuration or /.well-known/oauth-authorization-server
If your site exposes protected APIs that require authentication, this feature publishes the discovery metadata agents need to authenticate. Supports both OpenID Connect Discovery 1.0 and RFC 8414. Disabled by default — only enable it if you have the infrastructure in place.
OAuth Protected Resource Metadata — /.well-known/oauth-protected-resource
Complements the OAuth/OIDC feature by publishing RFC 9728 Protected Resource Metadata. Disabled by default.
robots.txt Content Signals
Appends Content Signals directives to your robots.txt file, declaring your preferences for how AI systems may use your content:
Accept: text/markdown header, the plugin intercepts the response for singular posts and pages and returns a clean Markdown version of the content. Regular browser requests are completely unaffected.
WebMCP
Injects a small JavaScript snippet into your page footer that calls navigator.modelContext.provideContext(), exposing your site's key actions as tools to AI agents running in the browser. Built-in tools include blog search, portfolio navigation, and contact page navigation — each individually toggleable.
llms.txt and llms-full.txt
Generates physical /llms.txt and /llms-full.txt files in your WordPress web root per the llmstxt.org specification. These files give AI systems a structured, readable index of your site's content — who you are, what pages exist, and what your posts are about.
llms.txt contains your site header and a clean list of links by content type. llms-full.txt contains the same structure but expands each entry with an excerpt or truncated content block so AI systems can understand the content without fetching every URL.
Files are regenerated automatically when posts are published, unpublished, or trashed, and whenever settings are saved. A manual Regenerate button is available in the llms.txt settings tab. If your host prevents direct file writes, the generated content is displayed in the admin as a copyable textarea so you can create the files manually.
Configurable options include a custom intro block, toggling pages and posts independently, selecting additional custom post types, setting the excerpt word limit for llms-full.txt, and defining optional additional links that appear under an ## Optional section in both files.
Developer Filters
Two filters let themes and other plugins extend the plugin's output without touching settings:
kp_agent_skills — add entries to the agent skills index:
add_filter( 'kp_agent_skills', function ( array $skills ): array {
$skills[] = [
'name' => 'my-skill',
'type' => 'api',
'description' => 'Does something useful.',
'url' => 'https://yoursite.com/api/endpoint',
];
return $skills;
} );
kp_webmcp_tools — add tools to the WebMCP context:
add_filter( 'kp_webmcp_tools', function ( array $tools ): array {
// $tools is the PHP array that becomes the JS tools array
return $tools;
} );
/.well-known/ URL rules.kp-agent-ready folder to wp-content/plugins/./.well-known/ requests through its normal rewrite pipeline. If your endpoints return 404, apply the rule below for your server.
Nginx — add inside your server {} block, above the primary location / block:
location ^~ /.well-known/ {
auth_basic off;
allow all;
rewrite ^(/.*)$ /index.php?__kp_wk=$1 last;
}
Apache — standard:
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/.well-known/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
Apache — fallback (if standard does not work):
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/.well-known/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(/.*)$ /index.php?__kp_wk=$1 [L,QSA]
IIS — standard:
IIS — fallback (if standard does not work):
No. The plugin works out of the box with sensible defaults. The /.well-known/ endpoints are live immediately after activation, Link headers are sent on every response, and the agent skills index auto-populates from your blog. Visit the settings only if you want to customise what is published or enable the OAuth features.
No. The /.well-known/ endpoints only execute when an agent specifically requests them. The Link headers add a negligible number of bytes to each response. The WebMCP script only runs if navigator.modelContext exists in the browser — which it currently does not in standard browsers — so it has no runtime cost for regular visitors.
/.well-known/ directory?It is a reserved URL path (defined by RFC 8615) where internet standards place well-known resources — things like Let's Encrypt challenge files and increasingly AI agent discovery documents. This plugin registers these paths through WordPress's rewrite system so no files need to physically exist on disk.
WordPress stores its URL rewrite rules in the database and writes them to .htaccess. When the plugin registers its /.well-known/ rules they do not take effect until the rewrite rules are regenerated, which happens when you save the Permalinks settings page. This is standard practice for any WordPress plugin that adds custom URL rules.
The endpoint will serve whatever data you have entered in the settings, even if incomplete. Only enable this feature if you have a working OAuth or OIDC server — otherwise the metadata it publishes will be misleading to agents.
It has not been tested on multisite. Each site in a network would need the plugin activated individually at the site level, and the /.well-known/ paths would need to resolve correctly for each site's domain.
Yes — see the Developer Filters section in the Description tab.
kp prefix to kpagre to meet WordPress.org prefix length requirementsjson_encode() with wp_json_encode() in WellKnown respond()wp_kses() escaping for constructed form HTMLsprintf() description strings in __() for i18n compliance in WellKnown buildSkills()esc_url_raw() to MCP server card contact field output in WellKnown serveMcpCard()delete_option() calls in uninstall.php for options that no longer exist