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."
}
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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."
}
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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."
}
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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."
]
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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."
}
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"uri\": \"docs://tool-guide\",\n \"name\": \"Tool Usage Guide\",\n \"description\": \"Instructions for using weather tools\",\n \"mime_type\": \"text/markdown\",\n \"data_source_type\": \"static\",\n \"data_source_config\": {\n \"content\": \"# Weather Tools Guide\\n\\nUse `get_weather` for current conditions.\"\n }\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/resources"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/resources')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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."
}
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
{
"code": "rest_missing_callback_param",
"message": "Missing parameter(s): uri, name",
"data": { "status": 400 }
}
Resources
Create Resource
Create a new resource within a server.
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."
}
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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."
}
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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."
}
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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."
]
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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."
}
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"uri\": \"docs://tool-guide\",\n \"name\": \"Tool Usage Guide\",\n \"description\": \"Instructions for using weather tools\",\n \"mime_type\": \"text/markdown\",\n \"data_source_type\": \"static\",\n \"data_source_config\": {\n \"content\": \"# Weather Tools Guide\\n\\nUse `get_weather` for current conditions.\"\n }\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/resources"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/resources')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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."
}
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
{
"code": "rest_missing_callback_param",
"message": "Missing parameter(s): uri, name",
"data": { "status": 400 }
}
Path Parameters
string
required
The numeric ID of the server to add the resource to.
Body Parameters
string
required
Unique URI identifier for this resource. Any scheme is valid — common patterns:
docs://getting-started, config://app, file:///data/report.json.string
required
Human-readable resource name shown to AI clients.
string
Description of what the resource contains. Shown to AI clients to help them decide when to read it.
string
default:"text/plain"
MIME type of the returned content. Common values:
text/plain, text/markdown, application/json.string
default:"static"
Where the resource content comes from. One of:
| Value | Description |
|---|---|
static | Content stored directly in data_source_config.content |
url | Content fetched from an external URL at read time |
wp_query | Content generated from a WordPress query |
callback | Content generated by a custom PHP callback function |
object
Configuration for the chosen data source type. Send as a JSON object — the API encodes and stores it internally.Accepts any standard WP_Query argument.The function receives
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" }
callback — call a registered PHP function:{ "callback": "my_plugin_resource_callback" }
($resource, $params) and must return a string.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."
}
}
'
import requests
response = requests.post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
headers={
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
json={
"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."
}
}
)
print(response.json())
const response = await fetch(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
{
method: "POST",
headers: {
"Authorization": "Bearer gmcp_your_api_key",
"Content-Type": "application/json"
},
body: JSON.stringify({
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."
}
})
}
);
const data = await response.json();
$response = wp_remote_post(
"https://yoursite.com/wp-json/getmcp/v1/servers/1/resources",
[
"headers" => [
"Authorization" => "Bearer gmcp_your_api_key",
"Content-Type" => "application/json"
],
"body" => json_encode([
"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."
]
])
]
);
$data = json_decode(wp_remote_retrieve_body($response), true);
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
body := strings.NewReader(`{
"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."
}
}`)
req, _ := http.NewRequest("POST", "https://yoursite.com/wp-json/getmcp/v1/servers/1/resources", body)
req.Header.Set("Authorization", "Bearer gmcp_your_api_key")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String json = "{\n \"uri\": \"docs://tool-guide\",\n \"name\": \"Tool Usage Guide\",\n \"description\": \"Instructions for using weather tools\",\n \"mime_type\": \"text/markdown\",\n \"data_source_type\": \"static\",\n \"data_source_config\": {\n \"content\": \"# Weather Tools Guide\\n\\nUse `get_weather` for current conditions.\"\n }\n}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://yoursite.com/wp-json/getmcp/v1/servers/1/resources"))
.header("Authorization", "Bearer gmcp_your_api_key")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(json))
.build();
HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('https://yoursite.com/wp-json/getmcp/v1/servers/1/resources')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == 'https'
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer gmcp_your_api_key'
request['Content-Type'] = 'application/json'
request.body = '{
"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."
}
}'
response = http.request(request)
puts JSON.parse(response.body)
{
"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:00Z",
"updated_at": "2025-03-18T10:00:00Z"
}
{
"code": "rest_missing_callback_param",
"message": "Missing parameter(s): uri, name",
"data": { "status": 400 }
}
⌘I

