Installation and MCP Registration

August 27, 2026 ยท View on GitHub

Code2Skill separates installation into three independent layers:

  1. Install the Agent Skills so an agent can discover and understand the workflow.
  2. Install the generated package's runtime dependencies.
  3. Register and connect the MCP server in the Consumer Host.

There is no universal command that performs all three steps across every agent and host. Code2Skill uses existing standards and each host's registration interface instead of introducing a proprietary one-click installation protocol.

Install Code2Skill

The repository contains three independently installable Skills:

npx skills add leechen298/Code2Skill \
  --skill code2skill-generate code2skill-review-flow code2skill-review-source \
  --agent "$AGENT_ID" \
  --global \
  --yes

For $AGENT_ID, use an agent identifier supported by the skills CLI, such as codex, claude-code, kimi-code-cli, cursor, or openclaw. Omit --global for project-level installation. For local development, replace the repository address with ..

List, update, and remove the Skills:

npx skills list --global --agent "$AGENT_ID"
npx skills update --global --yes
npx skills remove --global --agent "$AGENT_ID" \
  code2skill-generate code2skill-review-flow code2skill-review-source

Code2Skill uses the standard skills CLI; it does not provide a custom installer.

Migrate from the Previous Generation Skill Name

The primary generation Skill was renamed from code2skill to code2skill-generate. A normal update cannot be expected to remove the old entry automatically. Install the new name, confirm that the agent can discover it, and then remove the old name.

npx skills list --global --agent "$AGENT_ID"
npx skills remove --global --agent "$AGENT_ID" code2skill

The repository does not keep both generation Skills at the same time, which prevents duplicate discovery or incorrect routing between code2skill and code2skill-generate.

Install Generated Skills

A generated package contains one or more business Skills:

npx skills add ./generated/code2skill/<feature-id> \
  --skill '*' \
  --agent "$AGENT_ID" \
  --global \
  --yes

This step installs only the Skill knowledge and guidance files. It does not install Node dependencies, start MCP, inject authentication, or validate the live business system.

For Skills that only provide reading, analysis, or guidance, installation is sufficient. For generated results that need to call business interfaces, the target agent or host must also support MCP clients and complete the dependency installation and MCP registration steps below.

Install MCP Dependencies

Install the locked dependencies inside the generated package:

cd /absolute/path/to/generated/code2skill/<feature-id>
npm ci

Use npm install when no package-lock.json is present. Installing dependencies does not mean that MCP has been registered or connected.

Generic MCP Registration Model

According to the MCP transport specification, the standard transports include:

  • stdio: The Consumer Host starts a local child process. This is suitable for the local Node MCP server generated by Code2Skill by default.
  • Streamable HTTP: The host connects to an already deployed remote MCP endpoint.

The portable information for registering a local stdio server is its launch description, not a configuration-file format specific to one host:

{
  "command": "node",
  "args": [
    "/absolute/path/to/generated/code2skill/<feature-id>/mcp-tool/index.mjs"
  ],
  "cwd": "/absolute/path/to/generated/code2skill/<feature-id>",
  "env": {
    "<SOURCE_PROVEN_VARIABLE>": "<provided-by-deployment>"
  }
}

The Consumer Host maps command, args, cwd, and env to its own MCP registration mechanism. Some hosts use a JSON container named mcpServers; others provide a CLI or graphical interface. mcpServers is a host configuration convention, not part of the MCP protocol itself.

Absolute paths prevent entry-point resolution failures caused by desktop hosts or different working directories. The MCP server writes only protocol messages to stdout and sends ordinary logs to stderr.

If the generated package is deployed separately as a remote service, provide its Streamable HTTP endpoint URL to the Consumer Host and configure authentication through a secure credential mechanism supported by that host. Remote registration has no JSON file format shared by every host. Code2Skill does not deploy remote gateways or write authentication values into Skills, source code, or example configurations.

Codex Registration Examples

The current Codex CLI can register a local stdio server directly:

codex mcp add <feature-id> -- \
  node /absolute/path/to/generated/code2skill/<feature-id>/mcp-tool/index.mjs
codex mcp list --json

Non-sensitive configuration may be passed with --env KEY=VALUE when supported by the CLI. Secrets, cookies, and session values should be provided through the actual host's secure environment or credential mechanism so they do not appear in the repository or shell history.

For an already deployed remote server, use:

codex mcp add <feature-id> \
  --url https://mcp.example.invalid/mcp \
  --bearer-token-env-var <TOKEN_ENV_VAR>

This command receives the name of the environment variable that holds the token, not the token value itself.

Other hosts use the same runtime-neutral launch parameters in the generated package's MCP-SETUP.md. Code2Skill does not need to generate a different business implementation for every platform.

Connectivity and Status

After registration, complete at least these checks:

  1. MCP initialize succeeds.
  2. tools/list returns the expected tools.
  3. A representative tools/call succeeds under dry-run or mock conditions.
  4. Live interfaces are called only with explicit user authorization; write capabilities must never be executed automatically as probes.

The following states cannot be inferred from one another:

  • Skill installed: The agent can discover SKILL.md.
  • Dependencies installed: The generated package's runtime dependencies are present.
  • MCP registered: The host has saved the launch parameters or remote URL.
  • MCP connected: initialize and tools/list have succeeded.
  • Offline behavior verified: Local mock or dry-run tests have passed.
  • Live business behavior verified: Authorized calls in a live environment have passed.
  • Deployed: A separate deployment action has been completed.

The generated package's own MCP-SETUP.md should list the exact entry point, dependencies, environment variables, and authentication boundaries. It must not claim that one state automatically proves a later state.