Lets an AI client manage business rules, run impact simulations, and deploy policy changes without requiring a code deployment.
Also known as lexq-io/lexq-cli, lexq-cli, @lexq/cli
- Stars
- 1
- Tools
- —
- Downloads, 30 days
- 3,371
- Latest version
- 3.1.0
- Last commit
- Nov 12, 2026
- License
- Apache-2.0
What is LexQ MCP?
LexQ lets an AI client manage business rules, run impact simulations, and deploy policy changes without requiring a code deployment.
Summary generated from the project's README
About LexQ MCP server
Engineering teams can manage business logic like pricing, promotions, and eligibility checks through LexQ without triggering a full code deployment. This MCP server allows AI agents to interact directly with your decision operations, enabling them to manage policy groups, rules, and facts. By moving these rules out of the standard git push and PR cycle, teams can iterate on logic much faster while maintaining a full audit trail of every decision.
Users can connect via a remote Streamable HTTP endpoint or run a local stdio server using the LexQ CLI. Setting up the server requires an API key with Manage scope, which can be provided via environment variables like LEXQ_API_KEY or through a local configuration file. The server supports multiple protocol revisions to ensure compatibility with different AI clients like Claude or Cursor.
Beyond simple rule management, the platform provides tools for Impact Simulation and dry runs to test changes against datasets or past executions. This ensures that new policies are validated before they go live. The server also provides access to execution history, latency profiles, and decision replays to help developers understand how rules are performing in real time.
What you can do with it
- 1Simulate rule changesRun a dry run to see how a specific set of facts would interact with a new rule version before deploying.
- 2Deploy business logicPublish and activate new policy versions to live traffic without requiring a new application release.
- 3Audit decision historyReview past executions and decision logs to understand why specific rules were applied.
- 4Manage policy groupsCreate and update different policy groups or perform A/B testing on rule sets.
Written from the project's README. Every use case is checked against a quote from it.
How to install LexQ MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall LexQ MCP in Claude Code
$ claude mcp add --env 'LEXQ_API_KEY=<YOUR_LEXQ_API_KEY>' lexq-cli -- npx -y @lexq/cliInstall LexQ MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"lexq-cli": {
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<YOUR_LEXQ_API_KEY>"
}
}
}
}Install LexQ MCP in VS Code
.vscode/mcp.json
{
"servers": {
"lexq-cli": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<YOUR_LEXQ_API_KEY>"
}
}
}
}Install LexQ MCP in VS Code CLI
$ code --add-mcp '{"name":"lexq-cli","type":"stdio","command":"npx","args":["-y","@lexq/cli"],"env":{"LEXQ_API_KEY":"<YOUR_LEXQ_API_KEY>"}}'Install LexQ MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"lexq-cli": {
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<YOUR_LEXQ_API_KEY>"
}
}
}
}Install LexQ MCP in Codex
$ codex mcp add lexq-cli --env 'LEXQ_API_KEY=<YOUR_LEXQ_API_KEY>' -- npx -y @lexq/cliInstall LexQ MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.lexq-cli] command = "npx" args = ["-y", "@lexq/cli"] [mcp_servers.lexq-cli.env] LEXQ_API_KEY = "<YOUR_LEXQ_API_KEY>"
Install LexQ MCP in Gemini CLI
$ gemini mcp add -s user -e 'LEXQ_API_KEY=<YOUR_LEXQ_API_KEY>' lexq-cli npx -- -y @lexq/cliInstall LexQ MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"lexq-cli": {
"command": "npx",
"args": [
"-y",
"@lexq/cli"
],
"env": {
"LEXQ_API_KEY": "<YOUR_LEXQ_API_KEY>"
}
}
}
}Configuration
LEXQ_API_KEYRequiredSecretLexQ API key. Or leave it unset and run `lexq auth login` once.
| Name | Description | |
|---|---|---|
| LEXQ_API_KEY | LexQ API key. Or leave it unset and run `lexq auth login` once. | RequiredSecret |
Automated checks
Ran Nov 13, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachablePass
- Open source license (OSI)Pass
- Commit or release in the last yearPass
- Package name not close to a popular packagePass
- Remote endpoint uses HTTPSPass
- Destructive tools are labelledNot checked
- No hidden instructions to the modelPass
- No critical advisory in the package or its dependenciesPass
README
View on GitHubLexQ CLI
The Decision Operations Platform for engineering teams. CLI and MCP server for LexQ. Move business rules out of your deploy pipeline, prove every change with Impact Simulation, and ship without a git push.
Website · Docs · Console · MCP Registry
Why LexQ?
Your business rules, such as pricing, promotions, fee logic, and eligibility checks, change often. But every change ships through the same PR → review → staging → deploy cycle as your core application code, so even a small change waits for the next release.
LexQ keeps those rules out of your code. Your service calls the LexQ API to evaluate them. You change rules in a visual console or through this CLI, test each change with Impact Simulation against past executions or a dataset you upload, and deploy them without an application release.
Every decision leaves a full audit trail.
Install
npm install -g @lexq/cli
Or run without installing:
npx @lexq/cli
Requires Node.js 22+.
Quick Start
# 1. Authenticate
lexq auth login
# Enter your API key (create one with the Manage scope at console.lexq.io → Management → API Keys)
# 2. Verify
lexq auth whoami
# 3. Start from a domain template — provisions facts, sample rules, and a policy group
lexq domain-templates list
lexq domain-templates apply --template ECOMMERCE
# Returns: policyGroupId, policyVersionId, factsCreated, rulesCreated
# 4. Test a rule against your data before shipping
lexq analytics dry-run --version-id <VERSION_ID> --debug \
--json '{"facts":{"loyaltyTier":"PLATINUM","purchaseSubtotalUsd":150}}'
# 5. Deploy
lexq deploy publish --group-id <GROUP_ID> --version-id <VERSION_ID> --memo "v1"
lexq deploy live --group-id <GROUP_ID> --version-id <VERSION_ID> --memo "Initial deploy"
For AI Agents
Claude, Cursor, and other MCP-compatible agents can use the Model Context Protocol to manage policy groups, versions, rules, and facts, run simulations and replays, deploy versions, and read execution history.
Approval happens in your MCP client, which decides which tool calls you confirm. A tool is marked as destructive when it deletes, overwrites, or cancels something, changes live traffic, cannot be undone, or counts toward your plan's usage, so a client can ask you before running it.
Claude.ai (cloud, no install)
- Customize → Connectors → + Add → Add custom connector
- Name it, enter
https://mcp.lexq.io, and choose Sign in now - On the LexQ page that opens, sign in and generate a new API key for MCP, or choose I already have an API key and paste an existing one
- The tools are now available in every conversation
Remote (Streamable HTTP)
For any MCP client that supports remote servers:
{
"mcpServers": {
"lexq": {
"url": "https://mcp.lexq.io"
}
}
}
OAuth 2.1 authentication is handled automatically by your client.
Local (stdio)
Run LexQ CLI as a local MCP server:
lexq serve --mcp
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"lexq": {
"command": "npx",
"args": [
"-y",
"@lexq/cli",
"serve",
"--mcp"
]
}
}
}
VS Code / Cursor
.vscode/mcp.json:
{
"servers": {
"lexq": {
"command": "npx",
"args": [
"-y",
"@lexq/cli",
"serve",
"--mcp"
]
}
}
}
Prerequisite:
lexq auth loginmust have been run once to store an API key in~/.lexq/config.json, orLEXQ_API_KEYmust be set in the client's environment block.
Registry
The server is listed on the official MCP Registry as io.lexq/lexq. Clients that
browse the registry find both the npm package and the hosted endpoint in that one entry.
Protocol Support
The local stdio server and the hosted Streamable HTTP endpoint both serve two MCP revisions from one set of tool definitions, so a client sees the same tools either way.
| Revision | How a client reaches it |
|---|---|
2026-07-28 |
A per-request _meta envelope. No handshake. |
2025-11-25 |
The initialize handshake. |
There is nothing to configure. The server answers in whichever revision the opening message used, so a client can move to 2026-07-28 on its own schedule and one that has not moved keeps working.
AI Agent Skills
LexQ CLI ships with AI Agent Skills: structured documentation that tells agents how to use each tool.
Each SKILL.md starts with name and description frontmatter in the
Agent Skills format. An agent that loads
skills reads those two fields at startup and opens a skill when a task matches
its description.
skills/
├── lexq-shared/SKILL.md Core concepts, auth, workflow
├── lexq-groups/SKILL.md Policy groups, conflict resolution, A/B testing
├── lexq-rules/SKILL.md Condition syntax, action types, mutex
├── lexq-simulation/SKILL.md Dry run, Impact Simulation, compare
├── lexq-execution/SKILL.md History, stats, failure logs, provenance, replay, latency profile
└── lexq-recipes/SKILL.md End-to-end recipes
CLAUDE.md Claude Code entry point, imports AGENTS.md
AGENTS.md Universal agent guide (Cursor, Windsurf, Gemini CLI, Cline)
CONTEXT.md Platform architecture & glossary
After installing @lexq/cli, agents can read skills from:
node_modules/@lexq/cli/skills/
node_modules/@lexq/cli/AGENTS.md
node_modules/@lexq/cli/CONTEXT.md
Commands
lexq auth login | logout | whoami
lexq status API health check
lexq serve Run as MCP stdio server (--mcp)
lexq groups list | get | create | update | delete | reorder
lexq groups ab-test start | stop | adjust
lexq versions list | get | create | update | delete | clone
lexq rules list | get | create | update | delete | reorder | toggle
lexq facts list | create | update | delete | action-metadata | unregistered
lexq domain-templates list | preview | apply
lexq deploy publish | live | rollback | undeploy | history | detail | overview | deployable | diff | schedule | unschedule | schedules
lexq analytics dry-run | dry-run-compare | requirements
lexq analytics simulation start | status | list | cancel | export
lexq analytics dataset upload | template
lexq profile <groupId> — per-rule latency profile
lexq history list | get | stats
lexq replay decision | start | list | get | cancel
lexq logs list | get
lexq provenance get | reveal-audits
lexq webhook-subscriptions list | get | save | delete | test
Global Options
| Flag | Description |
|---|---|
--format <json|table> |
How results are printed (default: json) |
--api-key <key> |
Override stored API key |
--base-url <url> |
Override API base URL |
--dry-run |
Preview the HTTP request without executing |
--verbose |
Show request/response details |
--no-color |
Disable colored output |
--format only changes how results are printed. A command that writes a file, such as lexq facts export, chooses the file's format with --as csv or --as json.
Configuration
Config is stored at ~/.lexq/config.json:
{
"apiKey": "YOUR_API_KEY",
"baseUrl": "https://api.lexq.io/api/v1/partners",
"format": "json"
}
The file holds an API key in plain text. It is saved with mode 0600 inside a 0700
directory, so only its owner can read it. If an older version created it with looser
permissions, the CLI tightens them the next time it saves the file.
Environment variables
These are read by the MCP server (lexq serve --mcp) and take precedence over the stored
config. They let an editor or CI target an environment through the client's own config block,
without writing to ~/.lexq/config.json. CLI commands use --api-key and --base-url instead.
| Variable | Overrides |
|---|---|
LEXQ_API_KEY |
apiKey |
PARTNER_BASE_URL |
baseUrl |
Development
git clone https://github.com/lexq-io/lexq-cli.git
cd lexq-cli
pnpm install
pnpm build
pnpm start -- groups list
pnpm typecheck # Type check
pnpm lint # ESLint
pnpm build # Bundle to dist/
Checks that guard a stated fact against the thing that owns it. All of them run in CI.
pnpm enums:check # Generated enums match the engine contract
pnpm prose:check # Numbers and code tables in prose match the contract
pnpm ab-key:check # Tool descriptions still name the A/B traffic key
pnpm surface:check # Nothing internal reached a public file
pnpm registry:check # server.json agrees with package.json and src/mcp/server-info.json
pnpm schemas:check # tools/list matches the recorded snapshot (needs a build)
pnpm test:fact-key # Fact key grammar
pnpm test:decimals # Metric precision display
pnpm test:export-format # Export byte fidelity
pnpm protocol:check # README matches the revisions the server serves
Security
Report a vulnerability through GitHub's private reporting form. The policy, including what is in scope, is in SECURITY.md.
License
LexQ MCP questions
How do I add LexQ MCP to Claude Code?
Run claude mcp add --env 'LEXQ_API_KEY=<YOUR_LEXQ_API_KEY>' lexq-cli -- npx -y @lexq/cli in your terminal. Add --scope user to make it available in every project.
How do I add LexQ MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
How can AI agents use LexQ?
Claude, Cursor, and other MCP-compatible agents can use the Model Context Protocol to manage policy groups, versions, rules, and facts, run simulations, and deploy versions.
Can I run LexQ as a local MCP server?
Yes, you can run the LexQ CLI as a local stdio server using the command lexq serve --mcp.
What is the benefit of using LexQ for business rules?
It allows you to move business rules out of your deployment pipeline, enabling you to change rules and deploy them without an application release.