lexq
55 MCP tools for managing business rules. Create policy groups, define rules, run dry-run tests, batch simulations, A/B testing, deployments, and integrations.
README
LexQ CLI
CLI and MCP server for LexQ — a rule engine with built-in simulation. Manage policies, simulate rules, and deploy from the terminal. Built for humans and AI agents.
Install
npm install -g @lexq/cli
Or run without installing:
npx @lexq/cli
Requires Node.js 18+.
Quick Start
# 1. Authenticate
lexq auth login
# Enter your API key (create one at console.lexq.io → Management → API Keys)
# 2. Verify
lexq auth whoami
# 3. Create a policy group
lexq groups create --json '{"name":"my-policy","priority":0}'
# 4. Create a draft version
lexq versions create --group-id <GROUP_ID> --json '{"commitMessage":"v1"}'
# 5. Add a rule
lexq rules create --group-id <GROUP_ID> --version-id <VERSION_ID> --json '{
"name": "VIP Discount",
"priority": 0,
"condition": {
"type": "SINGLE",
"field": "customer_tier",
"operator": "EQUALS",
"value": "VIP",
"valueType": "STRING"
},
"actions": [{
"type": "DISCOUNT",
"parameters": {"method":"PERCENTAGE","rate":10,"refVar":"payment_amount"}
}]
}'
# 6. Test
lexq analytics dry-run --version-id <VERSION_ID> --debug --mock \
--json '{"facts":{"customer_tier":"VIP","payment_amount":100000}}'
# 7. 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"
Commands
lexq auth login | logout | whoami
lexq status API health check
lexq groups list | get | create | update | delete
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
lexq deploy publish | live | rollback | undeploy | history | detail | overview
lexq analytics dry-run | dry-run-compare | requirements
lexq analytics simulation start | status | list | cancel | export
lexq analytics dataset upload | template
lexq history list | get | stats
lexq integrations list | get | save | delete | config-spec
lexq logs list | get | action | bulk-action
Global Options
| Flag | Description |
|---|---|
--format <json|table> |
Output format (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 |
AI Agent Skills
LexQ CLI ships with AI Agent Skills — structured documentation that AI coding agents can read to autonomously manage policies.
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, batch simulation, compare
├── lexq-execution/SKILL.md Execution history, stats, failure logs
└── lexq-recipes/SKILL.md 10 end-to-end recipes
.claude/CLAUDE.md Claude Code project context
AGENTS.md Universal agent guide (Cursor, Windsurf, Gemini CLI, Cline)
CONTEXT.md Platform architecture & glossary
For AI Agent Developers
Skills are included in the npm package. 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
Or reference them directly in your project by copying the skills/ directory.
Configuration
Config is stored at ~/.lexq/config.json:
{
"apiKey": "sk_live_xxxxxxxxxxxxx",
"baseUrl": "https://api.lexq.io/api/v1/partners",
"format": "json"
}
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
bash tests/e2e.sh # E2E tests (requires API key)
MCP Server Mode
LexQ exposes 55 policy engine tools via MCP. Two connection methods:
Claude.ai (Cloud — no install)
- Go to Settings → Connectors → Add Custom Integration
- Enter:
https://mcp.lexq.io - Sign in with your LexQ account and select an API key
- Done — 55 tools 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 required. Your AI client will handle authorization automatically.
Local (stdio)
Run LexQ CLI as a local MCP server:
lexq serve --mcp
This starts a stdio MCP server exposing 55 tools — the full LexQ API — to any MCP-compatible client.
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.
License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.