Skip to main content

What is a Resource?

Resources are a way to expose data content — documents, files, database query results, or any structured information — to AI clients via the MCP resources/read method. Unlike tools (which execute actions), resources provide read-only content that the AI can reference. Think of resources as:
  • Documentation or knowledge base articles the AI should be aware of
  • Real-time data from your database (e.g., product catalog, user list)
  • Static configuration or reference content
  • WordPress posts/pages exposed as MCP-readable content

Resource Properties

Resource URI

Every resource has a unique URI that serves as its identifier. Any URI scheme is valid:
AI clients reference resources by URI when calling resources/read.

Data Source Types

static

The simplest type. Define the content directly in the editor — it never changes unless you update it:
Use static resources for documentation, configuration, or any content that changes infrequently.

url

Content is fetched from an external URL each time the resource is read. The fetch happens server-side from WordPress, so it works behind firewalls:
cache_ttl (optional, seconds) caches the remote response to avoid hitting the upstream URL on every read. Default is 0 (no cache).

wp_query

Query your own WordPress database and expose the results as a resource. Accepts any standard WP_Query argument:
Common uses: blog post lists, WooCommerce products, custom post types, page content.

callback

Call a registered PHP function to generate content dynamically. The callback receives ($resource, $params) and must return a string:
Register the callback in your theme or plugin:

Resource Templates

Resource templates allow parameterized resources using URI templates (RFC 6570). Instead of a fixed URI pointing to one piece of content, a template defines a pattern where part of the URI is a variable the AI client fills in at read time.

How Templates Work

Set the Template URI field to a pattern with {variable} placeholders:
When an AI client calls resources/templates/list, it receives the template pattern. The client then substitutes concrete values and calls resources/read with the expanded URI:

Static URI vs Template URI

Template Example

A resource that serves any WordPress post by slug:
The AI client calls resources/read with wp://posts/my-post-slug and receives that post’s content.

Creating a Resource

1

Open the Resources Tab

Inside a server, click the Resources tab.
2

Click Add Resource

Click Add Resource to open the resource editor.Add Resource
3

Set URI and Name

Enter a URI (e.g., docs://api-overview) and a human-readable name.
4

Choose Data Source Type

Select the data source type and fill in the corresponding config fields.
5

Set Template URI (optional)

If this is a parameterized resource, add a URI template pattern (e.g., docs://posts/{slug}).
6

Save

Click Save. The resource is now available via resources/list (or resources/templates/list if a template URI is set) and resources/read.
Resource Editor

MCP Protocol

Resources integrate with the standard MCP protocol methods:
  • resources/list — Returns all resources that have a fixed URI
  • resources/read — Returns the content of a specific resource by URI
  • resources/templates/list — Returns resources that have a template_uri set