Running the server
npx form needs no install and is the one to use with agents that are themselves npm-installed. iris-lsp --mcp suits editors that already bundle the Iris Code language-server binary, and needs no Node.js.
The agent and the server talk through standard output, so the server writes only its protocol messages there. Do not wrap it in a script that prints anything to standard output.
Which folder it analyses
The server works inside one project folder, called its root. Nothing outside the root is read, and nothing outside it is written. Iris Code chooses the root in this order:--root, if you pass it. Your own explicit choice, never overridden.- The workspace your editor reports. Clients that support MCP’s
rootscapability tell the server which project is open, so no flag is needed. Iris Code asks for this at startup. - The directory the client launched Iris Code in. The fallback when neither of the above applies.
iris-lsp --mcp.
If a client says it supports roots but does not finish starting up, Iris Code waits about three seconds for it and then uses step 3, so tool calls are answered rather than left waiting.
Most clients land on the right folder through step 2, which is why the commands above pass no flag. Leaving it off is the right default if you work in more than one project: register the server once, and each editor window uses the project it has open.
When to pass --root
Pass --root when you want the folder fixed regardless of what the client does, such as a scripted or shared setup where the launch directory is not dependable. Set it per project, though.
A --root registered once for every workspace points every workspace at that one folder. An agent working in project B is then answered about project A, and iris_fix_safe writes into A. Iris Code cannot detect this for you, because a fixed root is a legitimate instruction.
--root . does not fix the folder. It resolves to the directory the client launched the server in, which is what Iris Code would have used anyway, and passing it turns off step 2. Omit the flag instead.
Several folders open
Where several workspace roots are open, Iris Code analyses the first and names the others it is not analysing. It does not merge them: separate roots are usually separate projects with their own config and their own gate, so one blended score would describe neither.What the server tells you at startup
Iris Code writes a ready line to standard error as soon as it starts, followed by the folder it chose and where that choice came from, so your client’s log shows what it is actually looking at. Nothing but JSON-RPC, the message format MCP uses, goes to standard output. Started in a terminal rather than from a client, the server has nobody to talk to and waits. It says so, and prints the configuration to paste, rather than sitting there silently. Iris Code refuses to start if the folder turns out to be a whole filesystem, your home directory, or a directory containing home directories. A project setup never needs to give an agent read and write access across any of those, and the mistake would otherwise go unnoticed.Client setup
With the Iris Code extension installed, VS Code finds the server through its own MCP server picker. Choose Iris Code there; no JSON entry is needed, and VS Code supplies the workspace folder for each session. For every other client, register the command as an MCP server:iris-lsp --mcp when the binary is installed.
Naming no folder is what lets one registration cover every project you open. It works when your client either reports MCP roots or starts the server in the workspace. Verified on real clients:
After connecting, the startup line on standard error states the folder and where it came from, so you can confirm your client rather than assume.
from your editor, over MCP roots and from the working directory both resolve correctly when that directory is the project.
Keeping it up to date
The barenpx command fetches the current release each time it runs, so agents pick up fixes without anyone editing a configuration file. Write @latest if you would rather that were explicit:
dist/cli.js also works, but it never updates, so prefer the npx form outside development.
JetBrains IDEs
The Iris Code JetBrains plugin bundlesiris-lsp, so it can provide the same server without Node.js. With a project open, choose Tools | Iris Code | Set Up MCP Server. The action copies a complete stdio configuration with the bundled executable’s absolute path and --root set to the open project.
Paste it into the MCP settings for the AI assistant you use in that IDE. The plugin does not change an assistant’s configuration itself.
Here the fixed folder is required, not a precaution. JetBrains AI Assistant reports no MCP roots, starts servers from the IDE installation directory rather than the open project, and exposes no environment variable naming the project.
A bare command there resolves to the IDE’s own install folder, which is not your code. The plugin action fills in --root so you never type a path, but it is per project: paste it into that project’s settings rather than a global one, and generate it again for the next project.
Tools
An earned result is a saved scan result your account already has. Its
evidence_id lets a tool reopen it without scanning again or using another action.
iris_check, iris_fix_safe, iris_refactor_plan and iris_verify_refactor are Free on a single file. New project scans and multi-file plans use the applicable project allowance. When iris_check reports a file-size or complexity finding, it can also point the agent to the refactor workflow.
Every tool stays listed, so the agent can always see what exists. Whether the agent may use a tool, and on which files, is checked each time it runs, not when the list is shown. An earned result ID only reopens a saved result: it does not get around team membership or allow a fresh gate check.
Findings
iris_check returns every rule that fired, each tied to a line and carrying its severity (critical, high, medium or low) and a stable id.
This is a wider list than iris check --format github produces in CI. That command writes one error-level annotation per finding, and a CI step shows only about ten, so it includes error-severity findings only. An agent has neither limit and can act on the rest, so it receives them.
Large results are capped. When a scan exceeds the response limit, the lowest severities are dropped first, and the response reports totalFindingCount, returnedFindingCount, findingCountsBySeverity and droppedFindingCountsBySeverity.
A critical finding is never dropped to make room for a low one. The agent can see that something was left out, rather than presenting a partial answer as complete.
Explanations
iris_explain returns the findings plus background on each one, so an agent can fix the cause rather than react to the label.
For a rule with a numeric limit, it gives the measured value, the configured limit and how far over it the file is: a 302-line file against a 300-line limit reports actual: 302, limit: 300, overBy: 2.
The limit quoted is the one that actually applied to that file. A per-language languages block, or a nested .irisconfig.json in a monorepo package, is reflected rather than the workspace default.
Each explanation also includes the file’s imports and exports and the other findings in the same file, so a fix can account for what the file is for and what else is wrong with it.
Rules without a configured number, such as a hardcoded secret or a security smell, come with the finding’s own message and the same file background. Iris Code does not invent fix instructions for them.
Safe fixes
iris_fix_safe shows a preview first. The preview lists the exact changes it would make and returns a preview_token.
Writing the changes needs apply: true and that token. The token works once, expires after ten minutes, and covers exactly the changes the preview showed. So Iris Code only ever applies edits that have already been put in front of you. A simple “confirm” flag would not guarantee that, because the AI model sets the flag itself.
For unused JavaScript imports, removing the last imported name keeps the file loading the module, as import './a'. Whole TypeScript value imports are left for review because whether the module loads depends on compiler settings; import type can be removed. See fixes and suggestions.
Eligible fixes can span several lines: a debug statement on its own, an unused variable inside a function that is assigned a literal, a whole unused import or an unused name in an import, and two compatible imports merged into one. The iris fix reference lists the languages and refusals for each.
The same fixes are offered as a Quick Fix in VS Code and by iris fix --safe, all decided in one place, so they agree. console.error is never removed, because it reports real errors.
Iris Code declines anything it cannot prove safe. Each refusal applies to one finding and gives a reason; it does not block the other fixes.
- A hardcoded secret is never fixed automatically. Rotating a leaked credential and moving it to an environment variable is not a mechanical edit.
- A debug print sharing its line with real code is left alone, because deleting the line would take the code with it.
- Anything needing a name or a judgement, such as extracting a magic number or shortening a long function, stays the agent’s work.
Long scans
Code analysis runs in a separate process with a fifteen-minute limit, so a large workspace cannot freeze the server. Only one dependency scan runs per workspace at a time; a second request getsSCAN_IN_PROGRESS. If your client asks for progress updates, the server reports the current phase and package counts as it goes, and warns at two minutes. Cancelling returns the results collected so far, marked as partial, rather than discarding them.
What the server will not do
Analysis happens on your machine. Your code is not uploaded. There is no tool that runs shell commands, and no general “run any Iris Code command” tool, which would get around each tool’s own rules. Every requested path must be inside the root. This is checked after following symlinks, so a link pointing outside the workspace is refused rather than followed. Secret values are never returned, only the masked form every other Iris Code surface shows.iris_check_dependency and iris_check_package are the only tools that use the network, querying public package registries and OSV.dev, a public database of known vulnerabilities. Both:
- Need
allow_network: trueon each call, unless you have already allowed network lookups from the CLI. - Say what they are about to look up.
- Fall back to a local cache.
iris deps --revoke-network.
Licensing
The server reads your licence from the same credentials the CLI uses, so signing in once withiris auth login covers the CLI, your editor and MCP. The offline grace period applies here too.
A Free licence calling a Pro tool gets a clear refusal naming the feature and where to upgrade, which your agent can pass on to you. It never returns an empty result without saying why.
Organisation and repository restrictions
An organisation, a project, or a committed"agentHandoff": false setting can stop agents using Iris Code on a repository. When one does, the server refuses repository tools with HANDOFF_FORBIDDEN.
The tools stay listed, and the restriction is checked on every call. The refusal names the restriction and has no upgrade link, because upgrading does not lift it. iris_check_package keeps answering.
See Team governance for what these restrictions cover, how often they refresh, what happens when you are signed out, and their limits.
Refactor agent integration describes refactor plans, their saved starting points and the optional check when an agent finishes.
iris_schema
Before writing a query, migration or model change, the agent can calliris_schema to get the real table and column names instead of guessing. It reads the Schema graph from the server’s current project root and picks up file changes between calls.
Parameters include table, format and include_usage. Structure and usage for one focused table are Free. For usage across all tables, pass evidence_id from a saved workspace scan your account owns. Without one, the tool asks for that scan instead of quietly running it.
Repository restrictions are checked before access, even when a client cached the tool list earlier.
JSON output carries schemaVersion: 1. The result says when output was capped or a reference could not be resolved, rather than guessing. Schema information does not change scores or gates.
Checking verification integrity
iris_check accepts changed: true to compare your working files with your last commit, including deleted tests and weakened configuration. This is Free.
It returns findings in the integrity group and lists anything it could not read. It does not run a health score scan. Repository restrictions are checked first.