The Request Lifecycle
Here is exactly what happens when an AI client calls one of your tools:1
AI client sends a tools/call request
The AI client (Claude Desktop, Cursor, etc.) sends a JSON-RPC 2.0 POST request to your GetMCP server URL:
2
GetMCP authenticates the request
If your server has inbound authentication enabled, GetMCP checks the
Authorization header against the credential you configured. Requests without a valid credential are rejected with HTTP 403 before any API call is made.3
GetMCP looks up the tool
GetMCP finds the
get_customer tool in your server configuration and reads:- The endpoint URL (
https://api.yourcrm.com/customers/{customer_id}) - The HTTP method (
GET) - The input schema (to validate
customer_idis present and a string) - The parameter mappings (
customer_id→ path variable) - The Custom Headers (your CRM API key)
4
GetMCP validates the arguments
The arguments (
{"customer_id": "cus_123"}) are validated against the tool’s JSON Schema. If a required parameter is missing or the wrong type, GetMCP returns an error immediately — no upstream request is made.5
GetMCP builds and sends the HTTP request
GetMCP constructs the outbound HTTP request, injecting:
- Path variables into the URL:
https://api.yourcrm.com/customers/cus_123 - Query params, if any, appended to the URL
- Body params into the JSON body, if a POST/PUT/PATCH
- Custom Headers (your production API key, never visible to the AI client)
6
Your API responds
Your API processes the request and returns a response — typically JSON:
7
GetMCP wraps the response in MCP format
GetMCP converts the API response into a valid MCP
tools/call response — a JSON-RPC result containing the API response body as a text content block:8
GetMCP logs the call
The call is recorded in the analytics database: timestamp, server, tool name, client type, client IP, HTTP status, response time in milliseconds. Credentials are never logged.
9
The AI client reads the result
Claude (or Cursor, or whichever client) receives the MCP response and uses the data to compose its reply to the user. The user sees a natural-language answer — not raw JSON.
What GetMCP Is Responsible For
Tool Discovery (tools/list)
Before calling any tool, an AI client first callstools/list to discover what’s available. GetMCP returns the name, description, and input schema for every active tool on the server.
Resources and Prompts
Beyond tools, GetMCP also serves two other MCP protocol capabilities: Resources — Read-only data the AI can pull on demand. When a client callsresources/read, GetMCP fetches the configured content (static text, external URL, or WordPress query result) and returns it as a content block. The AI can use this as context without triggering an action.
Prompts — Reusable instruction templates. When a client calls prompts/get with argument values, GetMCP renders the template (substituting {{argument_name}} placeholders) and returns the complete prompt text.
What Runs on WordPress
GetMCP is a WordPress plugin. Everything runs inside your WordPress installation:- The MCP endpoint is a WordPress REST route registered at
/mcp/{slug} - The admin UI lives in
wp-adminunder the GetMCP menu - All config (servers, tools, credentials) is stored in the WordPress database — credentials encrypted with libsodium
- All outbound HTTP requests are made by WordPress using
wp_remote_request() - Analytics are stored in custom database tables created on plugin activation
Performance Characteristics
Caching is particularly useful for tools that call read-only endpoints with data that doesn’t change frequently (product catalogs, reference data, documentation). Set a
Cache TTL on those tools to reduce upstream API calls and improve response times.
