KosmoKrator

data

Payload CMS MCP Integration for Vercel AI SDK

Connect Payload CMS to Vercel AI SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.

7 functions 6 read 1 write API token auth

Connect Payload CMS to Vercel AI SDK

Use KosmoKrator as a local integration gateway for Vercel AI SDK agents and scripts.

Create an MCP client that starts or connects to the KosmoKrator gateway for the selected integration. The gateway is local, scoped to this integration, and starts with --write=deny so Vercel AI SDK can inspect read-capable tools without receiving write access by default.

Payload CMS MCP Config for Vercel AI SDK

Prefer CLI JSON calls when a workflow only needs one deterministic integration operation.

{
  "mcpServers": {
    "kosmokrator-payload-cms": {
      "type": "stdio",
      "command": "kosmo",
      "args": [
        "mcp:serve",
        "--integration=payload-cms",
        "--write=deny"
      ]
    }
  }
}

Run the Gateway Manually

kosmokrator mcp:serve --integration=payload-cms --write=deny

Why Use KosmoKrator Here

Scoped tools

Expose only Payload CMS instead of a broad multi-service tool list.

Local credentials

Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.

Write policy

Start read-only, then opt into ask or allow for trusted workspaces.

Payload CMS Tools Visible to Vercel AI SDK

Vercel AI SDK sees stable MCP tool names generated from the Payload CMS integration catalog.

MCP toolSource functionTypeDescription
integration__payload_cms__payload_cms_list_collections payload-cms.payload_cms_list_collections Read List all collections defined in the Payload CMS instance. Returns each collection's slug, labels, and field configuration.
integration__payload_cms__payload_cms_get_collection payload-cms.payload_cms_get_collection Read Get detailed information about a specific collection by its slug. Returns field definitions, labels, default sort, and other configuration.
integration__payload_cms__payload_cms_list_documents payload-cms.payload_cms_list_documents Read List documents in a Payload CMS collection. Supports pagination (limit, page), sorting, and filtering via the where parameter. Returns document IDs, timestamps, and field values.
integration__payload_cms__payload_cms_get_document payload-cms.payload_cms_get_document Read Get detailed information about a specific document by its ID within a collection. Returns all field values, timestamps, and metadata.
integration__payload_cms__payload_cms_create_document payload-cms.payload_cms_create_document Write Create a new document in a Payload CMS collection. Provide the collection slug and a JSON object of field values. The document is created as a draft by default (if versions are enabled on the collection).
integration__payload_cms__payload_cms_list_users payload-cms.payload_cms_list_users Read List users in the Payload CMS instance. Supports pagination with limit and page parameters. Returns user IDs, emails, names, and roles.
integration__payload_cms__payload_cms_get_current_user payload-cms.payload_cms_get_current_user Read Get the profile of the currently authenticated Payload CMS user. Returns email, name, roles, and account metadata.

Related Payload CMS Pages