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

# Quest MCP Server

> Connect AI assistants and research workflows directly to NeuroFusion quests, datasets, exports, and interactive HTML artifacts via Model Context Protocol (MCP).

The **NeuroFusion Quest MCP Server** exposes your NeuroFusion workspace to [Model Context Protocol (MCP)](https://modelcontextprotocol.io) clients — including **Claude**, **VS Code / GitHub Copilot**, **Cursor**, and custom research agents — over a standards-compliant stateless Streamable HTTP endpoint (`/mcp`).

## Capabilities

The server covers three core research workflows across **31 tools** and **6 resources**:

| Domain | What You Can Do |
| - | - |
| **Quest Creation & Lifecycle** | Discover organizations, list and inspect quests, create or update draft quests, generate jsPsych 8 experiments with AI, publish/unpublish, clone, manage config history and rollbacks, organize cohorts/subjects, and upload stimulus media |
| **Dataset Management & Exports** | Summarize datasets by type and URL parameters, filter and paginate datasets, inspect inline or Azure Blob payloads, list participant sessions, run audited deletions, and trigger async `individual_zip` or `combined_csv` exports with temporary SAS download URLs |
| **Quest Artifacts** | List, read, create, update, publish/unpublish, and delete interactive HTML research artifacts attached to a quest |

## Endpoint & Transport

| Property | Value |
| - | - |
| **Production MCP Endpoint** | `https://neurofusionbackendprd.azurewebsites.net/mcp` |
| **OAuth Consent UI** | `https://usefusion.ai/oauth/authorize` |
| **Local Development Endpoint** | `http://localhost:4000/mcp` |
| **Transport** | Stateless Streamable HTTP (`POST /mcp`, JSON responses) |
| **Protocol & Auth Spec** | MCP `2026-07-28` (OAuth 2.1 + PKCE `S256` + RFC 9728 / RFC 8414 / RFC 8707 / RFC 9207) |
| **Server Identifier** | `neurofusion-quest-mcp` |

> [!NOTE]
>
> The server runs in **stateless mode** per the MCP `2026-07-28` Streamable HTTP specification. Send all JSON-RPC requests with `POST /mcp`. `GET /mcp` and `DELETE /mcp` return `405 Method Not Allowed`.

## Quick Connect

Because the server implements full OAuth 2.1 discovery (Protected Resource Metadata, Authorization Server Metadata, Client ID Metadata Documents, and Dynamic Client Registration), modern MCP clients automatically discover endpoints and guide you through signing in with your existing NeuroFusion Nostr account.

> [tab] VS Code / GitHub Copilot
>
> Add the server to your `.vscode/mcp.json` (workspace) or user MCP settings:
>
> ```json theme={null}
> {
>   "servers": {
>     "neurofusion": {
>       "type": "http",
>       "url": "https://neurofusionbackendprd.azurewebsites.net/mcp"
>     }
>   }
> }
> ```
>
> When you first invoke a NeuroFusion tool, VS Code opens your browser to the NeuroFusion OAuth consent screen (`/oauth/authorize`). Sign in with your Nostr account, review the requested scopes, and click **Approve**.

> [tab] Cursor
>
> Add the server to `~/.cursor/mcp.json` or `.cursor/mcp.json`:
>
> ```json theme={null}
> {
>   "mcpServers": {
>     "neurofusion": {
>       "url": "https://neurofusionbackendprd.azurewebsites.net/mcp"
>     }
>   }
> }
> ```
>
> Cursor automatically discovers the OAuth endpoints via `/.well-known/oauth-protected-resource/mcp` and prompts you to authorize in the browser.

> [tab] Claude / Remote MCP Clients
>
> In clients that support remote OAuth MCP servers (such as Claude web/desktop connectors):
>
> 1. Add a new remote MCP server with URL `https://neurofusionbackendprd.azurewebsites.net/mcp`.
> 2. Complete the browser-based NeuroFusion OAuth sign-in and scope consent flow.
> 3. Start asking your assistant to list your organizations, design quests, inspect datasets, or build interactive HTML artifacts.

## Security & Compliance Guarantees

The MCP server enforces the same governance and compliance boundaries as the NeuroFusion web dashboard:

* **Dual Authorization (Defense in Depth)**: Every tool and resource requires **both** the matching OAuth 2.1 scope (for example, `quests:write`) **and** your existing NeuroFusion [organization role and permissions](https://docs.usefusion.ai/organizations/members-and-permissions.md) (for example, `quest.create` or `data.delete`).
* **Strict Token Isolation**: MCP access tokens (`token_use: "mcp_access"`) are audience-bound (`aud`) to `/mcp` and are rejected on `/api/*` REST endpoints. Conversely, standard NeuroFusion web Nostr JWTs are rejected on `/mcp`.
* **Compliance Audit Trail**: Dataset reads (`list_quest_datasets`, `get_dataset_content`), exports (`create_dataset_export`), dataset deletions (`delete_quest_datasets`), and quest soft-deletions (`delete_quest`) all write to the [Data Audit Trail](https://docs.usefusion.ai/data/audit-trail.md) with `source: "mcp"`.
* **Safe Destructive Operations**: Deleting a quest with collected data returns an impact summary and refuses unless `confirmDataLoss: true` is explicitly passed. Deleting datasets requires a non-empty compliance `reason`.

## Next Steps

> [card] [Authentication & Scopes](https://docs.usefusion.ai/mcp/authentication.md)
>
> Learn how OAuth 2.1, Nostr sign-in, scopes, step-up challenges, and token rotation work.

> [card] [Tools & Resources Reference](https://docs.usefusion.ai/mcp/tools-reference.md)
>
> Explore all 31 MCP tools and 6 resource URIs with parameters, scopes, and RBAC requirements.

> [card] [Workflow Examples](https://docs.usefusion.ai/mcp/examples.md)
>
> Follow end-to-end examples for creating quests, exporting datasets, and publishing artifacts.

> [card] [Organizations & Permissions](https://docs.usefusion.ai/organizations/members-and-permissions.md)
>
> Review the underlying NeuroFusion RBAC permissions enforced on every MCP call.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.