Skip to main content
MCP server CX Codex

Lex — Claude Code MCP server: what it does, how to install

Preserves decisions, blockers, and next steps across agent sessions without dumping conversation history.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env LEX_WORKSPACE_ROOT=<LEX_WORKSPACE_ROOT> --env LEX_STORE=<LEX_STORE> --env LEX_DB_PATH=<LEX_DB_PATH> --env LEX_MEMORY_DB=<LEX_MEMORY_DB> --env LEX_DATABASE_URL=<LEX_DATABASE_URL> --transport stdio lex -- npx -y @smartergpt/lex-mcp
Open on GitHub

What Lex does

Lex captures deliberate work checkpoints called Frames rather than logging entire chat transcripts. Each checkpoint stores the reasoning behind an architectural choice, blockers, and concrete next actions. When a new session opens, the agent retrieves only the matching topic context, skipping repetitive code inspections and prompt reconstruction.

Storage defaults to local SQLite inside .smartergpt/lex/. Teams that need shared context across machines can configure PostgreSQL instead through environment variables.

Runtime requires Node.js 24 or newer, and Linux systems need glibc 2.35 or higher to run bundled SQLite binaries.

What it helps with

  • pass architectural decisions and blockers to future agent sessions
  • record failed attempts so agents do not repeat them
  • bound context retrieval to specific topics with token limits
  • preserve work continuity across git branch switches

Example prompts for the agent

  • Save a checkpoint: token validation moved to middleware, blocked by PermissionService grant
  • Recall stored Lex decisions about authentication before touching the middleware
  • Retrieve Lex context for authentication bounded to 500 tokens

How to install Lex

Platform CLI

claude mcp add --env LEX_WORKSPACE_ROOT=<LEX_WORKSPACE_ROOT> --env LEX_STORE=<LEX_STORE> --env LEX_DB_PATH=<LEX_DB_PATH> --env LEX_MEMORY_DB=<LEX_MEMORY_DB> --env LEX_DATABASE_URL=<LEX_DATABASE_URL> --transport stdio lex -- npx -y @smartergpt/lex-mcp

Replace <…> with your own values. 3 more environment variables are in the server README

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 Lex

How do I install Lex in Claude Code?

Run `claude mcp add --env LEX_WORKSPACE_ROOT=<LEX_WORKSPACE_ROOT> --env LEX_STORE=<LEX_STORE> --env LEX_DB_PATH=<LEX_DB_PATH> --env LEX_MEMORY_DB=<LEX_MEMORY_DB> --env LEX_DATABASE_URL=<LEX_DATABASE_URL> --transport stdio lex -- npx -y @smartergpt/lex-mcp`.

What does Lex store?

It records discrete checkpoints containing task summaries, module scopes, blockers, and next steps. It discards raw chat dialogs to keep prompt sizes bounded.

Which database does Lex use?

Local SQLite is the default storage engine. You can switch to PostgreSQL via the LEX_STORE environment variable when sharing memory across environments.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor