> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prisme.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# MCP endpoint (JSON-RPC 2.0)

> Model Context Protocol endpoint for AI agents and MCP clients.
Implements `initialize`, `tools/list`, and `tools/call` over
JSON-RPC 2.0.

Available tools: `data_create_collection`, `data_insert`,
`data_query`, `data_get`, `data_update`, `data_upsert`,
`data_delete`, `data_count`, `data_distinct`, `data_aggregate`.
Tool arguments mirror the REST payloads documented above.
Rate limit: 100 requests/min per user.




## OpenAPI

````yaml /api-reference/ai-collection/swagger.yml post /ai-collection/mcp
openapi: 3.0.3
info:
  version: 1.0.0
  title: Collections API
  description: |
    Public REST API for the Prisme.ai Collections workspace: named collections
    of structured records with typed schemas, MongoDB-style querying,
    aggregations, and an MCP (JSON-RPC 2.0) endpoint for AI agents.

    Records are isolated per owner (user or agent); a collection can be shared
    with additional agents through its `agent_ids` list. Every write emits an
    audit event.
  contact:
    name: Prisme.ai
    url: https://prisme.ai
servers:
  - url: https://{host}/v2/workspaces/slug:ai-collection-v3/webhooks
    description: Prisme.ai workspace webhooks
    variables:
      host:
        default: api.studio.prisme.ai
        description: API host (override for self-hosted or sandbox)
security:
  - BearerAuth: []
  - OrgApiKeyAuth: []
tags:
  - name: Collections
    description: Create, list, read, update, and delete collections (metadata and schema).
  - name: Records
    description: Insert, query, read, update, upsert, and delete records in a collection.
  - name: Analytics
    description: Count, distinct values, and aggregations (sum, avg, count with grouping).
  - name: MCP
    description: >-
      JSON-RPC 2.0 endpoint exposing the `data_*` tools to AI agents and MCP
      clients.
paths:
  /ai-collection/mcp:
    post:
      tags:
        - MCP
      summary: MCP endpoint (JSON-RPC 2.0)
      description: |
        Model Context Protocol endpoint for AI agents and MCP clients.
        Implements `initialize`, `tools/list`, and `tools/call` over
        JSON-RPC 2.0.

        Available tools: `data_create_collection`, `data_insert`,
        `data_query`, `data_get`, `data_update`, `data_upsert`,
        `data_delete`, `data_count`, `data_distinct`, `data_aggregate`.
        Tool arguments mirror the REST payloads documented above.
        Rate limit: 100 requests/min per user.
      operationId: mcpEndpoint
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
              properties:
                jsonrpc:
                  type: string
                  enum:
                    - '2.0'
                id:
                  oneOf:
                    - type: string
                    - type: integer
                method:
                  type: string
                  enum:
                    - initialize
                    - tools/list
                    - tools/call
                params:
                  type: object
                  description: >
                    For `tools/call`: `{ "name": "<tool>", "arguments": { ... }
                    }`.
                  additionalProperties: true
            example:
              jsonrpc: '2.0'
              id: 1
              method: tools/call
              params:
                name: data_query
                arguments:
                  collection_id: 3f2a9c1e-...
                  filter:
                    status: active
                  limit: 20
      responses:
        '200':
          description: JSON-RPC 2.0 response (`result` on success, `error` on failure).
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                    enum:
                      - '2.0'
                  id:
                    oneOf:
                      - type: string
                      - type: integer
                  result:
                    type: object
                    additionalProperties: true
                  error:
                    type: object
                    properties:
                      code:
                        type: integer
                      message:
                        type: string
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'User session JWT. Send as `Authorization: Bearer <token>`.'
    OrgApiKeyAuth:
      type: apiKey
      in: header
      name: x-prismeai-api-key
      description: Organization-scoped API key.

````