# LexQ [Health: Active]

**Category:** ⚖️ Legal  
**Repository:** https://github.com/lexq-io/lexq-cli  
**GitHub Stars:** 1  
**npm Downloads (last month):** 2978  
**Views:** 1  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/lexq

## Description
Policy engine tools: author rules, simulate impact, replay decisions, and deploy.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "lexq": {
    "command": "npx",
    "args": ["-y","@lexq/cli"],
    "env": {
      "LEXQ_API_KEY": "",
      "PARTNER_BASE_URL": ""
    }
  }
}
```

**Requires environment variables:** `LEXQ_API_KEY`, `PARTNER_BASE_URL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What LexQ MCP server does

LexQ MCP server gives MCP-compatible agents access to LexQ's decision operations platform. It is intended for teams that keep business rules outside application code and call the LexQ API to evaluate them. Agents can manage policy groups, versions, rules, and facts; run simulations and replays; inspect execution history; and publish or change deployed versions.

The server covers the main lifecycle of a policy change. An agent can create or update rules, test a version with supplied facts, compare outcomes, inspect prior decisions, and deploy a selected version. Domain templates can provision facts, sample rules, and a policy group as a starting point.

## How it works

LexQ provides two connection modes with the same tool definitions:

- A hosted Streamable HTTP server at `https://mcp.lexq.io`.
- A local stdio server started with `lexq serve --mcp`.

Remote clients authenticate through OAuth 2.1. For local use, the CLI reads an API key saved by `lexq auth login`, or the MCP client's environment can provide `LEXQ_API_KEY`. The server can also use `PARTNER_BASE_URL` to select a different API base URL.

The CLI and hosted endpoint support MCP revisions `2026-07-28` and `2025-11-25`. Clients use the revision appropriate to their opening request; no protocol setting is required. Approval remains under the MCP client's control. Deployment, rollback, and undeploy operations are marked destructive so clients can request confirmation before executing them.

## Setup and configuration

Install the CLI globally with:

```bash
npm install -g @lexq/cli
```

Node.js 22 or newer is required. You can also run the package through `npx` without a global installation.

Authenticate the CLI with `lexq auth login`, then check the account with `lexq auth whoami`. The API key is stored in `~/.lexq/config.json`; the file is protected with owner-only permissions when saved by the CLI. For a local MCP client, configure the command as `npx -y @lexq/cli serve --mcp`, or run an installed `lexq serve --mcp` command.

A remote client can use this configuration:

```json
{
  "mcpServers": {
    "lexq": {
      "url": "https://mcp.lexq.io"
    }
  }
}
```

For local MCP use, set `LEXQ_API_KEY` in the client's environment or authenticate once with the CLI. `LEXQ_API_KEY` and `PARTNER_BASE_URL` take precedence over stored configuration for the MCP server.

## Tools and capabilities

Available operations cover:

- Policy groups, ordering, conflict resolution, and A/B tests.
- Policy versions, cloning, updates, and deletion.
- Rules, facts, rule ordering, toggles, and action metadata.
- Domain template listing, preview, and application.
- Dry runs, comparisons, Impact Simulation jobs, dataset uploads, exports, and cancellation.
- Publishing, going live, rollback, undeploy, deployment history, diffs, and schedules.
- Decision replay, execution history, statistics, failure logs, provenance, and latency profiles.
- Webhook subscription management and testing.

The package also includes agent-oriented skill files covering authentication, policy concepts, rule syntax, simulation, execution data, and end-to-end workflows.

## Limitations and notes

LexQ operations require access to the LexQ API and an API key with suitable permissions. The local configuration stores the API key as plain text, protected by filesystem permissions. Destructive deployment actions should be treated as approval-gated operations in the MCP client. The server manages LexQ policies and decisions; it does not replace the application service that evaluates those policies in production.

_Full upstream README: https://allmcps.com/mcp/lexq/readme_

