Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
262:mcpserver [2026/10/23 10:47] – [How to get started] Fuhl, Alexander262:mcpserver [2026/10/28 10:46] (current) – Policnik, Florian
Line 5: Line 5:
 Through our MCP server, AI systems can access process data managed in Stages for various purposes and use cases. Through our MCP server, AI systems can access process data managed in Stages for various purposes and use cases.
  
-In the currently provided MCP solution Stages provides access to a **valid versions of workspaces only**.+In the currently provided MCP solution Stages provides access to **valid versions of workspaces only**. 
 ===== What it offers ===== ===== What it offers =====
  
Line 11: Line 12:
  
 Currently it offers 10 tools to browse and search workspaces and elements. This is subject to change. Currently it offers 10 tools to browse and search workspaces and elements. This is subject to change.
 +
 ===== Availability ===== ===== Availability =====
  
-The Stages MCP server is integrated into Stages 26.2.0.0 and later. +The Stages MCP server is integrated into Stages 26.2.0.0 and later. 
- +
-<placeholder for authentication setup instructions>+
  
 Note: Stages 7.12.5.1 or later and Stages 26.1.0.0 or later had a beta implementation of this feature that worked quite differently. Note: Stages 7.12.5.1 or later and Stages 26.1.0.0 or later had a beta implementation of this feature that worked quite differently.
  
-==== Installation =====+===== Configuration =====
  
-  * Stop Stages +Authentication is currently available only through an external identity provider (IdP), such as Microsoft Entra ID or Keycloak.
-  * Activate [[262:api-tokens|API tokens in Stages]] +
-  * Add ''mcp-server.properties'' to the Stages conf folder +
-  * Choose the right WAR file: +
-    * Stages 7.12: ''mcp-web-tomcat-9-*.war'' +
-    * Stages 26.1: ''mcp-web-tomcat-10-*.war'' +
-    * Extract the WAR file to ''stages/tomcat/webapps/mcp''. Ensue that the folders ''META-INF'' and ''WEB-INF'' are directly in the ''mcp'' folder +
-  * Start Stages +
-  * Go to the Company workspace and add the workspace variable ''mcpDefaultWorkspace''. Set the value to the ID of the workspace that you want to access. +
-  * In Stages go to Administration -> Jobs and create a job for MCP (e.g. "mcp") +
-  * Upload the ''mcp.js'' file to MCP job +
-  * Run the job once +
-  * Specify a cron expression to keep the data updated+
  
-If Stages is running, you can check the path ''/mcp/status'' on your Stages server to see if the MCP server is running. For example: ''<nowiki>https://stages.example.com/mcp/status</nowiki>''+==== IdP configuration ====
  
-==== Configure credentials =====+To enable MCP, add a resource configuration to your IdP, typically by creating an app or client registration. If you already use OIDC, you can use that configuration.
  
-Access to the MCP server and Stages data is protected. A [[262:api-tokens|personal Stages API token]] is required to access the REST API. The user must have the following privileges:+Add the custom scope to the client:
  
-  * Process Modeler +''stages:mcp:read''
-  * CollectorData Read and Create permission +
-  * Permission according to the data collector (e.g. Process Read)+
  
 +Depending on your IdP, you may find this under "Expose an API" or "Client scopes". In Microsoft Entra ID, specify the Application ID URI using this format:
  
 +''<nowiki>https://stages.example.com/stages/api/1/mcp</nowiki>''
  
-==== Configure AI system =====+Use this value as the audience in the configuration. In other systems, the audience may be the application's client ID. Stages checks this value against the JWT's audience claim.
  
-Configuration depends on Stages version+==== Stages configuration ====
  
-=== Stages 7.12 / Tomcat 9 ===+Add the following to the ''<authentication>'' section in ''config.xml'':
  
-Currently Stages MCP server supports Server-Sent Events (SSE) protocol for Tomcat 9 version. The endpoint is ''/mcp/sse'', e.g.: +<code xml> 
- +<method type="JWT" name="myIdp"> 
-''<nowiki>https://stages.example.com/mcp/sse</nowiki>'' +    <properties> 
- +        <property name="discoveryURI" value="${idp.myIdp.oidc.discovery.url}" /> 
-The API token that was created must be provided to the MCP server via the header ''StagesToken''. +        <property name="audience" value="${idp.myIdp.oidc.audience}" /> 
- +        <property name="usernameAttribute" value="upn" /> 
-An example MCP configuration: +    </properties> 
- +    <filters> 
-<code javascript> +        <attribute-match id="*" pattern="*" defaultUserGroupsUsername="${user.default.username}" 
-{ +            defaultLicenseType="${user.default.licenseType}" autocreateUser="${saml.autocreate}" /> 
-  "command": "npx", +    </filters> 
-  "args": [ +</method>
-    "mcp-remote", +
-    "https://stages.example.com/mcp/sse", +
-    "--header", +
-    "StagesToken: ${AUTH_TOKEN}" +
-  ], +
-  "env": { +
-    "AUTH_TOKEN": "eyJh..." +
-  }, +
-  "active": true +
-}+
 </code> </code>
  
 +  * ''discoveryURI'': The URL of the IdP's ''.well-known/openid-configuration'' file. For example, in Microsoft Entra ID: ''https://login.microsoftonline.com/<tenantId>/v2.0/.well-known/openid-configuration''.
 +  * ''audience'': The audience value that Stages, as the resource server, checks in the JWT.
 +  * ''usernameAttribute'': The JWT claim containing the username. This is typically the user's email address.
 +  * Configure the filter as you would for [[.:integration:oidc|OIDC]] authentication.
  
-=== Stages 26.1 / Tomcat 10 ===+==== Stages permissions ====
  
-Currently Stages MCP server supports Streamable HTTP protocol for Tomcat 10 version. The endpoint is ''/mcp/http'', e.g.:+The MCP integration acts on behalf of the authenticated user. In addition to the usual permissions to view workspaces and process elements, the user must have the MCP permission to access them through MCP.
  
-''<nowiki>https://stages.example.com/mcp/http</nowiki>''+To let all users use MCP, add the MCP domain to the default group.
  
-The API token that was created must be provided to the MCP server via the header ''StagesToken''.+==== MCP client configuration ====
  
-An example MCP configuration:+Configure your MCP client to connect to the Stages MCP server at this URL:
  
-<code javascript> +''<nowiki>https://stages.example.com/stages/api/1/mcp</nowiki>''
-{ +
-  "command": "npx", +
-  "args": [ +
-    "mcp-remote", +
-    "https://stages.example.com/mcp/http", +
-    "--header", +
-    "StagesToken: ${AUTH_TOKEN}" +
-  ], +
-  "env": { +
-    "AUTH_TOKEN": "eyJh..." +
-  }, +
-  "active": true +
-} +
-</code>+
  
 +Stages currently supports Streamable HTTP.