Skip to content

AI programs

github-actions[bot] edited this page Dec 4, 2026 · 8 revisions

AI programs

OwnCMS has an endpoint for AI programs at /api/mcp (Model Context Protocol). A program acts with the rights of the person whose access token it uses: an administrator's token can do what the administrator can, an editor's what the editor can. A token with access "read" can only look. Every change is recorded as " via token ".

Make an access token

In the administration, open Access tokens and add one. Name it after the program that uses it, choose whether it may change things, and when it should stop working. The token is shown once; copy it into the program. Tokens can only be made and removed by a person signed in with their password, never by a program with a token.

Connect

Program How
Claude Code claude mcp add --transport http owncms https://cms.example.com/api/mcp --header "Authorization: Bearer ocm_…"
Others an MCP server over HTTP at https://cms.example.com/api/mcp with the header Authorization: Bearer ocm_…

Tools

Tool Does
whoami shows who the program acts as, their role and whether the token only reads
list_activity shows what was changed, by whom and when (administrators of all sites)
list_sites, describe_site the sites the person works on, with their languages
create_site, update_site, delete_site add, change and delete sites, as the person may (deleting repeats the site's name)

| list_content_types, describe_content_type | the content types of a site; describe_content_type also gives the JSON Schema of an entry's values | | create_content_type, update_content_type, delete_content_type | define content types and their fields (administrators; see Content types) |

| list_entries, get_entry | the entries of a content type, and one with its draft and published values | | create_entry, update_entry | write a draft (values as in describe_content_type's entry schema); a change names only the fields it changes | | publish_entry, unpublish_entry, archive_entry | what visitors read; only when the person asked | | delete_entry, restore_entry | the bin, for 30 days | | list_revisions, diff_revisions, revert_entry | an entry's history: every change with who, when and why; what changed between two revisions; going back to one (as a new revision) |

| list_content_keys, create_content_key, delete_content_key | keys websites read a site's content with (administrators; see Reading content) |

describe_site lists a site's content types too. Every change of an entry needs a reason in one sentence, which the activity log shows.

Tools per content type

Every content type of a site the person may write to also has two tools of its own:

Tool Does
create_<site>_<type> write a new entry of the type, e.g. create_firmenblog_post
update_<site>_<type> change an entry of the type, named by its short name or id

Their input is exactly the content type's fields, with one value per language for translatable fields, the allowed choices and limits, so an AI program sees what it may write without looking it up first. They follow the content types as they are: a field added now is in the tools at the program's next request. Tokens that may only read get none of them. A tool name may have at most 64 characters; a content type whose tool names would be longer is written with create_entry and update_entry instead.

Reading what is published

An AI program that only needs what visitors see reads it like a website, without an access token: /content/<site>/llms.txt lists everything published with links to each entry as Markdown. See Reading content.

Clone this wiki locally