KosmoKrator

data

Sanity MCP, CLI, and Lua Integration for AI Agents

Sanity integration docs for AI agents: MCP gateway setup, Sanity CLI commands, Lua API reference, credentials, and function schemas.

7 functions 4 read 3 write API token auth

Sanity for agents

Credentials can be configured manually in web or CLI hosts.

Use this integration from Lua code mode, the headless integrations CLI, or the KosmoKrator MCP gateway. The same package metadata powers all three surfaces.

Machine-Readable Metadata
integration_slug
sanity
route_slug
sanity
package
sanity
auth_strategy
api_token API token
cli_setup_supported
true
cli_runtime_supported
true
mcp_gateway_supported
true
lua_supported
true
supports_multi_account
true

Quick Links

Sanity MCP Client Matrix

Use these pages when a specific agent client or framework needs copy-pasteable MCP setup for Sanity.

Sanity CLI Matrix

Use these pages for direct Sanity CLI workflows in scripts, CI, cron, and agent wrappers.

Function Catalog

FunctionTypeParametersDescription
sanity.sanity_query_documents Read read 2 Query documents in Sanity using GROQ (Graph-Relational Object Queries). Returns matching documents with their fields.
sanity.sanity_get_document Read read 1 Retrieve a single Sanity document by its ID. Returns the full document with all fields.
sanity.sanity_create_document Write write 1 Create a new document in the Sanity dataset. The document data must include a _type field matching a schema type.
sanity.sanity_update_document Write write 2 Update an existing Sanity document by applying a patch with the specified fields.
sanity.sanity_delete_document Write write 1 Delete a document from the Sanity dataset by its ID. This action is permanent.
sanity.sanity_list_projects Read read 0 List all Sanity projects accessible to the authenticated user. Requires a management API token.
sanity.sanity_get_current_user Read read 0 Get the currently authenticated Sanity user. Useful for verifying credentials and checking user identity.