Integrate aare-core Z3 verification directly into Claude Desktop, Claude Code, or any MCP-compatible AI application.
The Model Context Protocol (MCP) is an open standard that allows
AI applications to connect to external tools and data sources. With aare-mcp,
you can give Claude (or any MCP-compatible LLM) the ability to formally verify its
own outputs against compliance rules.
pip install aare-mcp
git clone https://github.com/aare-ai/aare-mcp.git
cd aare-mcp
pip install -e .
aare-mcp --help
Add the following to your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json{
"mcpServers": {
"aare-verify": {
"command": "aare-mcp"
}
}
}
Add to your project's .claude/mcp.json or global MCP configuration:
{
"mcpServers": {
"aare-verify": {
"command": "aare-mcp"
}
}
}
{
"mcpServers": {
"aare-verify": {
"command": "aare-mcp",
"env": {
"ONTOLOGY_DIR": "/path/to/your/ontologies"
}
}
}
}
The aare-mcp server exposes three tools that Claude can use:
Verify LLM output against a compliance ontology using the Z3 SMT solver. Returns verification result with any constraint violations and formal proof.
| llm_output | string, required | The LLM-generated text to verify |
| ontology | string, required | Name of the ontology (e.g., mortgage-compliance-v1) |
List all available compliance ontologies that can be used for verification.
No parameters required.
Extract structured data from LLM output using ontology-defined extractors. Useful for debugging what values will be verified.
| llm_output | string, required | The LLM-generated text to parse |
| ontology | string, required | Name of the ontology containing extractor definitions |
When Claude generates a mortgage recommendation, it can verify compliance:
Based on your income of $75,000 and the property value of $400,000,
I recommend a loan amount of $320,000 with an APR of 6.5%.
{
"verified": true,
"ontology": "mortgage-compliance-v1",
"violations": [],
"parsed_data": {
"income": 75000,
"property_value": 400000,
"loan_amount": 320000,
"apr": 6.5
},
"proof": {
"method": "Z3 SMT Solver",
"version": "4.12.1"
},
"execution_time_ms": 12
}
I can offer you a loan with a DTI ratio of 55% which is quite manageable.
{
"verified": false,
"violations": [
{
"constraint_id": "MAX_DTI",
"error_message": "DTI exceeds 43% QM threshold",
"citation": "12 CFR § 1026.43(c)"
}
],
"parsed_data": {
"dti": 55
}
}
{
"ontologies": [
"example",
"fair-lending-v1",
"hipaa-v1",
"mortgage-compliance-v1"
],
"count": 4
}
You can add your own ontology JSON files for verification. See the Rule Authoring Guide for how to write ontologies.
export ONTOLOGY_DIR=/path/to/your/ontologies
aare-mcp
{
"mcpServers": {
"aare-verify": {
"command": "aare-mcp",
"env": {
"ONTOLOGY_DIR": "./my-ontologies"
}
}
}
}
my-ontologies/
├── my-compliance-v1.json
├── internal-policy-v1.json
└── custom-rules-v1.json
Check: Restart Claude Desktop after modifying the config file. Verify the config JSON is valid (no trailing commas, proper quotes).
Check: Run list_ontologies to see available ontologies.
Ensure your ONTOLOGY_DIR path is correct and contains valid JSON files.
Solution: Complex formulas may take longer. The default timeout is 5 seconds per constraint. Simplify your formulas or break them into smaller constraints.