Draftbase exposes full template, entry, and media control as MCP tools — mirrors the REST API 1:1, so any MCP-capable client (Claude Code, Claude Desktop, etc.) can manage content directly.
| Env | MCP endpoint | API URL |
|---|---|---|
| staging | https://staging-mcp.draftbase.co/mcp | https://staging-api.draftbase.co |
| prod | https://mcp.draftbase.co/mcp | https://api.draftbase.co |
The server validates a Bearer JWT (aud: "mcp", sub = userId, orgId claim). Tokens are issued via standard OAuth 2.1 + PKCE with dynamic client registration. Discovery: GET <API_URL>/.well-known/oauth-authorization-server
claude mcp add --transport http draftbase-staging https://staging-mcp.draftbase.co/mcp # prod: claude mcp add --transport http draftbase-prod https://mcp.draftbase.co/mcp
Then run /mcp in Claude Code — opens a browser to log in, completes OAuth, and stores the token. Run /mcp again to check connection status.
Point the client at the MCP endpoint (<MCP_URL>/mcp) with transport: http. The client must support the OAuth 2.1 + PKCE discovery flow (dynamic client registration, no client secret). Without an OAuth-capable client, drive /oauth/register → /oauth/authorize → /oauth/token by hand against the API URL and set the resulting access_token as the Bearer token.
19 tools across 3 groups, matching the templates / entries / media REST routes.
| Tool | Description |
|---|---|
list_templates | List all templates defined for the current org |
get_template | Get a single template by id, including its full field schema |
create_template | Create a template schema in one call — define all fields up front rather than creating then patching |
update_template | Update a template's name and/or fields (partial update — omit unchanged fields) |
delete_template | Delete a template. Fails if entries still reference it — delete those first |
| Tool | Description |
|---|---|
list_entries | List entries, optionally filtered by template or locale. Returns MDX with reference/media fields resolved inline |
create_entry | Create a new content entry |
update_entry | Update an existing content entry |
get_entry | Get a single entry by id. Returns MDX with reference/media fields resolved inline |
delete_entry | Delete an entry permanently |
set_entry_status | Change an entry's status (draft, updated, published, archived) — publishing requires all required fields to be set |
list_entry_revisions | List an entry's revision history, newest first |
rollback_entry | Restore an entry's fields to a prior revision version |
| Tool | Description |
|---|---|
list_media | List uploaded media assets, optionally filtered by status |
get_upload_url | Get a presigned URL to upload a media asset. After uploading, call confirm_media with the returned storageKey to register it |
confirm_media | Register an uploaded media asset after it's been PUT to the presigned URL from get_upload_url |
replace_media | Swap an existing media asset's image (e.g. after re-cropping). Upload the new file to a presigned URL from get_upload_url first, then call this with the returned storageKey. Re-runs the resize pipeline |
set_media_tags | Replace a media asset's tags with the given list |
delete_media | Delete a media asset and its underlying stored object |