MCP Server
The primedocs MCP server (PrimeDocs.Web.Mcp) is a standalone ASP.NET Core application (.NET 10) that exposes primedocs capabilities to AI agents via the Model Context Protocol. It runs separately from the rest of the primedocs server.
Prerequisites
- .NET 10 Windows Hosting Bundle (same as the primedocs server).
- A reachable primedocs IdentityServer instance for OAuth authorisation.
- A
primedocs.config(the same one used by the primedocs server, or one referencing it), see primedocs.config.
Configuration
The MCP server reads its settings from the primedocs.config (the same one used by the primedocs server). In particular, these come from it:
- the IdentityServer URL (authority for JWT bearer and token introspection),
- the MCP base URL,
- the
mcpTemplateTagNameattribute on the<openAi>element — required for template discovery to work:GetAllTemplatesandFindTemplatesreturn only templates carrying that tag (see primedocs AI (Preview)), - optional values such as the introspection secret and a proxy configuration.
The datasource is selected per request via the URL segment (see endpoint).
Endpoint and authentication
The MCP endpoint is tenant-specific:
https://<mcp-host>/{dataSourceId}
The server is an OAuth 2.0 protected resource. Clients discover the authorisation parameters via the discovery endpoints:
GET /.well-known/oauth-protected-resource
GET /.well-known/oauth-authorization-server
On a 401 the server returns a WWW-Authenticate header with the resource_metadata URL. Access tokens are validated against the IdentityServer via introspection; the MCP scope is required.
For details on the available tools (GetTemplateStructure, GenerateDocument, GetAllTemplates, FindTemplates), see the MCP interface page.