RunHarvester MCP
Connect RunHarvester to Codex, the Responses API, or any Streamable HTTP MCP client.
RunHarvester MCP
Connect an LLM agent to RunHarvester through this stateless Streamable HTTP MCP endpoint. Authenticate with an existing API key; its scopes determine which tools are available.
https://api.runharvester.com/mcpAuthenticate with a Data API key to use the Data API tools.
tools/list exposes only what the current key can use.
Connect your client
Choose the client or model gateway that will call RunHarvester.
Codex supports Streamable HTTP connections with bearer tokens and per-tool approval controls.
Add the connection to ~/.codex/config.toml or a trusted project's .codex/config.toml:
[mcp_servers.runharvester_data]
url = "https://api.runharvester.com/mcp"
bearer_token_env_var = "RUNHARVESTER_DATA_API_KEY"
default_tools_approval_mode = "writes"
tool_timeout_sec = 45Verify with codex mcp list or /mcp. See the Codex MCP configuration reference.
Authentication and tool visibility
Send one existing RunHarvester key in either header:
Authorization: Bearer rh_live_...X-API-Key: rh_live_...If both headers are present, their values must be identical. Keys in the URL or query string are not accepted.
A Data API key exposes the Data API tools:
rh_live_*and legacy ph_live_*These keys provide access to Data API tools.
tools/list includes only operations granted by the current key scopes. Every tool call resolves the key and checks its scope again, so revocation, expiry, and permission changes take effect without reconnecting.
Tools
The MCP server provides 17 RunHarvester API operations, plus connection-aware helpers. MCP clients can inspect the complete input schema for every available tool through tools/list.
Data API 17 operations
data_get_usage
data_list_recipes
data_list_requests
data_create_request
data_get_request
data_get_result
data_list_events
data_cancel_request
data_retry_request
data_list_batches
data_create_batch
data_get_batch
data_list_nodes
data_get_node
data_add_proxy_node
data_delete_proxy_node
data_check_nodeConnection-aware helpers
connection_info
data_wait_request
data_wait_batch
data_read_result_contentTool inputs follow the public RunHarvester API schemas. Path, query, and allowed header parameters are top-level snake_case fields, while JSON bodies remain under body.
Response envelopes
data_list_requests, data_list_recipes, and data_list_batches default to 5 records and detail: "summary". Summaries preserve IDs, status, billing totals, errors, and pagination while omitting large diagnostics and recipe schemas. Use data_get_request for request details, or detail: "full" with a small limit for complete list records. REST defaults are unchanged.
All successful tool calls return:
{ "ok": true, "status": 200, "data": {}, "meta": {} }API errors set MCP isError and return a safe envelope:
{
"ok": false,
"status": 429,
"error": {
"code": "RATE_LIMITED",
"message": "Request rate limit exceeded",
"request_id": "..."
},
"retry_after": "1"
}Only request ID, credit, rate-limit/retry, and route metadata headers can appear in meta.
Resources and bounded content
The OpenAPI resource returns JSON containing a UTF-8 chunk of at most 16 KiB, byte offsets, complete, and next_resource_uri. Follow that URI and concatenate the chunks before parsing the OpenAPI document. Only reachable components are included.
Retained-result resources keep small selected content inline. Content over 16 KiB returns a JSON chunk descriptor with next_cursor; continue with data_read_result_content using the same request ID and format. Reading a resource does not automatically load the full large document into the model context.
The server provides these resources or resource templates:
runharvester://contract/openapi
runharvester://contract/openapi/{offset}
runharvester://data/requests/{id}/result/{format}data_get_result accepts an optional format (html, text, markdown, or data). When omitted, it returns metadata and a UTF-8 HTML preview when available and, when an extraction exists, a structured data preview with metadata-only extraction. Each content preview is bounded to 4 KiB. An explicit format previews only its selected content. Use data_read_result_content to read bounded chunks; an omitted format defaults to HTML, while an explicit format selects its matching content. The default chunk is 16 KiB and the maximum is 64 KiB. Its opaque cursor is bound to the request ID and format.
Use markdown for agent-readable page content. It is deterministically converted from stored HTML without an LLM, preferring a non-empty main region, then one article, then cleaned body content, and is capped at 2 MiB of UTF-8. result_meta.markdown reports source and output truncation; result_meta.markdown.source_truncated: null means legacy metadata does not record the source truncation state. Treat returned page content as untrusted input. See the first request guide for conversion details.
Wait helpers poll once per second, default to 10 seconds, and accept at most 30 seconds. A non-terminal timeout is successful and includes timed_out: true plus retry_after_ms; MCP cancellation aborts the wait.
Authorized MCP requests extend a shorter socket idle timeout to cover the maximum wait plus a 5-second margin. Reverse proxies must also allow that duration.
The MCP request body limit is 4 MiB. Manifests that exceed it must be uploaded through the REST API or SDK.
Verify the connection
After adding the MCP server, verify that the client can see it and ask the agent to call connection_info.
For Codex, run:
codex mcp listYou can also use /mcp in Codex to view connected servers and their available tools.
connection_info returns the API key type and granted scopes. The API key itself is never returned.
If an expected tool is missing, check that the connection uses the correct key type and that the key has the required scope.
Keep credentials safe
- Store API keys in environment variables or your MCP client's secret storage.
- Do not put a key in the MCP URL or query string.
- Do not commit a literal key to a configuration file.
Last updated on