Setup and dashboard

How lex setup-with-ai wires the MCP server into a project and its coding tools, and what to confirm before starting an assistant request.

A
Written By Atakan KayaLast updated 3 months ago

Setup and dashboard

Setup wires the local MCP server into one specific LEX project and into the configuration of every coding tool you use on it. The dashboard is then where you confirm that state and choose a workflow mode before the assistant starts working.

Step 1 — Prepare the workspace

Run this from the root of the LEX project you want the assistant to work on:

lex setup-with-ai

The command is hyphenated. lex setup_with_ai does not exist and fails with No such command; the underscore form is only the internal Python module path.

Useful flags:

  • -e/--environment — select a coding tool, repeated once per tool. lex setup-with-ai --list-environments prints the keys, and with no recorded selection the JetBrains Copilot entry is the default.
  • --mcp-mode — the workflow mode the server should start in.
  • --github-token, --remote-mcp-url, --remote-mcp-api-key — credentials, if you would rather not paste them into the dashboard.
  • -p/--project-root — treat another directory as the project root; --no-browser suppresses the setup page.

What setup writes

For each selected tool, setup registers the server in that tool's own config format and renders the agents, slash commands, and workspace rules into its native layout. Every entry uses the single server name lex-mcp-local, and legacy namespaces are rewritten onto it, because a stale namespace grants your assistant no MCP access at all. Supported coding tools lists the config location for each one.

  • Existing configuration survives — writes are merge-preserving and atomic, so unrelated MCP servers, unknown keys, and TOML comments stay intact.
  • Your own prose is never overwritten — in CLAUDE.md and AGENTS.md only the region between the managed-block markers is rewritten.
  • .lex/ai-assets.json records what was generated — it lists only the files LEX AI may delete, which is what makes deselecting a tool remove exactly its own assets and nothing of yours.
  • A managed .gitignore block covers the project-scoped MCP configs — they hold GITHUB_TOKEN and REMOTE_MCP_API_KEY, and the forward workflow stages and pushes everything. An ignore rule cannot untrack an existing file, so setup also reports which of those files are already committed and tells you to git rm --cached them and rotate anything exposed.

Step 2 — Open the control surface

lex ai-dashboard

The dashboard runs locally on 127.0.0.1 and holds four panels in one form: Workflow Mode, Agentic Coding Environments, Authentication Tokens, and System Information. See AI dashboard for what each one does.

What to confirm before you start

  1. Active project — check the project root shown in System Information is the one you mean. If it is wrong, run from the right folder or pass -p.
  2. Credentials — the GitHub token, needed by the modes that deliver to GitHub, plus the remote MCP URL and access key.
  3. Registration — confirm the tool you actually work in shows as registered, and that no user-scope config is listed as overriding the project one.
  4. Active mode — pick the mode that matches your intent, then let the IDE restart the server on that tool surface.

Step 3 — Start a fresh assistant request

After any mode change, begin a new assistant request so it picks up the current tools and instructions. Describe the outcome you want in plain language; the mode's first-action rules and prompts take it from there.

Keeping the on-disk assets honest

lex ai-verify makes the generated files match what the installed packages ship: it restores anything missing or edited and prunes assets left over from a previous mode, which would otherwise leave the assistant looking at a mixed tool surface. It also runs automatically before every tool call. lex ai-update upgrades the package, then re-applies the migrations and re-materialises the payload.

Mode is authoritative, not the env var

LEX_MCP_MODE is a passive mirror of the running mode. The server rewrites it to match reality on every start, so hand-editing it does nothing. The mode actually used is resolved in this order: a --mode argument on the command line, then the one-shot override file the dashboard writes, then a --mode argument found in a nearby mcp.json, and otherwise forward. Change mode through the dashboard or a switch tool.

See Overview and Choose the right path next.

Was this helpful?

Your feedback shapes what we write next.