REST API and MCP Integration
Turn WordPress into an MCP server so Claude and Cursor can create and read articles. REST API too
WordPress becomes an MCP server
With the Pro edition installed, this WordPress site works as an MCP server. Just register the URL and API key with an MCP client such as Claude Code, Claude Desktop, or Cursor, and you can ask things like "write an article with the keyword XX" or "read the article you made last week and summarize it." You don't need any extra software or a Node.js wrapper.
There's a single MCP endpoint (using Streamable HTTP; it accepts JSON-RPC over POST).
`` https://your-site/wp-json/sorabun/v1/mcp ``
How to register
Claude Code
`` claude mcp add --transport http sorabun "https://your-site/wp-json/sorabun/v1/mcp" \ --header "Authorization: Bearer sbk_xxxxxxxxxxxxxxxx" ``
Cursor / Windsurf / VS Code (for config files that let you specify a URL and headers)
``json { "mcpServers": { "sorabun": { "url": "https://your-site/wp-json/sorabun/v1/mcp", "headers": { "Authorization": "Bearer sbk_xxxxxxxxxxxxxxxx" } } } } ``
Claude Desktop (for clients that can't add headers from the settings screen, go through mcp-remote. Requires Node.js 18 or later)
``json { "mcpServers": { "sorabun": { "command": "npx", "args": ["-y", "mcp-remote", "https://your-site/wp-json/sorabun/v1/mcp", "--header", "Authorization: Bearer sbk_xxxxxxxxxxxxxxxx"] } } } ``
The URL and API key are shown under "Settings > REST API / MCP Integration" in a ready-to-copy form.
Available tools
| Tool | What it does |
|---|---|
create_article | Create an article from a keyword. Returns a job_id right away |
rewrite_article | Rewrite an existing article. The result is saved as a draft |
article_from_url | Create an article from a URL or a YouTube video |
get_job / list_jobs | Check generation progress |
list_posts / get_post | List articles and read their content (up to 20,000 characters) |
site_info | Site name, edition, generation defaults, and the number of articles Sorabun has created |
Article generation is asynchronous. The tool returns a job_id right away, and the article takes a few minutes to finish. The server tells the AI to "check get_job every 30 to 60 seconds" and "save as a draft rather than publish unless asked to," so it usually behaves this way without you saying anything.
Only the 8 tools above are available over MCP. It can't change settings, delete articles, or manage API keys. The only way to change publish status is the post_status parameter of create_article and article_from_url, and the default is draft.
You can also call it as a REST API
With the same API key, you can also trigger article generation from Zapier, Make, or your own scripts.
Authentication
Issue an API key under "Settings > REST API / MCP Integration" and attach it to your request header.
`` X-Sorabun-Key: sbk_xxxxxxxxxxxxxxxx ``
Endpoints
| Method | Path | Purpose |
|---|---|---|
| POST | /wp-json/sorabun/v1/articles | Start article generation |
| GET | /wp-json/sorabun/v1/jobs/<id> | Check a job's status |
| GET | /wp-json/sorabun/v1/jobs | List recent jobs |
The following parameters can be passed in an article generation request.
keyword(required)type: optimization typelength: character countpost_status:draftorpublishcustom_prompt: additional instructions
Anyone with this key can generate articles. If you register it with an external service, check that service's access controls. If you suspect it's been exposed, you can reissue it from the settings screen.