{
  "id": "mcp-2",
  "title": "MCP Server: Stateless Tool Calls with Protocol 2026-07-28",
  "description": "Demonstrates the stateless MCP protocol (revision 2026-07-28) against the IndyKite MCP server: no initialize handshake and no Mcp-Session-Id - every request is self-contained, carrying its protocol metadata in params._meta plus the standard MCP headers. Same environment and tools as the session-based MCP resource.",
  "category": "MCP",
  "tags": [
    "MCP",
    "Model Context Protocol",
    "Stateless Protocol",
    "server/discover",
    "ContX IQ",
    "KBAC",
    "authZEN",
    "AI Integration",
    "LLM Tools"
  ],
  "api": "MCP",
  "language": "Json",
  "lastUpdated": "2026-11-09",
  "openApiEndpoints": [
    "/configs/v1/mcp-servers",
    "/capture/v1/nodes",
    "/capture/v1/relationships",
    "/configs/v1/authorization-policies",
    "/configs/v1/knowledge-queries"
  ],
  "relatedGuides": [
    "/guides/guide-mcp"
  ],
  "commonErrors": [
    {
      "code": "400",
      "message": "unsupported protocol version (JSON-RPC error -32022)",
      "solution": "The requested _meta protocolVersion is not supported by the server. Call server/discover and use one of the revisions listed in result.supportedVersions (2026-07-28 for the stateless style)."
    },
    {
      "code": "400",
      "message": "missing required Mcp-Method header / missing required Mcp-Name header (JSON-RPC error -32020)",
      "solution": "For protocol 2026-07-28 every request must send an Mcp-Method header equal to the JSON-RPC method in the body; tools/call, resources/read and prompts/get additionally require a matching Mcp-Name header."
    }
  ],
  "summary": "This example demonstrates the stateless MCP protocol (revision 2026-07-28) for AI/LLM integration.\n\nProtocol used here:\nStateless MCP protocol, revision 2026-07-28 - no initialize/initialized handshake and no Mcp-Session-Id header. Each request stands on its own:\n- In the body, params._meta carries \"io.modelcontextprotocol/protocolVersion\", \"io.modelcontextprotocol/clientCapabilities\" and optionally \"io.modelcontextprotocol/clientInfo\".\n- In the headers: Mcp-Protocol-Version, Mcp-Method (must equal the JSON-RPC method), and Mcp-Name for tools/call (the tool name) and resources/read (the resource URI).\nNo session is created: responses carry no Mcp-Session-Id header, and a stale Mcp-Session-Id sent by a mixed-version client is ignored when _meta says 2026-07-28 or later.\n\nNew method:\n- server/discover - returns the server's capabilities and the protocol revisions it accepts (result.supportedVersions), so a client can decide which style to speak.\n\nWorkflow:\n1. Call server/discover to confirm 2026-07-28 is supported\n2. List available tools (authzen_evaluate, payment-method-by-license, ...) - statelessly\n3. Execute tools with parameters, one self-contained request per call\n\nRequesting an unsupported revision returns HTTP 400 with JSON-RPC error -32022 (\"unsupported protocol version\") naming the requested and supported versions.\n\nThe session-based flow (see the companion MCP resource) keeps working unchanged - both styles expose the same tools and resources.",
  "usecase": "Scenario: A serverless AI agent (one short-lived invocation per user question) needs to check permissions and retrieve authorized data - holding an MCP session between invocations is impractical.\n\nStateless integration flow:\n1. Agent cold-starts, calls server/discover -> sees \"2026-07-28\" in supportedVersions\n2. User asks: \"Can I drive the company car?\"\n3. Agent sends one self-contained tools/call request:\n   - Headers: Mcp-Protocol-Version: 2026-07-28, Mcp-Method: tools/call, Mcp-Name: authzen_evaluate\n   - Body params: the authzen_evaluate arguments plus the _meta protocol object\n4. MCP evaluates against the KBAC policy and returns {decision: true}\n5. The invocation ends - nothing to tear down, no session to expire\n\nFor data retrieval the same shape applies: one stateless tools/call to payment-method-by-license, the tool named after the Knowledge Query, with its input_params, authorized by the caller's Bearer token.",
  "requirements": "Prerequisites (identical environment to the session-based MCP resource):\n- ServiceAccount credentials: For creating policies, queries, and the MCP Server configuration (Bearer token)\n- AppAgent: Referenced by the MCP Server config as the identity the server uses to call IndyKite APIs at runtime (resolved server-side)\n- User access token: JWT for the subject performing authorization checks\n- Token Introspect configuration: Required to validate user access tokens (referenced by the MCP Server config)\n\nMCP Server endpoint:\n- URL: https://eu.mcp.indykite.com/mcp/v1/{project_gid}\n- Protocol: JSON-RPC 2.0 over HTTP POST - stateless MCP protocol, revision 2026-07-28 (params._meta + Mcp-Protocol-Version / Mcp-Method / Mcp-Name headers; no session)\n\nRequired configurations:\n- MCP Server: Binds the runtime MCP endpoint to an AppAgent + Token Introspect, declares supported OAuth scopes\n- KBAC Policy: Defines authorization rules (e.g., who can drive cars)\n- ContX IQ Policy and Query: Defines data access rules and queries",
  "steps": "Step 1: Create the MCP Server configuration\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST to /configs/v1/mcp-servers\n- Input: AppAgent ID, Token Introspect ID, project ID, supported OAuth scopes\n- Result: MCP Server config ID returned; the runtime MCP endpoint will use this binding\n\nStep 2: Ingest Graph Data\n- Authentication: AppAgent credential (X-IK-ClientKey header)\n- Action: POST nodes (Person, Car) and relationships (DRIVES)\n- Note: Replace bearer-token-sub with actual user's token subject claim\n- Result: Graph ready for authorization queries\n\nStep 3: Create ContX IQ Policy\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST policy for data access through MCP\n- Result: Policy ID returned\n\nStep 4: Create ContX IQ Knowledge Query\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST query with a name and a description; the name becomes the name of its MCP tool, the description the tool's description\n- Important: Write the description for the AI agent: what the query returns and which input_params it needs\n- Result: Query listed via MCP resources, and published as the tool payment-method-by-license\n\nStep 5: Create KBAC Policy\n- Authentication: ServiceAccount credential (Bearer token)\n- Action: POST authZEN policy (e.g., Person can DRIVE Car if DRIVES relationship exists)\n- Result: Policy ID returned, available via authzen_evaluate tool\n\nStep 6: Use the MCP Server statelessly (protocol 2026-07-28)\n- Discover: \"server/discover\" returns capabilities and supportedVersions - no session is created\n- List tools: \"tools/list\" with the _meta object and Mcp-Method header\n- Read the knowledge-queries resource: \"resources/read\" with Mcp-Name set to the resource URI\n- Execute authzen_evaluate: one self-contained \"tools/call\" with Mcp-Name: authzen_evaluate\n- Execute payment-method-by-license: one self-contained \"tools/call\" with Mcp-Name: payment-method-by-license\n- Every request repeats the Bearer token and the _meta protocol object; no Mcp-Session-Id anywhere",
  "graph": {
    "caption": "The graph the example runs on: 20 nodes (5 Person, 3 Car, 1 Bus, 1 Ticket, 1 Laptop, 2 PaymentMethod, 1 Vehicle, 2 LicenseNumber, 1 Loyalty, 1 ConsentPayment, 1 Company, 1 Application) and 22 relationships (DRIVES, HAS, FOR, OWNS, IS_MEMBER, GRANTED, USES). Hover a node for its properties, click it to highlight its neighbourhood.",
    "nodes": [
      {
        "external_id": "bearer-token-sub",
        "type": "Person",
        "is_identity": true,
        "properties": [
          {
            "type": "email",
            "value": "alice@email.com"
          },
          {
            "type": "given_name",
            "value": "Alice"
          },
          {
            "type": "last_name",
            "value": "Smith"
          }
        ]
      },
      {
        "external_id": "knightrider",
        "type": "Person",
        "is_identity": true,
        "properties": [
          {
            "type": "email",
            "value": "knightrider@demo.com"
          },
          {
            "type": "name",
            "value": "Michael Knight"
          }
        ]
      },
      {
        "external_id": "satchmo",
        "type": "Person",
        "is_identity": true,
        "properties": [
          {
            "type": "email",
            "value": "satchmo@demo.com"
          },
          {
            "type": "name",
            "value": "Louis Armstrong"
          }
        ]
      },
      {
        "external_id": "karel",
        "type": "Person",
        "is_identity": true,
        "properties": [
          {
            "type": "email",
            "value": "karel@demo.com"
          },
          {
            "type": "name",
            "value": "Karel Plihal"
          }
        ]
      },
      {
        "external_id": "kitt",
        "type": "Car",
        "is_identity": false,
        "properties": [
          {
            "type": "manufacturer",
            "value": "pontiac"
          },
          {
            "type": "model",
            "value": "Firebird"
          }
        ]
      },
      {
        "external_id": "cadillacv16",
        "type": "Car",
        "is_identity": false,
        "properties": [
          {
            "type": "manufacturer",
            "value": "Cadillac"
          },
          {
            "type": "model",
            "value": "V-16"
          }
        ]
      },
      {
        "external_id": "harmonika",
        "type": "Bus",
        "is_identity": false,
        "properties": [
          {
            "type": "manufacturer",
            "value": "Ikarus"
          },
          {
            "type": "model",
            "value": "280"
          }
        ]
      },
      {
        "external_id": "listek",
        "type": "Ticket",
        "is_identity": false,
        "properties": []
      },
      {
        "external_id": "airbook-xyz",
        "type": "Laptop",
        "is_identity": false,
        "properties": []
      },
      {
        "external_id": "ole",
        "type": "Person",
        "is_identity": true,
        "properties": [
          {
            "type": "email",
            "value": "ole@yahoo.co.uk"
          },
          {
            "type": "given_name",
            "value": "ole"
          },
          {
            "type": "last_name",
            "value": "einar"
          }
        ]
      },
      {
        "external_id": "cb2563",
        "type": "PaymentMethod",
        "is_identity": false,
        "properties": [
          {
            "type": "payment_name",
            "value": "Credit Card Parking"
          },
          {
            "type": "preference",
            "value": "Pay as you go"
          }
        ]
      },
      {
        "external_id": "carOle",
        "type": "Vehicle",
        "is_identity": false,
        "properties": [
          {
            "type": "category",
            "value": "Car"
          },
          {
            "type": "is_active",
            "value": true
          },
          {
            "type": "vin",
            "value": "pcfjnm78"
          }
        ]
      },
      {
        "external_id": "licenseOle",
        "type": "LicenseNumber",
        "is_identity": false,
        "properties": [
          {
            "type": "status",
            "value": "Active"
          },
          {
            "type": "number",
            "value": "AL98745"
          }
        ]
      },
      {
        "external_id": "licenseAlice",
        "type": "LicenseNumber",
        "is_identity": false,
        "properties": [
          {
            "type": "status",
            "value": "Active"
          },
          {
            "type": "number",
            "value": "BTYUMN"
          }
        ]
      },
      {
        "external_id": "loyalty1",
        "type": "Loyalty",
        "is_identity": false,
        "properties": [
          {
            "type": "name",
            "value": "Parking Loyalty Plan"
          }
        ]
      },
      {
        "external_id": "consent1",
        "type": "ConsentPayment",
        "is_identity": false,
        "properties": [
          {
            "type": "name",
            "value": "Consent Parking"
          }
        ]
      },
      {
        "external_id": "companyParking",
        "type": "Company",
        "is_identity": false,
        "properties": [
          {
            "type": "name",
            "value": "City Parking Inc"
          }
        ]
      },
      {
        "external_id": "applicationParking",
        "type": "Application",
        "is_identity": false,
        "properties": [
          {
            "type": "name",
            "value": "City Mall Parking"
          }
        ]
      },
      {
        "external_id": "cb8521",
        "type": "PaymentMethod"
      },
      {
        "external_id": "carAlice",
        "type": "Car"
      }
    ],
    "relationships": [
      {
        "source": "knightrider",
        "target": "kitt",
        "type": "DRIVES",
        "properties": []
      },
      {
        "source": "satchmo",
        "target": "cadillacv16",
        "type": "DRIVES",
        "properties": []
      },
      {
        "source": "karel",
        "target": "listek",
        "type": "HAS",
        "properties": []
      },
      {
        "source": "listek",
        "target": "harmonika",
        "type": "FOR",
        "properties": []
      },
      {
        "source": "karel",
        "target": "airbook-xyz",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "airbook-xyz",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "knightrider",
        "target": "kitt",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "cadillacv16",
        "type": "DRIVES",
        "properties": []
      },
      {
        "source": "ole",
        "target": "cb2563",
        "type": "HAS",
        "properties": []
      },
      {
        "source": "ole",
        "target": "carOle",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "ole",
        "target": "loyalty1",
        "type": "IS_MEMBER",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "loyalty1",
        "type": "IS_MEMBER",
        "properties": []
      },
      {
        "source": "ole",
        "target": "consent1",
        "type": "GRANTED",
        "properties": []
      },
      {
        "source": "carOle",
        "target": "licenseOle",
        "type": "HAS",
        "properties": []
      },
      {
        "source": "consent1",
        "target": "cb2563",
        "type": "GRANTED",
        "properties": []
      },
      {
        "source": "companyParking",
        "target": "applicationParking",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "applicationParking",
        "target": "consent1",
        "type": "USES",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "cb8521",
        "type": "HAS",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "carAlice",
        "type": "OWNS",
        "properties": []
      },
      {
        "source": "bearer-token-sub",
        "target": "consent1",
        "type": "GRANTED",
        "properties": []
      },
      {
        "source": "carAlice",
        "target": "licenseAlice",
        "type": "HAS",
        "properties": []
      },
      {
        "source": "consent1",
        "target": "cb8521",
        "type": "GRANTED",
        "properties": []
      }
    ]
  },
  "code": [
    {
      "step": "Step 1",
      "description": "Create the MCP Server configuration. This binds the runtime MCP endpoint (https://<region>.mcp.indykite.com/mcp/v1/<project_gid>) to an AppAgent (the identity the server uses to call IndyKite APIs at runtime, resolved server-side) and a Token Introspect config (used to validate Bearer tokens), and declares the OAuth scopes the server advertises in its .well-known/oauth-protected-resource metadata. Replace gid-of-app-agent and gid-of-token-introspect with the IDs returned in the environment-setup steps.",
      "filename": "POST https://eu.api.indykite.com/configs/v1/mcp-servers",
      "language": "Json",
      "ingest": {
        "app_agent_id": "gid-of-app-agent",
        "token_introspect_id": "gid-of-token-introspect",
        "project_id": "gid-of-project",
        "name": "mcp-server-name",
        "display_name": "MCP Server name",
        "description": "MCP Server configuration description",
        "enabled": true,
        "scopes_supported": [
          "name",
          "email"
        ]
      }
    },
    {
      "step": "Step 2",
      "description": "Capture the nodes needed for this use case (replace bearer-token-sub with actual Bearer token sub).",
      "filename": "POST https://eu.api.indykite.com/capture/v1/nodes/",
      "language": "Json",
      "ingest": {
        "nodes": [
          {
            "external_id": "bearer-token-sub",
            "is_identity": true,
            "type": "Person",
            "properties": [
              {
                "type": "email",
                "value": "alice@email.com"
              },
              {
                "type": "given_name",
                "value": "Alice"
              },
              {
                "type": "last_name",
                "value": "Smith"
              }
            ]
          },
          {
            "external_id": "knightrider",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "knightrider@demo.com"
              },
              {
                "type": "name",
                "value": "Michael Knight"
              }
            ]
          },
          {
            "external_id": "satchmo",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "satchmo@demo.com"
              },
              {
                "type": "name",
                "value": "Louis Armstrong"
              }
            ]
          },
          {
            "external_id": "karel",
            "type": "Person",
            "is_identity": true,
            "properties": [
              {
                "type": "email",
                "value": "karel@demo.com"
              },
              {
                "type": "name",
                "value": "Karel Plihal"
              }
            ]
          },
          {
            "external_id": "kitt",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "pontiac"
              },
              {
                "type": "model",
                "value": "Firebird"
              }
            ]
          },
          {
            "external_id": "cadillacv16",
            "type": "Car",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Cadillac"
              },
              {
                "type": "model",
                "value": "V-16"
              }
            ]
          },
          {
            "external_id": "harmonika",
            "type": "Bus",
            "is_identity": false,
            "properties": [
              {
                "type": "manufacturer",
                "value": "Ikarus"
              },
              {
                "type": "model",
                "value": "280"
              }
            ]
          },
          {
            "external_id": "listek",
            "type": "Ticket",
            "is_identity": false
          },
          {
            "external_id": "airbook-xyz",
            "type": "Laptop",
            "is_identity": false
          },
          {
            "external_id": "ole",
            "is_identity": true,
            "type": "Person",
            "properties": [
              {
                "type": "email",
                "value": "ole@yahoo.co.uk"
              },
              {
                "type": "given_name",
                "value": "ole"
              },
              {
                "type": "last_name",
                "value": "einar"
              }
            ]
          },
          {
            "external_id": "cb2563",
            "type": "PaymentMethod",
            "properties": [
              {
                "type": "payment_name",
                "value": "Credit Card Parking"
              },
              {
                "type": "preference",
                "value": "Pay as you go"
              }
            ]
          },
          {
            "external_id": "carOle",
            "type": "Vehicle",
            "properties": [
              {
                "type": "category",
                "value": "Car"
              },
              {
                "type": "is_active",
                "value": true
              },
              {
                "type": "vin",
                "value": "pcfjnm78"
              }
            ]
          },
          {
            "external_id": "licenseOle",
            "type": "LicenseNumber",
            "properties": [
              {
                "type": "status",
                "value": "Active"
              },
              {
                "type": "number",
                "value": "AL98745",
                "metadata": {
                  "assurance_level": 3,
                  "source": "BRREG"
                }
              }
            ]
          },
          {
            "external_id": "licenseAlice",
            "type": "LicenseNumber",
            "properties": [
              {
                "type": "status",
                "value": "Active"
              },
              {
                "type": "number",
                "value": "BTYUMN",
                "metadata": {
                  "assurance_level": 3,
                  "source": "BRREG"
                }
              }
            ]
          },
          {
            "external_id": "loyalty1",
            "type": "Loyalty",
            "properties": [
              {
                "type": "name",
                "value": "Parking Loyalty Plan"
              }
            ]
          },
          {
            "external_id": "consent1",
            "type": "ConsentPayment",
            "properties": [
              {
                "type": "name",
                "value": "Consent Parking"
              }
            ]
          },
          {
            "external_id": "companyParking",
            "type": "Company",
            "properties": [
              {
                "type": "name",
                "value": "City Parking Inc"
              }
            ]
          },
          {
            "external_id": "applicationParking",
            "type": "Application",
            "properties": [
              {
                "type": "name",
                "value": "City Mall Parking"
              }
            ]
          }
        ]
      }
    },
    {
      "step": "Step 2",
      "description": "Capture the relationships needed for this use case (replace bearer-token-sub with actual Bearer token sub).",
      "filename": "POST https://eu.api.indykite.com/capture/v1/relationships/",
      "language": "Json",
      "ingest": {
        "relationships": [
          {
            "source": {
              "external_id": "knightrider",
              "type": "Person"
            },
            "target": {
              "external_id": "kitt",
              "type": "Car"
            },
            "type": "DRIVES"
          },
          {
            "source": {
              "external_id": "satchmo",
              "type": "Person"
            },
            "target": {
              "external_id": "cadillacv16",
              "type": "Car"
            },
            "type": "DRIVES"
          },
          {
            "source": {
              "external_id": "karel",
              "type": "Person"
            },
            "target": {
              "external_id": "listek",
              "type": "Ticket"
            },
            "type": "HAS"
          },
          {
            "source": {
              "external_id": "listek",
              "type": "Ticket"
            },
            "target": {
              "external_id": "harmonika",
              "type": "Bus"
            },
            "type": "FOR"
          },
          {
            "source": {
              "external_id": "karel",
              "type": "Person"
            },
            "target": {
              "external_id": "airbook-xyz",
              "type": "Laptop"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "airbook-xyz",
              "type": "Laptop"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "knightrider",
              "type": "Person"
            },
            "target": {
              "external_id": "kitt",
              "type": "Car"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "cadillacv16",
              "type": "Car"
            },
            "type": "DRIVES"
          },
          {
            "source": {
              "external_id": "ole",
              "type": "Person"
            },
            "target": {
              "external_id": "cb2563",
              "type": "PaymentMethod"
            },
            "type": "HAS"
          },
          {
            "source": {
              "external_id": "ole",
              "type": "Person"
            },
            "target": {
              "external_id": "carOle",
              "type": "Car"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "ole",
              "type": "Person"
            },
            "target": {
              "external_id": "loyalty1",
              "type": "Loyalty"
            },
            "type": "IS_MEMBER"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "loyalty1",
              "type": "Loyalty"
            },
            "type": "IS_MEMBER"
          },
          {
            "source": {
              "external_id": "ole",
              "type": "Person"
            },
            "target": {
              "external_id": "consent1",
              "type": "ConsentPayment"
            },
            "type": "GRANTED"
          },
          {
            "source": {
              "external_id": "carOle",
              "type": "Car"
            },
            "target": {
              "external_id": "licenseOle",
              "type": "LicenseNumber"
            },
            "type": "HAS"
          },
          {
            "source": {
              "external_id": "consent1",
              "type": "ConsentPayment"
            },
            "target": {
              "external_id": "cb2563",
              "type": "PaymentMethod"
            },
            "type": "GRANTED"
          },
          {
            "source": {
              "external_id": "companyParking",
              "type": "Company"
            },
            "target": {
              "external_id": "applicationParking",
              "type": "Application"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "applicationParking",
              "type": "Application"
            },
            "target": {
              "external_id": "consent1",
              "type": "ConsentPayment"
            },
            "type": "USES"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "cb8521",
              "type": "PaymentMethod"
            },
            "type": "HAS"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "carAlice",
              "type": "Car"
            },
            "type": "OWNS"
          },
          {
            "source": {
              "external_id": "bearer-token-sub",
              "type": "Person"
            },
            "target": {
              "external_id": "consent1",
              "type": "ConsentPayment"
            },
            "type": "GRANTED"
          },
          {
            "source": {
              "external_id": "carAlice",
              "type": "Car"
            },
            "target": {
              "external_id": "licenseAlice",
              "type": "LicenseNumber"
            },
            "type": "HAS"
          },
          {
            "source": {
              "external_id": "consent1",
              "type": "ConsentPayment"
            },
            "target": {
              "external_id": "cb8521",
              "type": "PaymentMethod"
            },
            "type": "GRANTED"
          }
        ]
      }
    },
    {
      "step": "Step 3",
      "description": "Create a CIQ Policy which designates the Subject node, the cypher and the nodes allowed to be read.",
      "filename": "POST https://eu.api.indykite.com/configs/v1/authorization-policies",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "description of policy",
        "display_name": "policy name",
        "name": "policy-name",
        "policy": "{\"meta\":{\"policy_version\":\"1.0-ciq\"},\"subject\":{\"type\":\"Person\"},\"condition\":{\"cypher\":\"MATCH (subject:Person) MATCH (app:Application)-[:USES]->(consentpayment:ConsentPayment)<-[:GRANTED]-(subject)-[:HAS]->(paymentmethod:PaymentMethod) MATCH (subject)-[:IS_MEMBER]->(loyalty:Loyalty) MATCH (subject)-[:OWNS]->(car:Car)-[:HAS]->(ln:LicenseNumber)\",\"filter\":[{\"operator\":\"AND\",\"operands\":[{\"attribute\":\"subject.external_id\",\"operator\":\"=\",\"value\":\"$token.sub\"},{\"attribute\":\"subject.property.email\",\"operator\":\"=\",\"value\":\"$subject_email\"}]}]},\"allowed_reads\":{\"nodes\":[\"ln.*\",\"app.*\",\"paymentmethod.external_id\"]}}",
        "status": "ACTIVE",
        "tags": []
      }
    },
    {
      "step": "Step 4",
      "description": "Create a CIQ Query in the context of the policy. The MCP server publishes it as a tool named after the query (payment-method-by-license) and described by its description, so give in the description all the necessary information an agent would need to call that tool.",
      "filename": "POST https://eu.api.indykite.com/configs/v1/knowledge-queries",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "Returns the payment method of the caller's car with the given license plate. input_params: {subject_email: (required) the caller's email, license: (required) car license plate}. Auth: Bearer token required; the policy binds the subject to the token 'sub' claim. Returns: payment_method_external_id",
        "display_name": "Payment method by license plate",
        "name": "payment-method-by-license",
        "policy_id": "your_policy_gid",
        "query": "{\"nodes\":[\"paymentmethod.external_id\"],\"filter\":{\"attribute\":\"ln.property.number\",\"operator\":\"=\",\"value\":\"$license\"}}",
        "status": "ACTIVE"
      }
    },
    {
      "step": "Step 5",
      "description": "Create a KBAC Policy which designates the conditions to drive a car. ",
      "filename": "POST https://eu.api.indykite.com/configs/v1/authorization-policies",
      "language": "Json",
      "ingest": {
        "project_id": "your_project_gid",
        "description": "description of policy",
        "display_name": "policy name",
        "name": "policy-name",
        "policy": "{\"meta\":{\"policy_version\":\"2.0-kbac\"},\"subject\":{\"type\":\"Person\"},\"actions\":[\"CAN_DRIVE\"],\"resource\":{\"type\":\"Car\"},\"condition\":{\"cypher\":\"MATCH (subject:Person)-[:DRIVES]->(resource:Car)\"}}",
        "status": "ACTIVE",
        "tags": []
      }
    },
    {
      "step": "Step 6",
      "description": "Discover the server. server/discover is a stateless-protocol method: it returns the server's capabilities and the protocol revisions it accepts, without creating a session. Note the _meta object in params and the Mcp-Protocol-Version / Mcp-Method headers - the stateless request signature used by every call below.",
      "filename": "POST https://eu.mcp.indykite.com/mcp/v1/<project_gid>",
      "language": "JsonRPC",
      "code": "curl -v -i -X POST https://eu.mcp.indykite.com/mcp/v1/<project_gid> -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Authorization: Bearer $BEARER_TOKEN\" -H \"Mcp-Protocol-Version: 2026-07-28\" -H \"Mcp-Method: server/discover\" -d '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 1,\n      \"method\": \"server/discover\",\n      \"params\": {\n        \"_meta\": {\n          \"io.modelcontextprotocol/protocolVersion\": \"2026-07-28\",\n          \"io.modelcontextprotocol/clientCapabilities\": {},\n          \"io.modelcontextprotocol/clientInfo\": {\"name\": \"curl\", \"version\": \"1.0\"}\n        }\n      }\n    }'"
    },
    {
      "description": "server/discover response: the supported protocol revisions and capabilities. No Mcp-Session-Id header is returned - no session exists.",
      "language": "JsonRPC",
      "code": "\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"result\": {\n    \"resultType\": \"complete\",\n    \"_meta\": {\n      \"io.modelcontextprotocol/serverInfo\": {\"name\": \"<server name>\", \"version\": \"<server version>\"}\n    },\n    \"supportedVersions\": [\"2026-07-28\", \"2025-11-25\", \"2025-06-18\", \"2025-03-26\", \"2024-11-05\"],\n    \"capabilities\": {\n      \"resources\": {},\n      \"tools\": {}\n    },\n    \"instructions\": \"<server instructions for the AI agent>\"\n  }\n}"
    },
    {
      "description": "List tools statelessly. Same tools as the session-based flow (authzen_evaluate, authzen_evaluations, authzen_search_action, authzen_search_resource, one tool per active Knowledge Query such as payment-method-by-license, and the deprecated ciq_execute) - only the request framing differs.",
      "filename": "POST https://eu.mcp.indykite.com/mcp/v1/<project_gid>",
      "language": "JsonRPC",
      "code": "curl -v -i -X POST https://eu.mcp.indykite.com/mcp/v1/<project_gid> -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Authorization: Bearer $BEARER_TOKEN\" -H \"Mcp-Protocol-Version: 2026-07-28\" -H \"Mcp-Method: tools/list\" -d '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 2,\n      \"method\": \"tools/list\",\n      \"params\": {\n        \"_meta\": {\n          \"io.modelcontextprotocol/protocolVersion\": \"2026-07-28\",\n          \"io.modelcontextprotocol/clientCapabilities\": {}\n        }\n      }\n    }'"
    },
    {
      "description": "Read the knowledge-queries resource statelessly. For resources/read the Mcp-Name header carries the resource URI and must match the uri in the body.",
      "filename": "POST https://eu.mcp.indykite.com/mcp/v1/<project_gid>",
      "language": "JsonRPC",
      "code": "curl -v -i -X POST https://eu.mcp.indykite.com/mcp/v1/<project_gid> -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Authorization: Bearer $BEARER_TOKEN\" -H \"Mcp-Protocol-Version: 2026-07-28\" -H \"Mcp-Method: resources/read\" -H \"Mcp-Name: indykite://knowledge-queries/\" -d '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 3,\n      \"method\": \"resources/read\",\n      \"params\": {\n        \"uri\": \"indykite://knowledge-queries/\",\n        \"_meta\": {\n          \"io.modelcontextprotocol/protocolVersion\": \"2026-07-28\",\n          \"io.modelcontextprotocol/clientCapabilities\": {}\n        }\n      }\n    }'"
    },
    {
      "description": "Call the authzen_evaluate tool in one self-contained request: Mcp-Method mirrors the JSON-RPC method, Mcp-Name names the tool, and _meta sits in params next to the tool arguments. The KBAC policy decides whether the Bearer token's subject can drive the car.",
      "filename": "POST https://eu.mcp.indykite.com/mcp/v1/<project_gid>",
      "language": "JsonRPC",
      "code": "curl -v -i -X POST https://eu.mcp.indykite.com/mcp/v1/<project_gid> -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Authorization: Bearer $BEARER_TOKEN\" -H \"Mcp-Protocol-Version: 2026-07-28\" -H \"Mcp-Method: tools/call\" -H \"Mcp-Name: authzen_evaluate\" -d '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 4,\n      \"method\": \"tools/call\",\n      \"params\": {\n        \"name\": \"authzen_evaluate\",\n        \"arguments\": {\n          \"subject_type\": \"Person\",\n          \"subject_id\": <bearer-token-sub>,\n          \"resource_type\": \"Car\",\n          \"resource_id\": \"cadillacv16\",\n          \"action_name\": \"CAN_DRIVE\"\n        },\n        \"_meta\": {\n          \"io.modelcontextprotocol/protocolVersion\": \"2026-07-28\",\n          \"io.modelcontextprotocol/clientCapabilities\": {}\n        }\n      }\n    }'"
    },
    {
      "description": "Authzen_evaluate tool response - identical to the session-based flow, with no Mcp-Session-Id header.",
      "language": "JsonRPC",
      "code": "\n{\n    \"jsonrpc\":\"2.0\",\n    \"id\":4,\n    \"result\":{\n        \"content\":[\n        {\n        \"type\":\"text\",\n        \"text\": {\"decision\":true}\n        }\n        ]\n    }\n}"
    },
    {
      "description": "Call the payment-method-by-license tool statelessly to get the payment method designated by the CIQ policy for the subject authorized by the Bearer access token. Mcp-Name names the tool, which is the Knowledge Query's name.",
      "filename": "POST https://eu.mcp.indykite.com/mcp/v1/<project_gid>",
      "language": "JsonRPC",
      "code": "curl -v -i -X POST https://eu.mcp.indykite.com/mcp/v1/<project_gid> -H \"Content-Type: application/json\" -H \"Accept: application/json, text/event-stream\" -H \"Authorization: Bearer $BEARER_TOKEN\" -H \"Mcp-Protocol-Version: 2026-07-28\" -H \"Mcp-Method: tools/call\" -H \"Mcp-Name: payment-method-by-license\" -d '{\n      \"jsonrpc\": \"2.0\",\n      \"id\": 5,\n      \"method\": \"tools/call\",\n      \"params\": {\n        \"name\": \"payment-method-by-license\",\n        \"arguments\": {\n          \"input_params\": {\"license\": \"BTYUMN\",\"subject_email\": \"alice@email.com\"}\n        },\n        \"_meta\": {\n          \"io.modelcontextprotocol/protocolVersion\": \"2026-07-28\",\n          \"io.modelcontextprotocol/clientCapabilities\": {}\n        }\n      }\n    }'"
    },
    {
      "description": "Error contract: requesting a protocol revision the server does not support returns HTTP 400 with JSON-RPC error -32022, naming the requested and supported versions.",
      "language": "JsonRPC",
      "code": "\n{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 2,\n  \"error\": {\n    \"code\": -32022,\n    \"message\": \"unsupported protocol version\",\n    \"data\": {\n      \"requested\": \"2099-01-01\",\n      \"supported\": [\"2026-07-28\", \"2025-11-25\", \"2025-06-18\", \"2025-03-26\", \"2024-11-05\"]\n    }\n  }\n}"
    }
  ],
  "links": {
    "html": "/resources/mcp-2",
    "markdown": "/resources/mcp-2.md",
    "openApi": "https://openapi.indykite.com/"
  }
}