data
Sanity MCP Integration for OpenAI Agents SDK
Connect Sanity to OpenAI Agents SDK through the local KosmoKrator MCP gateway with scoped tools, credentials, and write policy.
Connect Sanity to OpenAI Agents SDK
Attach KosmoKrator integration tools to OpenAI Agents SDK workflows through a local MCP gateway.
Start the KosmoKrator MCP gateway locally and point the OpenAI Agents SDK MCP tool at that process or wrapper. The gateway is local, scoped to this integration, and starts with
--write=deny so OpenAI Agents can inspect read-capable tools without receiving write access by default.
Sanity MCP Config for OpenAI Agents SDK
Use headless JSON commands for CI-style execution and MCP for agent tool discovery.
{
"mcpServers": {
"kosmokrator-sanity": {
"type": "stdio",
"command": "kosmo",
"args": [
"mcp:serve",
"--integration=sanity",
"--write=deny"
]
}
}
} Run the Gateway Manually
kosmokrator mcp:serve --integration=sanity --write=deny Why Use KosmoKrator Here
Expose only Sanity instead of a broad multi-service tool list.
Reuse credentials already configured for the KosmoKrator CLI and Lua runtime.
Start read-only, then opt into ask or allow for trusted workspaces.
Sanity Tools Visible to OpenAI Agents
OpenAI Agents sees stable MCP tool names generated from the Sanity integration catalog.
| MCP tool | Source function | Type | Description |
|---|---|---|---|
integration__sanity__sanity_query_documents | sanity.sanity_query_documents | Read | Query documents in Sanity using GROQ (Graph-Relational Object Queries). Returns matching documents with their fields. |
integration__sanity__sanity_get_document | sanity.sanity_get_document | Read | Retrieve a single Sanity document by its ID. Returns the full document with all fields. |
integration__sanity__sanity_create_document | sanity.sanity_create_document | Write | Create a new document in the Sanity dataset. The document data must include a _type field matching a schema type. |
integration__sanity__sanity_update_document | sanity.sanity_update_document | Write | Update an existing Sanity document by applying a patch with the specified fields. |
integration__sanity__sanity_delete_document | sanity.sanity_delete_document | Write | Delete a document from the Sanity dataset by its ID. This action is permanent. |
integration__sanity__sanity_list_projects | sanity.sanity_list_projects | Read | List all Sanity projects accessible to the authenticated user. Requires a management API token. |
integration__sanity__sanity_get_current_user | sanity.sanity_get_current_user | Read | Get the currently authenticated Sanity user. Useful for verifying credentials and checking user identity. |