Integrating DMN with MCP for Intelligent Decision Services¶
This guide walks you through setting up a Spring Boot service that combines Decision Model and Notation (DMN) with Model Context Protocol (MCP) to create an intelligent decision service that can interact with Claude.
Prerequisites¶
- Java 17 installed
- Maven 3.9.6 installed
- Basic knowledge of Spring Boot
- Claude Desktop application
Step 1: Create Your Intelligent Decision Service¶
- Visit start.aletyx.ai
- Select the "Intelligent Decision Service" template
- Fill out the form or leave it as is to create a project called
start-with-aletyx
- Click "Download Project" to get your starter code
Step 2: Configure Maven Access to Aletyx Repository¶
Add the following to your ~/.m2/settings.xml
file to connect to the Aletyx Maven repository:
<settings>
<servers>
<server>
<id>aletyx-maven</id>
<username>your-username</username>
<password>your-token</password>
</server>
</servers>
<profiles>
<profile>
<id>aletyx-repo</id>
<repositories>
<repository>
<id>aletyx-maven</id>
<url>https://maven.aletyx.services</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>aletyx-repo</activeProfile>
</activeProfiles>
</settings>
Tip
Contact Aletyx at aletyx.ai/contact-us to get your own token.
Step 3: Understand and Modify the DMN Model¶
The downloaded project includes a sample DMN model. For the traffic violation example:
- Open the project in your preferred IDE
- Navigate to
src/main/resources/dmn/
- Locate the DMN model file (e.g.,
TrafficViolation.dmn
) -
Use the DMN editor in your IDE or a standalone DMN tool to modify the model as needed
The sample traffic violation model includes: - Input variables like
Speed
,Actual Speed
, andSpeed Limit
- Decision tables for calculating fines and points - Output values for the fine amount and license points
Step 4: Build and Run the Service¶
- Navigate to your project directory in the terminal
-
Build and run the application:
-
Verify the service is running by checking:
- The console output should show that Spring Boot has started successfully
- The MCP endpoints are available (typically at http://localhost:8080/sse)
Step 5: Configure Claude Desktop for MCP Connection¶
- Download and install Claude Desktop
- Open Claude Desktop
- Go to Settings → Developer Settings
-
Add the following configuration to enable MCP:
-
Save the settings
-
You will need to add
mcp-remote
which can be done by doing:or if you don't want globally using:
-
Close and reopen Claude Desktop to allow the connection to be built.
Step 6: Test the Integration¶
-
In the latest updates of Claude Desktop, the toggle icon on the chat is where the MCP Tools have been relocated to. In the screenshot you can see that the connection is active (especially when there are numbers attached to the
remote-example
which is what our properties were configured as).Older versions of Claude Desktop had this as a standalone icon, but this has moved
Older versions of Claude Desktop might show a hammer icon, indicating the MCP connection is active, but this has recently been removed in favor of the toggle talked in the step.
-
You can see the tools that are available for usage with your Claude Desktop which can include getting the schemas of the DMN and also for executing them.
-
Enter a prompt that would trigger the DMN model. For the traffic violation example:
-
If prompted to allow connections, select "Allow" or "Yes"
- You may need to resubmit the same prompt again if the first attempt doesn't connect properly
- Claude should now respond with decision information derived directly from your DMN model
Troubleshooting¶
If you encounter connection issues:
- Verify your Spring Boot application is running properly
- Check the Spring Boot logs for any MCP-related errors
-
Try clearing the MCP authentication cache:
-
Restart both the Spring Boot application and Claude Desktop
- Ensure you're using compatible versions of MCP client and server
- Check for any network issues or firewalls blocking the connection
Next Steps¶
- Create more complex DMN models for your business decisions
- Integrate with existing business rules and processes
- Extend the Spring Boot service with additional APIs
- Connect other MCP-compatible clients to your decision service