On this page
Integrate
Connect VS Code / Copilot.
Connect LeanCTX to VS Code and GitHub Copilot, verify a real context call and understand what the integration covers.
Install where the host runs
Follow the installation guide for Windows, macOS or Linux. The runtime must be available in the environment that executes your AI tool. A Windows installation and one inside WSL are separate setups.
Confirm the binary before changing host configuration:
lean-ctx --version
lean-ctx status
Register the integration
lean-ctx init --agent vscode
This configures VS Code’s MCP entry, hooks and rules. To choose among all detected tools interactively, run lean-ctx setup instead. Shell hooks and login services differ by platform; native Windows does not acquire Unix shell hooks.
Restart VS Code and inspect the available MCP tools in your Copilot agent session. Tool availability depends on the host mode and its MCP support; ordinary editor actions are outside that coverage.
Verify the actual path
Ask the host to locate a file in your project and read its signatures with ctx_read. Inspect the tool invocation, selected path and returned representation.
Then request the relevant implementation with an explicit line range or a fresh full read. A successful response demonstrates that particular call path; it does not mean every future operation uses LeanCTX.
Keep exact file contents for edits. A signatures view explains an interface and can omit the implementation that must be changed.
Diagnose a missing connection
lean-ctx doctor
Check the setup report, host restart, executable location and project scope. An already-running desktop process may not inherit a changed terminal environment. For WSL, check both where the host runs and where LeanCTX was installed.
Use the troubleshooting guide before manually replacing configuration. Preserve unrelated host settings.
Remove the integration
Remove the lean-ctx server entry from VS Code’s MCP settings and restart VS Code. That disconnects the editor; it is different from uninstalling the binary or deleting retained project knowledge. To remove LeanCTX from every host and the shell, run:
lean-ctx uninstall
Sources & versions
- 01-setup-and-onboarding.mddocs/reference/01-setup-and-onboarding.mdReviewed checkout
- wrap_cmd.rsrust/src/cli/wrap_cmd.rsReviewed checkout
- mode.rsrust/src/tools/ctx_read/mode.rsReviewed checkout
- Core checkout
0ce2207ee4- Reviewed runtime
- 3.10.2
- SDK release
- 1.1.0
Separate baselines for source, CLI/configuration and SDK contracts. Review does not certify every platform or integration.
Versions & compatibility