> For the complete documentation index, see [llms.txt](https://islamu.gitbook.io/islamu-event/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://islamu.gitbook.io/islamu-event/documentation/readme/integrations-and-ai/mcp.md).

# MCP

Expose the optional stateless proposal-first MCP endpoint with API-key, scope, and tenant controls.

ISLAMU Event exposes an optional, integrated Model Context Protocol server endpoint at `/mcp` using stateless **Streamable HTTP**. This enables external AI agents (such as Claude Desktop, OpenCode, or custom LangChain agents) to query events and propose administrative actions within strict governance guardrails.

***

## 1. Enablement & Authentication

* **Startup Gate**: Configured via `MCP_ENABLED=true` in environment variables. If disabled, `/mcp` returns `404 Not Found`.
* **Direct Authentication**: External MCP clients authenticate using dedicated API keys passed via `X-API-Key: <key>` (see [Direct API Authentication](/islamu-event/documentation/readme/security-and-identity/authentication.md#direct-api-authentication)).
* **Multi-Tenant Scoping**: All MCP operations enforce strict [Multi-Tenancy Boundaries](/islamu-event/documentation/readme/security-and-identity/multi-tenancy.md). Calls without a resolved tenant context fail closed.

***

## 2. Capability Model & Human-in-the-Loop Safeguards

* **Anonymous Tools**: When called without authentication, tools provide access strictly to public, published event discovery.
* **Scoped Reads (`mcp:read`)**: Authenticated tools allow querying private attendee counts, drafts, and organizer reports according to caller permissions (see [Authorization](/islamu-event/documentation/readme/security-and-identity/authorization.md)).
* **Proposal-First Mutations (`mcp:propose`)**: AI agents are **strictly prohibited** from mutating database repositories directly. Modifying tools (such as creating an event draft or editing ticket prices) create pending **Proposals** that require human organizer review and approval in the management console before domain changes take effect.

***

## 3. Server Capability Boundaries

The integrated MCP server implements the official Streamable HTTP standard:

* Does **not** implement legacy SSE or persistent WebSocket sessions.
* Does **not** permit arbitrary remote code execution or SQL evaluation.
* Does **not** allow AI models to bypass [HAL Action Affordances](/islamu-event/documentation/readme/security-and-identity/authorization.md#the-golden-rule-of-client-ui-affordances).

***

## Related Guides & Next Steps

* [**Direct API Authentication**](/islamu-event/documentation/readme/security-and-identity/authentication.md#direct-api-authentication) — Provision and manage API keys for external integrations.
* [**Authorization & Access Control**](/islamu-event/documentation/readme/security-and-identity/authorization.md) — Understand how MediatR permissions guard data reads.
* [**Multi-Tenancy Architecture**](/islamu-event/documentation/readme/security-and-identity/multi-tenancy.md) — Verify tenant scoping on API and MCP requests.
* [**Local Development Workflow**](/islamu-event/documentation/readme/contributing/local-development.md) — Test MCP endpoints locally with .NET Aspire.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://islamu.gitbook.io/islamu-event/documentation/readme/integrations-and-ai/mcp.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
