Introduction
The Perfion MCP Server lets AI assistants (MCP clients) such as Claude, ChatGPT, GitHub Copilot in VS Code and Cursor read Perfion data with the permissions of the signed-in Perfion user. It uses the Model Context Protocol (MCP).
This guide explains how to install the Perfion MCP Server on IIS, configure it, and connect AI clients.
For what users can do with it, see Using AI assistants with Perfion (MCP).
The AI client connects over HTTPS to the Perfion MCP Server, which connects over HTTPS to the Perfion API Service, which uses the Perfion database.
- Read-only. The MCP server cannot create, change or delete anything in Perfion.
- The user's own permissions. Every user signs in with their own Perfion user, and Perfion's permissions apply. The MCP server has no Perfion credentials of its own.
- Only the MCP server has to be public. The MCP server forwards the Perfion sign-in to the API Service and serves files and images through itself. The Perfion API Service can stay on the internal network.
Data protection
Everything a tool returns goes to the AI client and from there to the client's model provider (for example, Anthropic for Claude). The MCP server does not store customer data. Its audit log contains the user, the tool and the names of the arguments, never the values.
Requirements
| What | Details |
|---|---|
| Perfion | Perfion 6.0.0 or later. The API Service must have the MCP endpoints (v1/mcp/*) and the OAuth sign-in (oauth/*). |
| Server for the MCP server | Windows Server 2016 or later with IIS. It can be the server of the API Service or another one. |
| ASP.NET Core Hosting Bundle | For .NET 10, from dotnet.microsoft.com/download/dotnet/10.0 (Hosting Bundle under ASP.NET Core Runtime). |
| Host name and certificate | A DNS name for the MCP server, for example mcp.example.com, and a certificate for it in Local Computer, Personal. HTTPS is required: AI clients only sign in over HTTPS (except on localhost). |
| Network | The MCP server must reach the API Service, and the users' AI clients must reach the MCP server. Claude on the web, Claude Desktop connectors and ChatGPT connect from the provider's cloud, so for them the MCP server must be reachable from the internet. |
| Installation files | The Perfion.MCP zip file. |
| Perfion Web Client (optional) | Its URL, for example https://perfion.example.com, for links to items. |
The examples in this guide use these addresses:
| Public URL of the MCP server | https://mcp.example.com |
| URL of the Perfion API Service (as the MCP server reaches it) | https://perfion.internal/Perfion.APIService/ |
| URL of the Perfion Web Client | https://perfion.example.com |
Set up Perfion for AI clients
Allow the MCP server in the API Service
The API Service is installed and updated as usual with Perfion. Because the MCP server forwards the Perfion sign-in, clients sign in at https://mcp.example.com. The API Service only accepts that address when it is listed in Perfion:OAuthAllowedIssuers in its Web.config (in the folder of the API Service site):
<appSettings> ... <add key="Perfion:OAuthAllowedIssuers" value="https://mcp.example.com"/> </appSettings>
- Use exactly the public URL of the MCP server (
PublicUrl), with https and without a trailing/. If they differ, clients fail withIssuerMismatchError. - Separate several URLs with
;, for example when a test and a production MCP server use the same API Service. - Leave it empty when no MCP server forwards the sign-in.
- Saving
Web.configrestarts the API Service application.
Enable AI clients in Perfion
In Perfion, turn on Allow AI clients (MCP) to read Perfion data, and add the AI clients your users will connect with to Allowed AI clients:
| AI client | Allowed AI clients entry |
|---|---|
| Claude (web, desktop and mobile apps) | https://claude.ai/ |
| Claude Desktop with mcp-remote, Claude Code |
http://localhost and http://127.0.0.1
|
If a client is not allowed, the sign-in page shows the addresses to add.
Install the MCP server on IIS
The examples install the server to C:\inetpub\Perfion.MCP as the site and application pool Perfion.MCP. To run several MCP servers on one IIS (for example, one per Perfion installation), give each its own folder, site, application pool and host name or port.
Step 1: Install the hosting bundle
Install the ASP.NET Core Hosting Bundle for .NET 10, then run iisreset in an elevated command prompt.
Step 2: Copy the files
Unzip the Perfion.MCP zip file to C:\inetpub\Perfion.MCP. In that folder:
- Rename
appsettings.json.exampletoappsettings.json. The zip file never containsappsettings.jsonitself, so an upgrade cannot overwrite your settings. - Create the folders
logs(for log files) andkeys(for the keys that encrypt the browser sessions of file links). - You can delete
Install-PerfionMcp.ps1. It is not used in this setup.
Do not change the
web.configin the zip file. It runs the server in-process in IIS and turns off dynamic compression, which would hold back streamed MCP responses.
Step 3: Create the application pool
In IIS Manager, go to Application Pools and click Add Application Pool:
| Setting | Value |
|---|---|
| Name | Perfion.MCP |
| .NET CLR version | No Managed Code (the server brings its own .NET runtime) |
| Managed pipeline mode | Integrated |
Then, in Advanced Settings of the pool:
| Setting | Value | Why |
|---|---|---|
| Start Mode | AlwaysRunning | The first request after a restart is fast. |
| Idle Time-out (minutes) | 0 | The server is not stopped between requests. |
| Identity | ApplicationPoolIdentity | The default. The pool runs as IIS AppPool\Perfion.MCP. |
Step 4: Set the folder permissions
The pool needs read access to the server files and write access to the logs and keys folders. In an elevated command prompt, run:
icacls C:\inetpub\Perfion.MCP /grant "IIS AppPool\Perfion.MCP:(OI)(CI)RX" icacls C:\inetpub\Perfion.MCP\logs /grant "IIS AppPool\Perfion.MCP:(OI)(CI)M" icacls C:\inetpub\Perfion.MCP\keys /grant "IIS AppPool\Perfion.MCP:(OI)(CI)M"
Step 5: Create the site
In IIS Manager, go to Sites and click Add Website:
| Setting | Value |
|---|---|
| Site name | Perfion.MCP |
| Application pool | Perfion.MCP |
| Physical path | C:\inetpub\Perfion.MCP |
| Binding | Type https, port 443, host name mcp.example.com, Require Server Name Indication selected, and the SSL certificate for mcp.example.com
|
Use a site of its own, not an application under another site such as Default Web Site. The sign-in addresses of the MCP server must be at the root of its URL.
Behind a reverse proxy, load balancer or gateway (for example Azure Application Gateway or IIS ARR) that terminates HTTPS, the binding is the internal address the proxy forwards to, for example type http, port 5280, no host name.
PublicUrlinappsettings.jsonis then the public address (step 6).
Step 6: Configure the server
Edit C:\inetpub\Perfion.MCP\appsettings.json. A typical configuration:
{
"Perfion": {
"BaseUrl": "https://perfion.internal/Perfion.APIService/",
"PublicUrl": "https://mcp.example.com",
"WebClientUrl": "https://perfion.example.com",
"DataProtectionKeysPath": "C:/inetpub/Perfion.MCP/keys"
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft.AspNetCore": "Warning",
"System.Net.Http.HttpClient": "Warning"
}
},
"WriteTo": [
{ "Name": "File", "Args": { "path": "C:/inetpub/Perfion.MCP/logs/perfion-mcp-.log", "rollingInterval": "Day", "retainedFileCountLimit": 14, "shared": true } }
]
},
"AllowedHosts": "*"
}
- Write paths with
/(or\\), since\alone is not valid in JSON. - Settings you leave out use their defaults (see Settings).
- After changing
appsettings.json, recycle the application pool.
Step 7: Start the site and check the installation
Start the site (and the application pool, if it is stopped), then open these addresses in a browser:
| Open | Expected result |
|---|---|
https://mcp.example.com/health |
{"status":"ok","version":"1.0.0"} |
https://mcp.example.com/.well-known/oauth-protected-resource/mcp |
JSON with "resource": "https://mcp.example.com/mcp"
|
https://mcp.example.com/.well-known/oauth-authorization-server |
JSON with "issuer": "https://mcp.example.com". Another issuer means Perfion:OAuthAllowedIssuers in the API Service does not match. |
Then connect an AI client (see Connect AI clients) and ask, for example, "Which languages do we have in Perfion?". If the site does not start, see Troubleshooting.
Connect AI clients
The address of the MCP server is its public URL followed by /mcp, for example https://mcp.example.com/mcp. Give this address to your users.
The first time a client connects, it opens the Perfion sign-in page in the browser. The user signs in with their Perfion user (and MFA code, or Sign in with Microsoft), and the client is connected. The client renews the sign-in by itself. Users sign in again after 30 days without use, or when their Perfion user changes.
Make sure each client is listed in Allowed AI clients (see Enable AI clients in Perfion).
Claude (web, desktop and mobile apps)
Claude connects to the MCP server as a custom connector. Claude connects from Anthropic's cloud, so the MCP server must be reachable from the internet.
- In Claude, open Settings > Customize > Add and click Add custom connector. On Team and Enterprise plans, an owner adds the connector for the organization first, under the organization settings. Users then connect to it.
- Name: Perfion. URL:
https://mcp.example.com/mcp. Leave the advanced OAuth settings empty, since Claude registers itself. - Click Connect, and sign in to Perfion in the window that opens.
- In a chat, turn on the connector in the tools menu, and ask a question about Perfion data.
Allowed AI clients entry: https://claude.ai/
Claude Desktop with an internal MCP server (mcp-remote)
When the MCP server is only reachable on the internal network, Claude Desktop can connect through mcp-remote, a bridge that runs on the user's computer. It requires Node.js 22.15 or later.
- In Claude Desktop, open Settings > Developer > Edit Config. This opens
claude_desktop_config.json(%APPDATA%\Claude\claude_desktop_config.jsonon Windows). -
Add the server:
{ "mcpServers": { "perfion": { "command": "npx", "args": [ "-y", "mcp-remote", "https://mcp.example.com/mcp" ], "env": { "NODE_OPTIONS": "--use-system-ca" } } } }--use-system-camakes Node trust the certificates Windows trusts, for example from an internal certificate authority. - Quit Claude Desktop completely (right-click the Claude icon in the notification area and choose Quit; closing the window is not enough), and start it again.
- The browser opens the Perfion sign-in. After signing in, perfion is listed in the tools menu of a chat.
Allowed AI clients entries: http://localhost and http://127.0.0.1
Claude Code
claude mcp add --transport http perfion https://mcp.example.com/mcp
Then run /mcp in Claude Code, select perfion and choose Authenticate to sign in. Add --scope user to claude mcp add to use the server in all projects.
Allowed AI clients entries: http://localhost and http://127.0.0.1
Other clients
Any MCP client that supports Streamable HTTP and OAuth sign-in with dynamic client registration can connect with the URL https://mcp.example.com/mcp. Clients that only start local programs (stdio) can use mcp-remote, as described for Claude Desktop.
For tests without a sign-in, the MCP server can also run as a local program with a Perfion API token (stdio mode). It then always uses that one user, so it is not meant for end users.
Upgrade
- Unzip the new Perfion.MCP zip file to a temporary folder.
- Stop the application pool
Perfion.MCP. - Copy all files from the temporary folder to
C:\inetpub\Perfion.MCP, replacing the existing ones. The zip file has noappsettings.json, so your settings and thelogsandkeysfolders are kept. - Start the application pool.
Compare appsettings.json with the new appsettings.json.example for new settings. New settings have defaults, so the server also runs without them. /health shows the new version. Users do not have to sign in again after an upgrade.
Troubleshooting
| Symptom | Cause and solution |
|---|---|
/health answers 500.30 or 500.19, or the site does not start |
Look in the Windows Application event log (source IIS AspNetCore Module V2). It has the reason, for example a missing setting or invalid JSON in appsettings.json. For more detail, set stdoutLogEnabled="true" in web.config in the install folder and look in the logs folder. 500.19 usually means that the Hosting Bundle is missing or iisreset was not run after installing it. |
| The event log says Perfion:PublicUrl is required | Set Perfion:PublicUrl in appsettings.json. |
/health answers 400 Bad Request |
The host name in the address is not allowed. Use the host name of PublicUrl, or add the host name to AllowedHosts. |
/health works, but the site cannot write the log, or loses file link sign-ins after a restart |
The application pool lacks write access to the logs or keys folder (step 4). |
The client reports IssuerMismatchError
|
Perfion:OAuthAllowedIssuers in the API Service's Web.config does not exactly match Perfion:PublicUrl of the MCP server (https, host name, port, no trailing /). Check /.well-known/oauth-authorization-server on the MCP server (step 7). |
The client reports InsecureTokenEndpointError
|
The MCP server is used over http from another machine. Use HTTPS. |
| The sign-in page says AI clients are not enabled | Turn on Allow AI clients (MCP) to read Perfion data in Perfion. |
| The sign-in page says the client is not allowed | Add the client to Allowed AI clients. The page shows the addresses to add. |
| Every request gets 503, and the log says Perfion 6.0.0 or later is required | The API Service is older than 6.0.0, or Perfion:BaseUrl does not point to the API Service. |
| Every request gets 503 | The MCP server cannot reach the API Service. Check Perfion:BaseUrl from the MCP server, for example by opening <BaseUrl>get-version in a browser on that server. |
A tool answers ACCESS_DENIED
|
The user's Perfion permissions do not allow it, or the user is disabled. |
| Items have no links to the Web Client |
Perfion:WebClientUrl is not set in appsettings.json. |
| Claude Desktop does not pick up a changed configuration | Quit Claude Desktop from the notification area and start it again. |
| mcp-remote keeps using an old sign-in or server | Quit the client, delete the folder %USERPROFILE%\.mcp-auth, and connect again. |
| A link to a file asks for a sign-in | This is expected. Files are only shown to users signed in to Perfion. |
Settings
appsettings.json has the sections Perfion (the server), Serilog (logging), OpenTelemetry (optional monitoring) and AllowedHosts. Settings in a group such as RateLimit are nested in JSON, for example "Perfion": { "RateLimit": { "McpRequestsPerMinute": 60 } }. Durations are written as hh:mm:ss, for example "00:01:40".
Required settings
| Setting | Description |
|---|---|
Perfion:BaseUrl |
URL of the Perfion API Service as the MCP server reaches it, for example https://perfion.internal/Perfion.APIService/. |
Perfion:PublicUrl |
The URL AI clients and browsers use to reach the MCP server, for example https://mcp.example.com, without /mcp and without a trailing /. It is used in the sign-in, in links to files, and to check the host name and browser origin of requests. It must equal Perfion:OAuthAllowedIssuers in the API Service. The server does not start without it. |
Optional settings
| Setting | Default | Description |
|---|---|---|
Perfion:WebClientUrl |
(none) | URL of the Perfion Web Client, for example https://perfion.example.com. Items in results then get a link that opens them in the Web Client. Without it, items have no link. |
Perfion:DataProtectionKeysPath |
(none) | Folder for the keys that encrypt the browser sessions of file links. Set it, so users stay signed in for file links when the application pool restarts. With several servers behind a load balancer, use a folder they all share. |
Perfion:BrowserSessionLifetime |
08:00:00 | How long a browser stays signed in for file links. |
Perfion:Timeout |
00:01:40 | Timeout for each call to the Perfion API Service. |
Perfion:MaxResponseCharacters |
40000 | Largest answer of a tool, in characters. Larger answers are shortened. A higher value gives the AI more data per call but uses more of its context. |
Perfion:MaxItemsPerQuery |
200 | Largest number of items per query. |
Perfion:MaxImageBytes |
5000000 | Largest image, in bytes, the AI can be given to look at. Images are scaled first, so this is rarely reached. |
Perfion:AllowedOrigins |
(none) | Further browser origins allowed to call /mcp, as a list, for example [ "https://ai-tool.example.com" ]. Only needed for MCP clients that run as a web page in the user's browser. Desktop clients and clients in a provider's cloud (Claude, ChatGPT) are not affected. |
Perfion:ProxySignIn |
true | The MCP server forwards the Perfion sign-in to the API Service, so only the MCP server has to be public. With false, clients sign in directly at the API Service, which must then be reachable for them, and the MCP server's public URL must be added to Allowed AI clients in Perfion. Keep it set to true. |
Perfion:AuthorizationServerUrl |
(none) | Only used with ProxySignIn set to false and a sign-in address other than BaseUrl. Leave it empty. |
Perfion:ApiToken, Perfion:Username, Perfion:Password
|
(none) | Not used on IIS, where every user signs in with their own Perfion user. Leave them empty. They are only for running the server as a local program (stdio mode). |
Request limits
The settings under Perfion:RateLimit protect the MCP server and Perfion against a client that sends too many requests. Requests over a limit get the answer 429 Too Many Requests.
| Setting | Default | Description |
|---|---|---|
Perfion:RateLimit:Enabled |
true | false turns all limits off. |
Perfion:RateLimit:McpRequestsPerMinute |
120 | MCP requests per minute per signed-in user session. |
Perfion:RateLimit:BrowserRequestsPerMinute |
120 | Sign-in pages and file links per minute per IP address. |
Perfion:RateLimit:SignInAttemptsPerMinute |
10 | Password and sign-in code checks per minute per IP address. A sign-in uses 2-3. |
Perfion:RateLimit:InvalidTokensPerMinute |
10 | Invalid sign-in tokens per minute per IP address, before that address is refused for the rest of the minute. |
Logging
The server logs to the console and to the sinks listed under Serilog:WriteTo. On IIS, add the File sink as in the example in step 6, so the log is written to the logs folder.
Serilog:MinimumLevel:Default sets the log level:
- Information is the normal level.
- Debug also logs every call to the Perfion API Service, without the values users searched for.
- Verbose logs query values and responses. Use it only for troubleshooting.
Audit log. Every tool call is written to the log in the category Perfion.Mcp.Audit: the Perfion user, the tool, the names of the arguments and the outcome, never the values.
Monitoring (optional)
The server can send traces, metrics and logs to an OpenTelemetry collector, like the other Perfion services:
"OpenTelemetry": {
"Enabled": true,
"Otlp": { "Endpoint": "http://otel-collector:4318", "Headers": "api-key=..." }
}
| Setting | Default | Description |
|---|---|---|
OpenTelemetry:Enabled |
false | true turns it on. |
OpenTelemetry:Otlp:Endpoint |
(none) | URL of the collector (OTLP over HTTP). |
OpenTelemetry:Otlp:Headers |
(none) | Headers the collector needs, for example an API key, separated by ,. |
The environment variables PERFION_OTEL_ENABLED, OTEL_EXPORTER_OTLP_ENDPOINT and OTEL_EXPORTER_OTLP_HEADERS take precedence, as for the other Perfion services.
Comments
0 comments
Article is closed for comments.