Skip to main content
POST
/
wp-json
/
getmcp
/
v1
/
servers
/
{server_id}
/
resources
curl --request POST \
     --url https://yoursite.com/wp-json/getmcp/v1/servers/1/resources \
     --header 'Authorization: Bearer gmcp_your_api_key' \
     --header 'content-type: application/json' \
     --data '
{
  "uri": "docs://tool-guide",
  "name": "Tool Usage Guide",
  "description": "Instructions for using weather tools",
  "mime_type": "text/markdown",
  "data_source_type": "static",
  "data_source_config": {
    "content": "# Weather Tools Guide\n\nUse `get_weather` for current conditions."
  }
}
'
{
  "id": 3,
  "server_id": 1,
  "uri": "docs://tool-guide",
  "name": "Tool Usage Guide",
  "description": "Instructions for using weather tools",
  "mime_type": "text/markdown",
  "data_source_type": "static",
  "data_source_config": {
    "content": "# Weather Tools Guide\n\nUse `get_weather` for current conditions."
  },
  "template_uri": null,
  "server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
  "created_at": "2025-03-18T10:00:00",
  "updated_at": "2025-03-18T10:00:00"
}

Documentation Index

Fetch the complete documentation index at: https://docs.getmcp.com/llms.txt

Use this file to discover all available pages before exploring further.

Path Parameters

server_id
integer
required
The numeric ID of the server to add the resource to.

Body Parameters

uri
string
required
Unique URI identifier for this resource. Any scheme is valid — common patterns: docs://getting-started, config://app, file:///data/report.json.
name
string
required
Human-readable resource name shown to AI clients.
description
string
Description of what the resource contains. Shown to AI clients to help them decide when to read it.
mime_type
string
default:"text/plain"
MIME type of the returned content. Common values: text/plain, text/markdown, application/json.
data_source_type
string
default:"static"
Where the resource content comes from. One of:
ValueDescription
staticContent stored directly in data_source_config.content
urlContent fetched from an external URL at read time
wp_queryContent generated from a WordPress query
callbackContent generated by a custom PHP callback function
data_source_config
object
Configuration for the chosen data source type. Send as a JSON object — the API encodes and stores it internally.static — serve fixed text content:
{ "content": "Your static text or markdown here." }
url — fetch content from a remote URL:
{ "url": "https://api.example.com/data.json", "cache_ttl": 300 }
cache_ttl is optional (seconds, default 0 = no cache).wp_query — query WordPress posts/pages:
{ "post_type": "post", "posts_per_page": 10, "orderby": "date", "order": "DESC" }
Accepts any standard WP_Query argument.callback — call a registered PHP function:
{ "callback": "my_plugin_resource_callback" }
The function receives ($resource, $params) and must return a string.
template_uri
string
URI template (RFC 6570) for parameterized resources, e.g. file:///data/{id}.json. When set, the resource appears under resources/templates/list in the MCP protocol.
curl --request POST \
     --url https://yoursite.com/wp-json/getmcp/v1/servers/1/resources \
     --header 'Authorization: Bearer gmcp_your_api_key' \
     --header 'content-type: application/json' \
     --data '
{
  "uri": "docs://tool-guide",
  "name": "Tool Usage Guide",
  "description": "Instructions for using weather tools",
  "mime_type": "text/markdown",
  "data_source_type": "static",
  "data_source_config": {
    "content": "# Weather Tools Guide\n\nUse `get_weather` for current conditions."
  }
}
'
{
  "id": 3,
  "server_id": 1,
  "uri": "docs://tool-guide",
  "name": "Tool Usage Guide",
  "description": "Instructions for using weather tools",
  "mime_type": "text/markdown",
  "data_source_type": "static",
  "data_source_config": {
    "content": "# Weather Tools Guide\n\nUse `get_weather` for current conditions."
  },
  "template_uri": null,
  "server_uuid": "836995ae-1cff-41ec-823e-a4f07ccca3a0",
  "created_at": "2025-03-18T10:00:00",
  "updated_at": "2025-03-18T10:00:00"
}