Managing Business Rules with AI Agents: What MCP Changes
AI agents can now create, test, and deploy business rules autonomously. Here's how the Model Context Protocol(MCP) makes it possible — and why it matters for engineering teams.
The Missing Piece in AI Agent Workflows
AI agents are getting good at writing code, summarizing documents, and answering questions. But ask one to change a pricing rule in your production system, and it hits a wall.
Why? Because most business rules live inside application code. To change them, you need a PR, a code review, a staging deploy, and a production release. No AI agent can safely do that autonomously — nor should it.
But what if the rules lived outside the code? What if an AI agent could create a rule, simulate its impact against real data, and deploy it — all through a standardized protocol?
That's what MCP makes possible.
What Is MCP?
The Model Context Protocol (MCP) is an open standard that lets AI agents interact with external tools and services. Think of it as a universal adapter: instead of building custom integrations for every AI platform, you expose your API as an MCP server, and any MCP-compatible agent can use it.
MCP defines a standard way for agents to discover available tools, understand their parameters, and call them. The agent doesn't need to know your internal API structure — it reads the tool descriptions and figures out what to call.
Why Business Rules + MCP Is a Natural Fit
Business rules are perfect for AI agent management because they have two properties:
1. Rules are declarative. A business rule is "if the customer is VIP and the cart is over $100, give 20% off." This is natural language that maps directly to structured conditions and actions. An AI agent can understand and generate this without ambiguity.
2. Rules need a safety net. Unlike code changes, rule changes in LexQ can be simulated before deployment. An AI agent can create a rule, dry-run it against test data, check the results, and only deploy if the simulation passes. This is the kind of guardrail that makes autonomous operation safe.
Compare this to asking an AI agent to modify application code directly — there's no built-in way to preview the impact before it hits production.
What 55 MCP Tools Look Like in Practice
LexQ exposes 55 tools through its MCP server. Here's what an AI agent can do with them:
Rule Lifecycle:
- Create and manage policy groups
- Create, update, and reorder rules within versions
- Define input variables (facts) with types and validation
- Publish draft versions and deploy to live traffic
Testing & Validation:
- Run dry runs with custom inputs
- Compare dry run results between two versions
- Start batch simulations against historical data
- Check simulation results and export them
Deployment & Operations:
- Deploy versions to live traffic
- Roll back to previous versions
- Start and stop A/B tests
- Adjust A/B test traffic weights
- Monitor execution history and statistics
Integration & Monitoring:
- Configure webhooks and external integrations
- View and process failure logs
- Check execution KPIs
This isn't a toy demo. It's the full production API, exposed as MCP tools.
A Real Workflow: AI Agent Changes a Discount Rule
Here's what actually happens when you ask an AI agent to "change the VIP discount from 20% to 25% and make sure it doesn't break anything":
- Agent calls
lexq_rules_listto find the current VIP discount rule - Agent calls
lexq_versions_cloneto create a new draft version - Agent calls
lexq_rules_updateto change the discount from 20% to 25% - Agent calls
lexq_dry_runwith sample VIP customer data to verify the rule fires correctly - Agent calls
lexq_simulation_startto replay last week's execution data against the new version - Agent calls
lexq_simulation_statusto check results — match rate, metric deltas, per-rule statistics - If simulation looks good, agent calls
lexq_deploy_publishthenlexq_deploy_live - If something looks wrong, the agent reports the issue instead of deploying
Every step is auditable. Every decision has a trace. The agent never touches application code.
Two Ways to Connect
Remote Server (OAuth 2.1):
{
"mcpServers": {
"lexq": {
"url": "https://mcp.lexq.io"
}
}
}
Connect from Claude Desktop, Cursor, or any MCP-compatible client. Authentication happens through OAuth 2.1 — no API keys to manage manually.
Local Server via CLI:
{
"mcpServers": {
"lexq": {
"command": "npx",
"args": ["-y", "@lexq/cli", "serve", "--mcp"]
}
}
}
Run locally for development and testing. Same 55 tools, same capabilities.
AI Agent Skills: Beyond Tool Calling
MCP tools let agents execute actions. But how does an agent know when to use which tool, and in what order?
LexQ's CLI includes structured AI Agent Skills — markdown documents that coding agents (Claude Code, Cursor, Windsurf) can read to understand the full workflow. Think of them as instruction manuals for agents:
- When to create a new version vs. modify an existing draft
- How to run a proper simulation before deploying
- What to check in simulation results before promoting a version
- How to handle conflicts and rollbacks
The agent reads the skill document, understands the workflow, and executes it autonomously. No human needs to dictate each step.
What This Means for Engineering Teams
The shift isn't about replacing engineers. It's about removing engineers from the loop for routine rule changes.
Before MCP: Product manager asks engineer to change a threshold. Engineer writes PR, gets review, deploys. Elapsed time: days to weeks.
After MCP: Product manager tells AI agent to change the threshold. Agent creates the rule, simulates it, and deploys it — or flags issues for human review. Elapsed time: minutes.
Engineers stay in control of the system architecture, the rule structure, and the deployment policies. But they don't need to be the bottleneck for every "change this number from 100 to 75" request.
Getting Started
If you want to try this with your own rules:
- Create a free account at lexq.io (1,000 executions/month, no credit card)
- Set up a policy group and define some rules
- Connect the MCP server to your AI agent of choice
- Ask the agent to "show me all my policy groups" — and go from there
The MCP server works with any MCP-compatible client: Claude Desktop, Claude Code, Cursor, Windsurf, and any agent that supports the protocol.
→ Start free at lexq.io → MCP server on GitHub → Documentation