The project “openrules.samples/AI/LoanMCP” demonstrates how to deploy the “Loan” decision model as an MCP Server. First, we need to do the following:
- Add “mcp=http” to the “project.properties” file.
- Update “pom.xml” with the “openrules-mcp” dependency and a special plugin.
Then we need to register this MCP Server with the selected AI Agent (such as OpenAI Codex or Claude Code). We can use one of two MCP transport mechanisms:
- STDIO (standard input/output) for local processes
- Streamable HTTP for local or remote connections
STDIO. First, package the project by running the standard “package.bat”. It will package this decision model into the file “Loan_Selection.jar” inside the folder “target”. Let’s assume that the full path to this jar-file is C:\OpenRules.12.0.0\LoanMCP\target\Loan_Selection.jar.
We will demonstrate how to connect this MCP server using the Codex graphical interface. Select “Settings + MCP Server” and define your MCP server as follows:

After “Save”, we can initiate the dialogue by entering:
“Use loan_optimize mcp server for any loan request“. Then Codex will respond:

And we can start entering concrete input data for our loan request. The actual dialog will be very similar to the one described here.
Streamable HTTP. First, we need to run the following script provided in the file “runServer.bat”:
java -jar target/Loan_Selection.jar –http 8091
It will produce:

From the Codex graphical interface, select “Settings + MCP Server” and define your MCP server as follows:

Then the dialogue will be the same as above for STDIO.

