MCP Installer
This skill registers MCP servers into the current LibrAgent session or the user's Claude Desktop configuration. It covers both direct installation (from packages or URLs) and import/sync (from other AI editors).
🚀 Workflow
Step 0: Determine Input Path
| User intent | Path |
| --- | --- |
| "Import from Cursor", "sync my MCP servers", "what's installed elsewhere?" | Import → below |
| npm/PyPI package, MCP server GitHub repo, server URL, or pasted JSON config | Direct install → below |
| GitHub URL whose repo or subpath contains SKILL.md | Not an MCP server → use skill-deployer |
| GitHub URL and you cannot tell | Inspect it first (README, package.json/pyproject.toml, SKILL.md), then pick the path. Ask the user only if it is still unclear. |
| A capability with no package, URL, or config ("I want stock data", "connect Slack") | Catalog → below |
| "Install it" with no package, URL, config, or capability | Ask what to install. Do not guess a package. |
Catalog Workflow
- Search the curated catalog — Call
tool__listServers({"scope":"catalog","query":"<keyword>"})with a short keyword from the request (e.g.stock,slack,search). Omitqueryto see every preset. - Pick a preset — If one matches, use it as is: it comes from LibrAgent's official list. If it is marked
registered, it is already installed; do not register it again (usetool__updateServerto change it). - Collect required inputs — For each entry in
requiredVariables, replace the matching placeholder (e.g.YOUR_GITHUB_PAT) in the preset'stransport. For a secret (API key, token, password), write{{secret:NAME}}(NAME inUPPER_SNAKE_CASE, e.g.Bearer {{secret:GITHUB_PAT}}or?exaApiKey={{secret:EXA_API_KEY}}); LibrAgent asks the user for the value in a secure prompt when you register. Never ask for a secret in chat. Ask in chat only for non-secret values. - Register and verify — Call
tool__registerServerwith the presetname,description,transport(andauthenticationwhen present), then run Step 3 of the direct install workflow. If each secret input is a{{secret:NAME}}template and every other value stays as the preset gives it, the install needs no user approval. Changing a non-secret value (for example a server URL), the command, args, or URL, adding env/header keys, or passingauthenticationmakes it a normal approval-gated install. Presets that track@latestrun new upstream releases without asking again. - No match — Only then search the web or npm for a package. Tell the user the source is not curated by LibrAgent before you register it.
Import Workflow
- Identify sources — Consult app_paths.md for config locations.
- Scan — Read detected config files. Resolve environment variables (
%APPDATA%,%USERPROFILE%,~) before reading. If a project-level config (e.g.,.cursor/mcp.json) exists in the current workspace, prioritize it. - Compare — List all found MCP servers. Use
tool__listServersto compare with LibrAgent's current registrations. Mark servers as new or already registered. - Select — Present the list to the user. Ask which servers to import (all or specific ones).
- Register — Use
tool__registerServerfor each selected server. Skip duplicates (same name and command). Each call asks the user for approval (see Step 2 below). - Verify — Run Step 3 below for each registered server.
- (Optional) — Offer to update
claude_desktop_config.jsonas well.
Schema notes: VS Code Copilot uses servers as the root key; Zed uses context_servers. Normalize entries before registration.
Direct Install Workflow
1. Analyze Information
Identify the source and transport details.
- npx/npm: Use
npx -y <package>for registration. - GitHub: Determine if it's TypeScript (needs build) or Python (can use
uvx). - Claude Config: Extract command, args, and env variables.
2. Register in LibrAgent
Use the tool__registerServer tool to add the MCP server. Never hand-edit LibrAgent config files or the database.
tool__registerServer (except an unchanged catalog preset) and tool__updateServer always pause for the user's approval, even in YOLO mode, because a stdio server runs an arbitrary command. The saved server records its source (catalog preset or external); the success message shows it. Before you call it, tell the user in one line what will run (command and args, or URL) and which env variables it needs. If the user rejects it, stop and ask what to change; do not retry the same call.
Example Task:
"Register the 'everything' MCP server using npx."
Execution:
{
"name": "everything",
"description": "MCP server with all capabilities",
"transport": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-everything"]
}
}
3. Verify (required)
Installation is not done until the server is verified.
- Call
tool__verifyServerwith the server name. - On success, report the tools it exposes, then go to Step 3a. Saving a server does not make it callable in any session yet.
- On failure, report the real error and the next step:
command not found/ missingnode,npx,uv,python→ run setup-wizard or install the runtime, then calltool__updateServerfor the saved server, and then verify.- Missing or wrong API key / env variable → call
tool__updateServerwith the secret as{{secret:NAME}}andreenterSecrets: ["NAME"], so the user enters it again in the secure prompt. Do not ask for it in chat. - Package not found or crashes on start → show the error output; do not report success.
3a. Offer to attach (required after a successful verify)
- Ask: "Attach
<server>to this assistant so it can use these tools?" Use the agent id from## Agent Runtime Identity. - Yes → read the assistant's current
externalMcpServerswithagent__listAgents({ type: "configs", query: "<agent id>", verbose: true }), then callagent__updateAgent(id: "<agent id>", externalMcpServers: [...current ids, "<server id>"]). The list is replaced, not merged, so always include the existing ids. Then tell the user: "Start a new session to use the<server>tools. The current session cannot load them." - No → tell the user the server is saved but not attached, and that they can attach it later to any assistant (by name) in Settings or by asking you.
4. Claude Desktop (Optional)
If the user specifically asks to install it in Claude Desktop:
- Locate
claude_desktop_config.json(see app_paths.md). - Read the current configuration.
- Append the new server entry.
- Save the file and notify the user to restart Claude Desktop.
🛠Guidelines
- Duplicate Prevention: Do not register servers that already exist in LibrAgent with the same name and command.
- Naming: Use lowercase slugs (e.g.,
github,brave-search). - Safety: Verify the source before execution.
- Secrets: Write every secret env value, header value, or URL query value as
{{secret:NAME}}; the user enters it in a secure prompt and it is stored outside the config. Never ask for a secret in chat. If the user sends a secret in chat anyway, do not repeat it in your reply or in any tool call; use a{{secret:NAME}}template and let the prompt collect it. - Dependencies: Use setup-wizard if
node,npm, oruvare missing. - Path Resolution: Resolve environment variables before reading config files on any platform.
Reference
- installation.md: npm, GitHub, and Python install patterns
- app_paths.md: Config paths for Cursor, VS Code, Windsurf, and other editors