MCP Gateway
The MCP Gateway is the PAS endpoint that AI Agents use to discover and invoke tools, prompts, and resources exposed by connected systems. It implements the Model Context Protocol (MCP) over HTTP/HTTPS.
The MCP Gateway serves two primary purposes:
-
Tool Discovery: Agents query the gateway to discover available tools, prompts, and resources across connected MCP services.
-
Tool Invocation: Agents call tools through the gateway, which routes requests to the appropriate backend service and handles authentication on behalf of the agent or user.
AI Agents require additional licensing. Contact your Imprivata Partner for more information.
Configure MCP Services for an Application
For an AI Agent to invoke tools exposed by a specific application, that application must have at least one host service configured with the MCP or MCPS port type. These port types route AI Agent traffic through the MCP proxy layer, which enables auditing and credential management.
The available MCP Port Types are:
| Port type | Protocol | Default port | Use when |
|---|---|---|---|
| MCP | HTTP | 80 | The MCP server does not use TLS |
| MCPS | HTTPS | 443 | The MCP server uses TLS |
Do not use generic HTTP or HTTPS port types for MCP servers. Using those types bypasses the MCP audit proxy.
To configure MCP Services in an Application:
-
Go to Applications > Application List.
-
Open the application that hosts the MCP server.
-
Click the Hosts And Services tab.
-
Locate the host and click Add Service, or select an existing service to edit.
-
Select the MCP or MCPS service.
-
Provide the port number the MCP server listens.
The default ports are 80 for MCP, 443 for MCPS.
-
Provide a Description and a Custom URI if the MCP server is mounted at a non-root path.
-
Click Save.
After saving, the service appears in the tool catalog and is accessible to AI Agents that have permission to access this application.
Read Create an AI Agent for information on AI Agent's access to applications
User-Delegated OAuth for MCPs
Many external MCPs require authentication using OAuth 2.0 with user delegation. This flow allows users to authorize the system to access external services on their behalf, enabling MCPs to perform actions as that specific user.
The user-delegated OAuth flow follows the standard OAuth 2.0 Authorization Code Grant with Proof Key for Code Exchange (PKCE). This approach ensures security, user control, scope limitation, and revocation.
-
Consent Initiation: The user initiates a connection to an external MCP within the UI.
-
Authorization: The user is redirected to the external service’s OAuth provider.
-
User Authentication: The user authenticates with the external service.
-
Scope Approval: The user reviews and approves the scopes requested by the system.
-
Token Exchange: The system exchanges the authorization code for an access token.
-
Token Storage: The access token is encrypted and stored, associated with the user’s account.
-
MCP Access: When the MCP needs to access the external service, the system uses the stored token.
The standard flow is the recommended approach for most deployments. The external OAuth provider must be configured to accept the default callback URL.
Configuration Requirements
For the external MCP to support user-delegated OAuth, configure:
-
OAuth Provider URL: The authorization server’s endpoint for the external service.
-
Token Endpoint: The server’s token exchange endpoint.
-
Client ID & Secret: Credentials for the PAS system as an OAuth client.
-
Default Redirect URI: The PAS system provides this automatically based on your deployment.
User Workflow
-
Navigate to User Profile > MCP Connections.
-
Locate the external MCP you want to connect.
-
Click Connect.
You are redirected to the external service’s login page.
-
Authenticate with your credentials for the external service.
-
Review the scopes the PAS system is requesting.
-
Click Approve.
You are redirected back to the server with an authorization confirmation.
Some deployments require manual configuration of callback URLs when:
-
Your PAS system is behind a proxy or load balancer with custom URLs.
-
Your OAuth provider has strict URL validation requirements.
-
You need to support multiple callback URLs for failover.
Configuration Requirements
Instead of using the default callback URL, manually specify:
-
Callback URL(s): One or more fully-qualified URIs that the OAuth provider will redirect to after user authentication.
-
State Parameter Validation: Ensure your callback URL preservation of state token across redirects.
-
Custom Port or Path: If your PAS system uses a non-standard port or path, register this with the OAuth provider.
Manually Configuring Callback URLs
-
Contact your OAuth provider to add custom callback URL(s).
-
Register all required URLs in your OAuth provider’s configuration.
-
In the PAS server, configure the external MCP to use these custom URLs.
After a user authorizes an external MCP, the system manages the token lifecycle automatically:
-
Token Storage: Tokens are encrypted at rest and stored in the secure token vault.
-
Token Refresh: If the external service provides a refresh token, it is automatically used to obtain new access tokens before expiration.
-
Token Expiration: Expired tokens are automatically refreshed. If refresh fails, the user must re-authorize.
-
Revocation: Users can revoke stored tokens at any time, immediately preventing the system from accessing the external service on their behalf.
Personal Access Token Support for MCPs
Some external MCPs do not support OAuth delegation and instead require static authentication using personal access tokens (PATs). Your PAS server supports PAT authentication with flexible header configuration.
Personal access tokens provide a simpler authentication mechanism for MCPs that generate static tokens that do not expire (or expire rarely), authenticate using HTTP headers rather than bearer tokens, or require custom authentication headers beyond standard OAuth.
Your PAS server supports multiple authentication header configurations:
Bearer Token (Standard)
Header Format:
Authorization: Bearer <token>
Example Configuration:
-
Header Name:
Authorization -
Header Prefix:
Bearer -
Token Value:
<token_value>
Result Header:
Authorization: Bearer <token_value>
API Key Header
Header Format:
X-API-Key: <token>
Example Configuration:
-
Header Name:
X-API-Key -
Header Prefix: (none)
-
Token Value:
<token_value>
Result Header:
X-API-Key: <token_value>
Custom Authorization Header
Header Format:
<CustomHeaderName>: <Prefix> <token>
Multiple Headers
Some MCPs require both an API key and a session token:
Authorization: Bearer <token>
X-Session-ID: <session>
Configuration in the Server
-
Token 1: Header
Authorization, PrefixBearer, Value: personal token -
Token 2: Header
X-Session-ID, Prefix: (none), Value: session identifier
To use personal access tokens with an external MCP:
-
Generate a personal access token in the external service.
-
In your server, navigate to MCP Connections.
-
Select the MCP and choose Authenticate with Personal Access Token.
-
Select the authentication method.
-
Enter the header name and header prefix.
-
Paste your personal access token.
-
Click Save.
Personal access tokens are managed differently than OAuth tokens:
-
Expiration: PATs typically do not expire, but check your external service’s policy.
-
Refresh: PATs are static and do not refresh. If a token expires, generate a new one in the external service and update the PAS server.
-
Revocation: Users can revoke PAT credentials from the PAS server at any time, immediately preventing token use.
-
Rotation: Periodically rotate PATs by generating new tokens in the external service and updating the PAS server.
Manage MCP Consents
Users must explicitly authorize the VPAM server to access external MCPs on their behalf. The consent management interface allows users to view, authorize, and revoke these connections.
To revoke access to an MCP:
-
Locate the MCP in Profile > Connected Services list.
-
Click Revoke.
-
Confirm the revocation in the dialog.
The connection is immediately terminated and the VPAM server can no longer access the external service on your behalf.
Effect of Revocation:
The stored OAuth token or PAT is deleted from the system. Any pending operations using the token are canceled.
To reconnect, you must re-authorize the MCP.
If an MCP connection expires, fails, or you want to re-authorize after revoking consents:
-
Navigate to Profile > Connected Services.
-
Locate the MCP with status Connection Expired or Authorization Required.
-
Click Re-authorize.
Complete the OAuth or PAT authentication process.
To view details about a specific MCP authorization:
-
Navigate to Profile > Connected Services.
-
Click the MCP name or an info icon.
-
View the Authorization Details.
Audit and Compliance
All MCP activity is automatically audited for compliance and troubleshooting. The VPAM server tracks:
-
Authorization Events: When users authorize or revoke MCP consents.
-
Tool Invocations: Which tools are called, by whom, and when.
-
API Calls: Details of requests sent to external MCPs.
-
User Identity: Who initiated each action.
MCP Audit Logs are located in System Administration > Admin Log. Each MCP audit record includes:
-
Timestamp: When the activity occurred.
-
User: Who initiated the activity.
-
MCP Name: Which external service was accessed.
-
Tool/Method: Which specific tool or API method was called.
-
Parameters: (Limited visibility) Sanitized parameters used.
-
Status: Success, failure, or timeout.
-
Duration: How long the operation took.
Namespaced MCP Connections
In multi-site deployments, namespaces provide logical isolation of MCP connections. Namespaces ensure that users only see and can authorize MCPs relevant to their assigned site. A namespace is a logical grouping of related MCP services, typically aligned with organizational sites or departments.
When a user authorizes an MCP connection or views connected MCPs, the system resolves the user’s current namespace based on their assigned site or department, or the current context (web application, tool, etc.), resulting in the following:
-
Only MCPs configured for that namespace are displayed.
-
Authorization and revocation actions are scoped to that namespace.
-
Audit records include the namespace context.
System Administrators configure namespaces during MCP setup:
-
Navigate to MCP Configuration.
-
When adding or editing an MCP service, assign it to one or more namespaces.
-
Save the configuration.
MCP Gateway Reference
All requests to the MCP Gateway require a valid OAuth 2.0 bearer token issued for an AI Agent identity. See AI Agents for how to obtain a token.
POST https://<server>/mcp
To scope requests to a single site, append the site name as a path segment:
POST https://<server>/mcp/{site-name}
URL-encode site names that contain spaces or special characters. For example, My Site becomes My%20Site.
Include a bearer token in every request:
Authorization: Bearer <access_token>
| Method | Path | Purpose |
|---|---|---|
| POST | /mcp | Send a JSON-RPC request; aggregates tools from all accessible sites |
| POST | /mcp/{site-name} | Send a JSON-RPC request scoped to a specific site |
| GET | /mcp | Open an SSE notification stream |
| GET | /mcp/{site-name} | Open an SSE notification stream scoped to a specific site |
| DELETE | /mcp | Terminate the current MCP session |
| DELETE | /mcp/{site-name} | Terminate the session for a specific site |
The gateway assigns a session ID on the first successful initialize request and returns it in the Mcp-Session-Id response header. Include this header in all subsequent requests:
Mcp-Session-Id: <uuid>
If the header is omitted on a non-initialize request, the gateway returns an error.
Requests use JSON-RPC 2.0:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}
The response format is determined by the Accept request header:
| Accept header | Mode | Description |
|---|---|---|
application/json (or omitted) |
JSON | Single JSON-RPC response body |
text/event-stream
|
SSE | Response delivered as a single SSEmessageevent |
| Method | Description |
|---|---|
initialize
|
Establishes the MCP session; must be the first call |
notifications/initialized
|
Completes the initialization handshake |
tools/list
|
Lists available tools across all accessible sites (or a scoped site) |
tools/call
|
Invokes a specific tool |
prompts/list
|
Lists available prompts |
prompts/get
|
Retrieves a specific prompt |
resources/list
|
Lists available resources |
resources/read
|
Reads a specific resource |
Before calling any other method, the AI Agent must complete the two-step initialization handshake:
-
Send
initialize: The gateway creates a session, returns its capabilities, and sets theMcp-Session-Idheader.// Step 1 — initialize
POST /mcp
Authorization: Bearer <token>
Content-Type: application/json
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}
// Response includes:
// Mcp-Session-Id: <uuid>
-
Send
notifications/initialized: The agent acknowledges the handshake. Include theMcp-Session-Idreceived in step 1.// Step 2 — initialized (use the session ID from the response above)
POST /mcp
Authorization: Bearer <token>
Mcp-Session-Id: <uuid>
Content-Type: application/json
{"jsonrpc":"2.0","method":"notifications/initialized"}
The initialize response body declares the gateway's supported capabilities:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"serverInfo": { "name": "Privileged Access MCP Gateway", "version": "<version>" },
"capabilities": {
"tools": { "listChanged": true },
"prompts": { "listChanged": true },
"resources": { "subscribe": false, "listChanged": true }
}
}
}
The notification stream (GET /mcp) pushes server-sent events to the AI Agent:
-
Keepalive comments are sent every 15 seconds to prevent proxy timeouts.
-
notifications/tools/list_changedis sent whenever the tool catalog changes (for example, when a new MCP service is added or removed). -
The stream times out after 30 minutes of inactivity and must be reopened.
Example SSE stream:
: keepalive
data: {"jsonrpc":"2.0","method":"notifications/tools/list_changed"}
MCP Gateway sessions expire after 15 minutes with no POST or DELETE requests. When a session expires:
-
The session is automatically removed from the registry.
-
All associated audit accesses are automatically closed.
-
Subsequent requests using the expired session ID receive an error; the agent must start a new session with initialize.
To end a session explicitly before it times out, send a DELETE /mcp request with the Mcp-Session-Id header.