Architecture Overview
The connector involves three workspaces working together:sharepoint-mcp
MCP server that wraps Microsoft Graph API calls. Handles OAuth delegated
flow, token management, and file operations.
ai-knowledge
Orchestrates sync (file listing, download, indexing) and PBAV (per-chunk
access filtering at query time).
sharepoint-app
Shared library imported by sharepoint-mcp. Provides low-level Graph API
wrappers (list sites, drives, children, download).
- An AI Knowledge admin connects their Microsoft account via OAuth and configures a site + library
- Sync fetches the file list from SharePoint via the MCP server, downloads each file, and indexes it
- At query time, RAG chunks from SharePoint documents are filtered by probing the querying user’s access via their delegated OAuth token
Prerequisites
Before deploying, ensure the following are in place:- Prisme.ai platform version
v26.03.02xxxxor later (required for thesecretsmodule) - Latest Helm charts pulled for all workspaces
- Access to the Azure portal with permissions to register applications and grant admin consent
- The sharepoint-app workspace is deployed and available (it is imported by sharepoint-mcp)
Step 1: Deploy the SharePoint MCP Workspace
Import or create thesharepoint-mcp workspace on your Prisme.ai instance. The workspace index.yml must include:
global.workspacesRegistry), which AI Knowledge uses to discover and call the MCP server.
After deployment, verify registration:
- Open the Prisme.ai admin panel
- Confirm that
sharepoint-mcpappears in the global workspaces registry - The MCP endpoint will be available at
{API_URL}/workspaces/{WORKSPACE_ID}/webhooks/mcp
The sharepoint-app workspace must also be deployed, as sharepoint-mcp imports
it for Graph API wrapper automations.
Step 2: Register an Azure AD Application
Create an app registration in the Azure portal to enable OAuth delegated authentication.Create the App Registration
Navigate to Azure Portal > Microsoft Entra ID > App registrations > New registration.
- Name: a descriptive name (e.g. “Prisme.ai SharePoint Connector”)
- Supported account types: choose based on your tenant policy (single tenant is recommended for enterprise)
- Redirect URI: leave blank for now (configured in the next step)
Configure the Redirect URI
Under Authentication > Platform configurations > Add a platform > Web, add the redirect URI:Replace
{API_URL} with your Prisme.ai API base URL and {WORKSPACE_ID} with the ID of the sharepoint-mcp workspace.Add API Permissions
Under API permissions > Add a permission > Microsoft Graph > Delegated permissions, add the following scopes:
Click Grant admin consent for {your tenant} to pre-approve the permissions for all users in the organization.
| Permission | Type | Purpose |
|---|---|---|
Sites.Read.All | Delegated | List sites and read site metadata |
Files.Read.All | Delegated | Read files and download content from drives |
User.Read | Delegated | Read the signed-in user’s profile |
offline_access | Delegated | Obtain refresh tokens for long-lived sessions |
openid | Delegated | OpenID Connect sign-in |
profile | Delegated | Read user profile claims |
email | Delegated | Read user email address |
Step 3: Configure Workspace Secrets
In the Prisme.ai admin panel, navigate to thesharepoint-mcp workspace and configure the following secrets:
| Secret Name | Description | Example |
|---|---|---|
azureClientId | Application (client) ID from the Azure AD app registration | a1b2c3d4-e5f6-… |
azureClientSecret | Client secret value generated in Step 2 | ~Abc123… |
azureTenant | Azure AD Tenant ID (GUID) | f7e8d9c0-… |
azureSiteId | Optional. Default SharePoint site ID (format:
hostname,siteCollectionId,siteId). Used when no site is
specified in tool calls. | contoso.sharepoint.com,abc123,def456 |
{{secret.azureClientId}}, etc. They are stored encrypted by the platform’s secrets module.
Step 4: Enable the Connector in AI Knowledge
In the AI Knowledge workspace configuration (index.yml or via the admin panel), enable the SharePoint connector and choose an authentication mode:
Authentication Modes
TheauthMode setting controls how the connector authenticates with SharePoint and whether per-user access control is enforced:
| Mode | Value | Behavior |
|---|---|---|
| Delegated (default) | delegated | Each user connects their own Microsoft account via OAuth. PBAV is active: at query time, each user only sees RAG results from files they can access in SharePoint. The connector card shows a “Connect with Microsoft” button. |
service_account | Sync and queries use the workspace-level credentials configured in the
MCP secrets (azureClientId, azureClientSecret,
azureTenant). No per-user OAuth is required. PBAV is
disabled — all synced documents are visible to all project users. The
OAuth connection section is hidden from the connector card. |
Service account mode is simpler to operate (no user-level OAuth flows) but
provides no per-user access control. Use it when all project users should have
access to the entire synced library.
Verification
After completing the setup, verify each component:Secrets Module
Confirm the secrets module is operational. Navigate to the sharepoint-mcp workspace and verify all four secrets are set (the UI will show them as masked values).
Workspace Registry
Confirm
sharepoint-mcp appears in global.workspacesRegistry. Open AI Knowledge workspace and check that it can resolve the MCP server URL.Redirect URI
Verify the redirect URI in Azure AD matches the actual webhook URL. Navigate to:You should get a
401 response (no session), not a 404.Connect Page
Open the public connect-sharepoint page:The page should load with a “Connect with Microsoft” button. If OAuth is not configured, a warning banner reading “OAuth is not configured” is displayed instead.
Troubleshooting
AADSTS50011: The redirect URI does not match
AADSTS50011: The redirect URI does not match
Cause: The redirect URI configured in Azure AD does not exactly match the one used by the MCP server.Fix: Verify the redirect URI format is
{API_URL}/v2/workspaces/{WORKSPACE_ID}/webhooks/oauthCallback. Check for trailing slashes, scheme mismatches (http vs https), and ensure the workspace ID is correct.OAuth is not configured banner on connect-sharepoint page
OAuth is not configured banner on connect-sharepoint page
SharePoint MCP server is not configured error during sync
SharePoint MCP server is not configured error during sync
Token exchange failed during OAuth callback
Token exchange failed during OAuth callback
Cause: The client secret is incorrect, expired, or admin consent was not granted.Fix:
- Regenerate the client secret in Azure AD and update the
azureClientSecretworkspace secret - Verify admin consent was granted for all required permissions
- Check the Azure AD tenant ID matches the
azureTenantsecret
Secrets module errors (500 during token storage)
Secrets module errors (500 during token storage)
Cause: The
secrets module is not available on the platform, typically because the platform version is older than v26.03.02xxxx.Fix: Upgrade the Prisme.ai platform to version v26.03.02xxxx or later.