Get the FREE Ultimate OpenClaw Setup Guide →

4D-ARE

Build LLM agents that explain why, not just what. Attribution-driven agent requirements engineering framework. Based on the 4D-ARE Paper - https://arxiv.org/abs/2601.04556

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ybeven-4d-are python -m four_d_are mcp start --type mysql \
  --env MYSQL_HOST="localhost" \
  --env MYSQL_DATABASE="analytics" \
  --env MCP_SERVER_TYPE="mysql or demo or postgres or excel"

How to use

4D-ARE (Attribution-Driven Agent Requirements Engineering) is an MCP-enabled framework that helps you build and run LLM agents capable of reasoning through causal 4D analyses. By connecting to your data sources via MCP, the agent can retrieve contextual data from the configured backend (e.g., a MySQL database) and produce structured explanations that trace the cause-effect chain across Results, Process, Support, and Long-term dimensions. You can start the MCP server using the provided CLI, then run analyses with natural language prompts to obtain interpretive, domain-aware insights rather than just raw metrics. The included DomainTemplate facility lets you tailor the agent to specific domains (Healthcare, Banking, E-commerce) and enforce boundaries (e.g., never prescribing treatments in Healthcare). The integration examples show how to configure MCP data sources and how to run the analysis workflow end-to-end.

How to install

Prerequisites:

  • Python 3.9+ installed on your system
  • Access to a compatible MCP backend (e.g., MySQL, PostgreSQL, a demo mode, or Excel-based store)
  • Network access to the MCP data source if hosted remotely
  1. Create a Python virtual environment (recommended): python -m venv venv source venv/bin/activate # on macOS/Linux .\venv\Scripts\activate # on Windows

  2. Install the Four-D-ARE package from PyPI: pip install four-d-are

  3. Configure your MCP backend environment variables (example for MySQL):

    • MCP_SERVER_TYPE=mysql
    • MYSQL_HOST=localhost
    • MYSQL_DATABASE=analytics
  4. Start the MCP-enabled MCP server (examples assume Python module entry): python -m four_d_are mcp start --type mysql

  5. Run an analysis against your configured MCP data source: python -m four_d_are mcp start --type mysql

    Then in your workflow, invoke the analyze CLI or API as documented within the project

Notes:

  • If you prefer a different backend, adjust MCP_SERVER_TYPE and related host/database variables accordingly (demo, postgres, excel).
  • The project also provides domain templates and a CLI workflow for quick demos (four-d-are demo, four-d-are analyze "...").

Additional notes

Tips and common issues:

  • Ensure your MCP_SERVER_TYPE and corresponding host/database credentials are correctly set before starting the MCP server.
  • If using the HEALTHCARE_TEMPLATE or other domain templates, verify that the boundaries (e.g., never recommend treatments) are enforced by the template.
  • When running in production, manage secrets (OPENAI_API_KEY, MCP credentials) with environment variables or a secrets manager, not in code or env files committed to VCS.
  • The MCP integration supports multiple data sources; if one source is unavailable, you can switch MCP_SERVER_TYPE to a different backend (demo, postgres, excel) for testing.
  • Check the MCP docs referenced in the README for deeper customization options and domain-specific templates.

Related MCP Servers

Sponsor this space

Reach thousands of developers