Skip to content

AgentTarget Installation and Integration

JanYork edited this page Aug 14, 2026 · 2 revisions

AgentTarget installation and integration

Language: English · 简体中文

MCP standardizes runtime communication, but it does not standardize where each Agent stores MCP configuration, Skills, Hooks, Instructions, or permissions. LWC therefore uses one AgentTarget interface with a handwritten adapter for every supported host.

All registered targets are strong adapters: LWC implements every stable official file-based surface available for that host and scope. “Strong” does not mean inventing a private format when the host declares a surface unsupported, UI-managed, or preview-only.

Supported targets

LWC registers 12 targets:

claude             Claude Code
cursor             Cursor
codex              Codex
opencode           OpenCode
hermes             Hermes Agent
gemini             Gemini CLI
antigravity        Antigravity
kiro               Kiro
copilot-vscode     VS Code with GitHub Copilot Chat
copilot-cli        GitHub Copilot CLI
copilot-jetbrains  JetBrains IDEs with GitHub Copilot
pi                 Pi Agent

Capability matrix

Each cell shows global / local behavior.

Target MCP Skill Instructions Lifecycle Hook Permissions
Claude Code installed / installed installed / installed installed / installed installed / installed installed / installed
Cursor installed / installed installed / installed user_managed / installed installed / installed not_applicable / not_applicable
Codex installed / installed installed / installed installed / installed installed / installed not_applicable / not_applicable
OpenCode installed / installed installed / installed installed / installed installed / installed not_applicable / not_applicable
Hermes Agent installed / unsupported installed / unsupported installed / installed installed / unsupported not_applicable / not_applicable
Gemini CLI installed / installed installed / installed installed / installed installed / installed not_applicable / not_applicable
Antigravity installed / installed installed / installed installed / installed installed / installed not_applicable / not_applicable
Kiro installed / installed installed / installed installed / installed configured_preview / configured_preview user_managed / user_managed
Copilot VS Code installed / installed installed / installed user_managed / installed unsupported / configured_preview user_managed / user_managed
Copilot CLI installed / installed installed / installed installed / installed installed / installed user_managed / user_managed
Copilot JetBrains installed / user_managed configured_preview / configured_preview user_managed / configured_preview unsupported / unsupported user_managed / user_managed
Pi Agent extension_bridge / extension_bridge installed / installed installed / installed installed / installed not_applicable / not_applicable

configured_preview means LWC writes the host's documented preview surface and reports that lifecycle explicitly. user_managed means no stable official file allows safe automated installation. unsupported means the host does not provide that capability in the selected scope.

Pi has no built-in MCP configuration, so its official extension bridge exposes LWC integration without pretending that a native MCP file exists.

Interactive installation

lwc agent install

The installer:

  1. detects installed Agents;
  2. preselects the detected targets;
  3. lets the user edit the target list;
  4. asks for global or local location;
  5. verifies that a compatible global lwc is on PATH;
  6. installs each target through its official adapter;
  7. records an ownership receipt for refresh and uninstall.

Global installs configure a user-level Agent. Local installs write only the current project surfaces supported by that host.

Non-interactive installation

--yes means “use detected targets and defaults,” not “install every target”:

lwc agent install --yes

It selects detected Agents and defaults to global location. For an explicit set:

lwc agent install \
  --target codex,claude,pi \
  --location global \
  --yes

Use --target all only when all 12 integrations are genuinely required. Installing unused targets adds config surface without benefit.

Print configuration without writing

lwc agent install --print-config codex --location global

--print-config renders the selected target's MCP, Hook, Skill, and Instruction guidance to standard output without writing files. Use it for review, managed environments, or hosts whose UI owns part of the configuration.

Installed surfaces

Depending on the adapter, installation may write:

  • one lwc MCP entry running lwc serve --mcp;
  • the complete using-lwc Skill bundle;
  • one marker-bounded guidance block in the official instruction file;
  • native lifecycle Hook configuration;
  • an official plugin or extension bridge for OpenCode, Antigravity, or Pi;
  • Claude Code MCP permissions where its official permission model supports them.

The installer also migrates LWC-owned legacy standalone CodeGraph entries. CodeGraph remains available through lwc_explore and is not left as a duplicate MCP server.

Status model

lwc agent status --target auto --location global

Status reports target detection separately from integration state. Common values include:

  • installed: receipt version and all tracked post-install hashes match;
  • modified: a tracked file changed after installation;
  • not_installed: no current LWC receipt exists;
  • unsupported: the target or location has no official integration scope.

It also reports MCP, Skills, Instructions, Hook, permissions, configured paths, and whether the host was detected or already configured.

Do not treat modified as permission to overwrite user changes. Inspect the target paths before refresh when drift may be intentional.

Idempotent refresh

lwc agent refresh --target codex,claude,pi --location global

Refresh re-runs the same adapter, replaces owned Skill files and marker blocks, and de-duplicates owned MCP and Hook entries. A no-drift refresh is byte-idempotent.

Claude's prompt-Hook choice is preserved from the installation receipt. Refresh never silently changes an earlier --no-prompt-hook decision.

Precise uninstall

lwc agent uninstall \
  --target codex,claude,pi \
  --location global \
  --yes

Receipts store original content, modes, post-install hashes, owned MCP metadata, and created directories. Uninstall removes or restores only files and fragments still matching LWC-owned state. Foreign entries and later user edits are preserved.

Shared files used by several target receipts are restored only when ownership permits it. Directories are removed only when empty.

No maintainer-local dependencies

Agent integration requires:

  • a compatible global lwc command on PATH;
  • the Agent's official user or project directories;
  • no exported LWC_PROJECT_ROOT for normal current-directory use;
  • no LWC=/private/path/to/lwc alias;
  • no AMC installation;
  • no files copied from a maintainer's HOME.

An explicit LWC_PROJECT_ROOT remains available only when intentionally operating on a different authorized project root.

First-use readiness

Installation does not enable project graphs. At the next supported boundary, the Hook reports readiness. If a substantive task needs missing graph capabilities, the Agent asks once using the portable four-choice text flow and initializes only the approved capability.

The document graph Work and CodeGraph project index are accepted independently. Agent integration success must never hide a graph initialization failure, and graph readiness must never be mistaken for successful Agent configuration.

Completion evidence

An AgentTarget installation is complete when:

  • the intended targets and global/local location are explicit;
  • status reports adaptation=strong and accurate per-surface modes;
  • the MCP entry is named lwc, with no duplicate CodeGraph server;
  • the Skill, Instructions, and Hook load through the host's official mechanism;
  • repeated refresh is byte-idempotent when no user drift exists;
  • uninstall restores the pre-install state without deleting foreign content;
  • no maintainer-local path or private tool is required.

LWC Wiki

English · 简体中文


Start here · 开始使用

Core capabilities · 核心能力

Practical guides · 实战指南

Capability configuration · 能力配置

Technical design · 技术设计

Operations · 运行与维护

Reference · 参考资料

Contributing · 参与贡献


Repository · Releases

Clone this wiki locally