LexQ — Claude Code MCP server: business rules, no app release
Hooks an agent up to LexQ, where pricing, discounts and eligibility checks get edited without redeploying your service. Handy if those rules move often.
claude mcp add --transport http lexq https://mcp.lexq.io/mcpWhat LexQ does
LexQ takes business logic out of your codebase. Your service asks the LexQ API for a decision, while the rules themselves live in a console or in @lexq/cli. You can trial an edit against earlier runs or an uploaded dataset, then push it live without cutting an app release.
Over MCP the agent manages policy groups, versions, rules and facts, starts simulations and looks at how past decisions turned out. Deploy, rollback and undeploy tools carry a destructive flag, so the client may ask you to confirm. Two connection modes exist: the hosted endpoint https://mcp.lexq.io with OAuth 2.1, and a local stdio server started by lexq serve --mcp.
The stdio route needs an API key stored via lexq auth login in ~/.lexq/config.json, or LEXQ_API_KEY set in the client's environment. The CLI asks for Node.js 22+. Skip the key and the local server won't come up. Skill files ship inside the package under node_modules/@lexq/cli/skills/, so the agent can read how each tool should be called.
What it helps with
- tweak a discount or shipping threshold without shipping new service code
- test a rule edit against earlier decisions before going live
- let an agent reach policy groups and versions through MCP
- trace why a rule fired a certain way via execution history
- roll back a bad rules deploy with one command
Example prompts for the agent
- List the policy groups in LexQ and their current versions.
- Run a dry-run of version
<VERSION_ID>on facts{"loyaltyTier":"PLATINUM","purchaseSubtotalUsd":150}and explain the outcome. - Publish version
<VERSION_ID>in group<GROUP_ID>with the memo “v1”.
How to install LexQ
1Platform CLI: remote server
claude mcp add --transport http lexq https://mcp.lexq.io/mcp2Platform CLI
claude mcp add --env LEXQ_API_KEY=<LEXQ_API_KEY> --transport stdio lexq -- npx -y @lexq/cliReplace <…> with your own values
1Platform CLI: remote server
codex mcp add lexq --url https://mcp.lexq.io/mcp2Platform CLI
codex mcp add lexq --env LEXQ_API_KEY=<LEXQ_API_KEY> -- npx -y @lexq/cliReplace <…> with your own values
Config file
{
"mcpServers": {
"lexq": {
"url": "https://mcp.lexq.io/mcp"
}
}
}{
"mcpServers": {
"lexq": {
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<LEXQ_API_KEY>"
}
}
}
}Replace <…> with your own values
Config file
{
"servers": {
"lexq": {
"type": "http",
"url": "https://mcp.lexq.io/mcp"
}
}
}{
"servers": {
"lexq": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<LEXQ_API_KEY>"
}
}
}
}Replace <…> with your own values
1Platform CLI: remote server
gemini mcp add -t http lexq https://mcp.lexq.io/mcp2Platform CLI
gemini mcp add -e LEXQ_API_KEY=<LEXQ_API_KEY> lexq npx -y @lexq/cliReplace <…> with your own values
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about LexQ
How do I install LexQ in Claude Code?
Hosted server: claude mcp add --transport http lexq https://mcp.lexq.io/mcp. Local server: claude mcp add --env LEXQ_API_KEY=<LEXQ_API_KEY> --transport stdio lexq -- npx -y @lexq/cli.
What does LexQ do?
It keeps business rules outside your application and lets you change, test and publish them without a service release. The MCP server exposes those operations to an agent, from policy group work to reading past executions.
What does the local MCP server need?
Node.js 22+ and an API key. The key either sits in ~/.lexq/config.json after lexq auth login or is passed as LEXQ_API_KEY in the client environment.