Build a SharePoint-Backed Copilot Experience with SPFx

Build a SharePoint-Backed Copilot Experience with SPFx

If a request already lives in SharePoint, I don’t want a Copilot form to become a second source of truth. I want people to review the request, correct a field, submit it once, and see the status that SharePoint actually saved.

SPFx can put a Copilot UX component in that workflow. But it is not the same thing as embedding an existing SharePoint web part, and it does not require an external MCP server. Getting that boundary right makes the data model, permissions, and deployment much easier to reason about.

The Microsoft documentation and availability details here were checked on November 1, 2026.

Start with the host boundary

SharePoint Framework (SPFx) is Microsoft’s framework for client-side Microsoft 365 extensions. With SPFx 1.24, a Copilot UX component can be packaged with a declarative agent and rendered in Microsoft 365 Copilot. The component declares tools and their input properties; the Copilot host discovers those tools and supplies the properties when it invokes one.

That is an SPFx integration, not an MCP App. React components can be reused between projects, but an SPFx runtime, its host context, and an MCP Apps widget are not interchangeable. I would choose the host integration first and share only the UI or business logic that genuinely has no host-specific dependencies.

Separate MCP integration

SPFx Copilot UX

Declared component tool

Hosts packaged assets

Supported SharePoint API or protected service

MCP tools and UI resource

Host bridge

User

Microsoft 365 Copilot

Declarative agent

SPFx component

SharePoint App Catalog

Requests and documents

MCP server

Business service

MCP Apps widget

For a SharePoint-first workflow, the SPFx branch is often the smaller design. Microsoft documents that SPFx Copilot components provide managed tool discovery, so I don’t need to host an external MCP server just to let this agent invoke its SPFx tools.

SPFx Copilot UX componentMCP App
Host contractSPFx component, tool manifest, and declarative agent.MCP server tools, UI resource, and the MCP Apps host bridge.
Typical fitA Microsoft 365 solution that already uses SharePoint and SPFx.A service that needs an MCP tool and UI contract across compatible hosts.
Where data access belongsA supported SharePoint client or a protected business service.The MCP server or its business service, with authorization at that boundary.
What can be reusedFramework-independent React UI and business rules, not an assumed Copilot or SharePoint page context.Framework-independent UI and service logic, not the SPFx component runtime.
Host contract
SPFx Copilot UX component
SPFx component, tool manifest, and declarative agent.
MCP App
MCP server tools, UI resource, and the MCP Apps host bridge.
Typical fit
SPFx Copilot UX component
A Microsoft 365 solution that already uses SharePoint and SPFx.
MCP App
A service that needs an MCP tool and UI contract across compatible hosts.
Where data access belongs
SPFx Copilot UX component
A supported SharePoint client or a protected business service.
MCP App
The MCP server or its business service, with authorization at that boundary.
What can be reused
SPFx Copilot UX component
Framework-independent React UI and business rules, not an assumed Copilot or SharePoint page context.
MCP App
Framework-independent UI and service logic, not the SPFx component runtime.

Microsoft 365 Copilot supports both patterns, but through different integration contracts: SPFx Copilot UX components and MCP Apps. I wouldn’t label one as a wrapper around the other.

Model the request and its documents

Before I build the component, I decide what SharePoint owns. For a small access-request workflow, I would start with:

  • A Requests list with a stable request key, title, category, justification, requester, status, and created/updated timestamps.
  • A deliberately small set of status values, such as Draft, Submitted, Approved, and Rejected. Define which operation is allowed to move a request between each state.
  • A Request documents library with a required RequestKey metadata field. Store the relationship in metadata or a proper lookup, not in a filename that someone can rename.
  • Permissions for both the list and the document library. A request record and its attachment are separate resources; permission to see one does not automatically establish permission to see the other.

I also plan how the list is queried. Apply filters and pagination at the data source, and make the empty, loading, and access-denied states clear. A client-side filter over a large list is not a permission check, and loading every request just to show one user’s items is unnecessary.

The link between a request and its documents should be part of the persisted model. When the request is submitted, save a stable key and associate each uploaded document with it. When someone opens a request later, load only the records and files that person is allowed to see.

Keep the SPFx boundary in the container

An SPFx Copilot component derives from BaseCopilotComponent. Its manifest describes the component’s tools and the properties each tool accepts. The component receives those properties through this.properties; it also receives host information such as its current display mode.

Here is the shape of the component in Microsoft’s first-component tutorial. It is an excerpt, not a complete request component:

import { BaseCopilotComponent } from "@microsoft/sp-copilot-component";

export default class RequestCopilotComponent extends
  BaseCopilotComponent<RequestCopilotComponentProperties> {
  protected render(): void {
    const requestKey = this.properties.requestKey;
    const displayMode = this.hostContext.displayMode;

    // Render the request experience using the current properties and host context.
  }
}

