MCP Server Studio

Lex MCP server

Episodic memory, Frames, Policy Neighborhoods, and policy enforcement for AI agents.

Registry name: dev.smartergpt/lex

Publisher
smartergpt.dev
Runs
Runs locally
Package
npm
Version
4.4.4
Category
AI & agents
Updated
2026-10-20

Source code on GitHub

Set up Lex (run locally)

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "lex": {
      "command": "npx",
      "args": [
        "-y",
        "@smartergpt/[email protected]"
      ],
      "env": {
        "LEX_WORKSPACE_ROOT": "<LEX_WORKSPACE_ROOT>",
        "LEX_STORE": "<LEX_STORE>",
        "LEX_DB_PATH": "<LEX_DB_PATH>",
        "LEX_MEMORY_DB": "<LEX_MEMORY_DB>",
        "LEX_DATABASE_URL": "<LEX_DATABASE_URL>",
        "LEX_POSTGRES_PASSWORD": "<LEX_POSTGRES_PASSWORD>",
        "LEX_POSTGRES_POOL_MAX": "<LEX_POSTGRES_POOL_MAX>",
        "LEX_DEBUG": "<LEX_DEBUG>"
      }
    }
  }
}

Claude Code

Run in your terminal:

claude mcp add lex -e LEX_WORKSPACE_ROOT='<LEX_WORKSPACE_ROOT>' -e LEX_STORE='<LEX_STORE>' -e LEX_DB_PATH='<LEX_DB_PATH>' -e LEX_MEMORY_DB='<LEX_MEMORY_DB>' -e LEX_DATABASE_URL='<LEX_DATABASE_URL>' -e LEX_POSTGRES_PASSWORD='<LEX_POSTGRES_PASSWORD>' -e LEX_POSTGRES_POOL_MAX='<LEX_POSTGRES_POOL_MAX>' -e LEX_DEBUG='<LEX_DEBUG>' -- npx -y @smartergpt/[email protected]

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "lex": {
      "command": "npx",
      "args": [
        "-y",
        "@smartergpt/[email protected]"
      ],
      "env": {
        "LEX_WORKSPACE_ROOT": "<LEX_WORKSPACE_ROOT>",
        "LEX_STORE": "<LEX_STORE>",
        "LEX_DB_PATH": "<LEX_DB_PATH>",
        "LEX_MEMORY_DB": "<LEX_MEMORY_DB>",
        "LEX_DATABASE_URL": "<LEX_DATABASE_URL>",
        "LEX_POSTGRES_PASSWORD": "<LEX_POSTGRES_PASSWORD>",
        "LEX_POSTGRES_POOL_MAX": "<LEX_POSTGRES_POOL_MAX>",
        "LEX_DEBUG": "<LEX_DEBUG>"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "lex": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@smartergpt/[email protected]"
      ],
      "env": {
        "LEX_WORKSPACE_ROOT": "<LEX_WORKSPACE_ROOT>",
        "LEX_STORE": "<LEX_STORE>",
        "LEX_DB_PATH": "<LEX_DB_PATH>",
        "LEX_MEMORY_DB": "<LEX_MEMORY_DB>",
        "LEX_DATABASE_URL": "<LEX_DATABASE_URL>",
        "LEX_POSTGRES_PASSWORD": "<LEX_POSTGRES_PASSWORD>",
        "LEX_POSTGRES_POOL_MAX": "<LEX_POSTGRES_POOL_MAX>",
        "LEX_DEBUG": "<LEX_DEBUG>"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "lex": {
      "command": "npx",
      "args": [
        "-y",
        "@smartergpt/[email protected]"
      ],
      "env": {
        "LEX_WORKSPACE_ROOT": "<LEX_WORKSPACE_ROOT>",
        "LEX_STORE": "<LEX_STORE>",
        "LEX_DB_PATH": "<LEX_DB_PATH>",
        "LEX_MEMORY_DB": "<LEX_MEMORY_DB>",
        "LEX_DATABASE_URL": "<LEX_DATABASE_URL>",
        "LEX_POSTGRES_PASSWORD": "<LEX_POSTGRES_PASSWORD>",
        "LEX_POSTGRES_POOL_MAX": "<LEX_POSTGRES_POOL_MAX>",
        "LEX_DEBUG": "<LEX_DEBUG>"
      }
    }
  }
}

Settings

NameRequiredWhat it is
LEX_WORKSPACE_ROOTNoProject root directory for Lex runtime discovery. Defaults to current working directory.
LEX_STORENoFrame-store backend: sqlite or postgres. Defaults to sqlite unless LEX_DATABASE_URL selects PostgreSQL.
LEX_DB_PATHNoPath to SQLite database file. Defaults to .smartergpt/lex/memory.db under the project root.
LEX_MEMORY_DBNoAlias for LEX_DB_PATH (backwards compatibility). Same behavior.
LEX_DATABASE_URLNoPostgreSQL connection URL for the compatibility adapter. Treat as secret because it may contain credentials.
LEX_POSTGRES_PASSWORDNoPostgreSQL password supplied separately when LEX_DATABASE_URL omits one.
LEX_POSTGRES_POOL_MAXNoMaximum PostgreSQL compatibility-adapter pool size. Defaults to 10.
LEX_DEBUGNoSet to any value to enable debug logging to stderr.

More ai & agents MCP servers