I keep that SPFx-specific work in a container or adapter:

  • Read tool properties, validate them, and load the request through the selected data-access path.
  • Pass plain, typed view data and explicit callbacks into presentational React components.
  • Keep loading, empty, validation, success, and error states visible in the UI.
  • Treat inline as the compact layout. A component can request fullscreen only when it declares that mode, and the host remains in control of the actual display mode.

An existing SharePoint web part may use this.context.pageContext. I don’t assume that page context exists just because a Copilot component is built with SPFx. Copilot is a different host. I use the Copilot component’s documented APIs and verify the data-access path in that host instead of copying a web-part assumption.

For a SharePoint list or library, SPFx has supported SharePoint client APIs; the SharePoint connection tutorial demonstrates the framework’s SPHttpClient for SharePoint REST calls in a web part. Before reusing a particular client call in a Copilot component, I check that API against the component’s supported context, required permissions, and target tenant. If a business operation needs centralized rules or reaches other systems, I put it behind a protected service rather than making the React component the authority.

Make each write an explicit operation

I separate opening a request from changing it. A read tool can show the current request and its status; a write operation should only happen after the user reviews the values and explicitly submits.

No

Yes

No

Yes

No

Yes

Open request

Load authorized request and document metadata

Can this user edit it?

Show details and explain access

Review fields and associated documents

Input valid?

Show field errors and preserve the draft

User explicitly submits once

Re-check permission and allowed status transition

Authorized and valid now?

Show an error without claiming success

Save request and document relationship

Return saved request key and status

The exact persistence call depends on the chosen data-access path, but the behavioral contract should stay the same:

  1. Validate inputs at the operation boundary, not only in the browser.
  2. Check the caller’s permission for this request and each document. A request ID, a visible button, or an agent-provided user name is not proof of authorization.
  3. Enforce the allowed status transition where the operation is authorized. Don’t rely on the UI to prevent a forged or stale update.
  4. Return the saved request key and status. Show success only after the operation returns a valid result.
  5. If a network retry could repeat a write, make the operation idempotent on the trusted service. Disabling the submit button helps the user, but does not guarantee that the server processed only one write.

If I expose the same workflow through MCP for another compatible host, I keep that as a separate server integration. The server validates its own inputs and authorization; it does not inherit the SPFx component’s context or permissions. Likewise, an SPFx tool manifest is not an MCP endpoint.

Deploy and test the actual Copilot experience

The current Microsoft tutorial uses the SPFx 1.24.0 toolchain. A typical path is:

  1. Scaffold a Copilot component with the SharePoint generator and build against the current SPFx compatibility requirements.
  2. Test rendering, tool properties, display modes, theme changes, and error states in the Copilot Workbench.
  3. Package the solution as an .sppkg, upload and enable it in the tenant’s SharePoint App Catalog, and use Add to Teams for the initial declarative-agent deployment.
  4. Test with a licensed user in the target tenant. Verify tool discovery, list and library permissions, and the real submit path.

With includeClientSideAssets enabled, the packaged component assets are hosted from the SharePoint App Catalog. A component or tool update does not require syncing the baseline agent again when the agent definition itself is unchanged; allow time for runtime tool discovery to refresh. Changes to the baseline agent configuration do require another sync. Microsoft’s deployment guidance explains that distinction.

Workbench is valuable, but it does not prove that the deployed agent matches user intent, that tenant policy allows the app, or that a user has access to a particular request. I test those in a development tenant as well.

At general availability, SPFx Copilot UX components require a Microsoft 365 Copilot add-on license, including for development and Workbench testing. Microsoft’s availability guidance lists supported browser and desktop clients and excludes iOS and Android at GA. Check the current availability and limitations before committing to a client or rollout plan.

For a demo, I would verify these outcomes rather than just check that the component renders:

  • A user with permission can open a request and see only its associated documents.
  • A user without permission gets an explicit denial and cannot retrieve the restricted record or file.
  • Invalid fields and invalid status transitions are rejected without losing the user’s unsaved input.
  • A successful submit shows the saved request key and status; a repeated submission does not silently create a duplicate.
  • Pagination, keyboard navigation, inline/fullscreen layouts, loading, empty, and error states work in the supported client.

Takeaway

SPFx is a practical fit when the experience belongs in a Microsoft 365 solution and SharePoint is already the system of record. I keep SharePoint access, the SPFx host adapter, reusable React UI, and business authorization as distinct responsibilities.

I reach for MCP when I need an MCP server and its tool/UI contract across compatible hosts—not as a prerequisite for an SPFx Copilot component. Whichever route I choose, the data source and trusted operation boundary—not the rendered form—decide whether a request can be read or changed.

References