Agent Skillszerx-lab/zap › agent-add-mcp

agent-add-mcp

GitHub

指导用户将 MCP 服务器配置添加到 Warp 编辑器中。涵盖确定作用域、获取连接详情、检查或创建配置文件以及编写标准或 URL 传输的配置 JSON,确保兼容现有结构并保留已有条目。

resources/bundled/skills/add-mcp-server/SKILL.md zerx-lab/zap

Trigger Scenarios

用户需要为 Warp 添加 MCP 服务器 用户询问如何配置 .mcp.json

Install

npx skills add zerx-lab/zap --skill agent-add-mcp -g -y
More Options

Non-standard path

npx skills add https://github.com/zerx-lab/zap/tree/main/resources/bundled/skills/add-mcp-server -g -y

Use without installing

npx skills use zerx-lab/zap@agent-add-mcp

指定 Agent (Claude Code)

npx skills add zerx-lab/zap --skill agent-add-mcp -a claude-code -g -y

安装 repo 全部 skill

npx skills add zerx-lab/zap --all -g -y

预览 repo 内 skill

npx skills add zerx-lab/zap --list

SKILL.md

Frontmatter
{
    "name": "agent-add-mcp",
    "description": "Use this skill when helping users add MCP servers to their Warp configuration."
}

Adding MCP Servers to Warp

Warp supports MCP servers via native config files. Follow these steps when helping a user add an MCP server.

Step 1: Determine Scope

If the user hasn't specified, ask whether they want to configure the server globally (for all projects) or project-scoped (for a specific repository only).

Config file paths:

  • Global (user-scoped): ~/.warp/.mcp.json
  • Project-scoped: {repo_root}/.warp/.mcp.json

Step 2: Gather Server Details

If the user hasn't provided the server's connection details, use WebSearch to find the correct configuration for the named server.

If it's unclear whether the server should be run as a local CLI process (stdio transport) or connected to via URL (HTTP/SSE streaming transport), ask the user which they prefer.

Step 3: Check and Prepare the Config File

Check whether the target config file exists.

  • If it does not exist, create it with mkdir -p for the directory and initialize it with an empty mcpServers wrapper key:

    {
      "mcpServers": {}
    }
    
  • If it exists, read it to determine which top-level wrapper key is already in use. Recognized wrapper keys (in order of preference):

    • mcpServers (preferred)
    • mcp_servers
    • servers
    • mcp.servers (nested under a mcp key)
    • Flat map (each top-level key is a server name)

    Preserve the existing wrapper key when writing. If the existing key is unrecognized or incompatible, switch to mcpServers.

    Never remove existing server entries — only add or update the new server.

Step 4: Write the Server Configuration

Command-based server (stdio transport)

{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "@scope/package-name"],
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

By default, Warp spawns stdio servers from the directory the config was discovered in:

  • Project-scoped configs ({repo_root}/.warp/.mcp.json) run from the repo root.
  • Global configs (~/.warp/.mcp.json, ~/.claude.json, etc.) run from the home directory.

If the server's command or args are relative paths (e.g. ./tooling/mcp/server.js) or the server expects a specific cwd, set working_directory to override the default:

{
  "mcpServers": {
    "server-name": {
      "command": "node",
      "args": ["./tooling/mcp/server.js"],
      "working_directory": "/absolute/path/to/repo"
    }
  }
}

URL-based server (HTTP/SSE streaming transport)

{
  "mcpServers": {
    "server-name": {
      "url": "https://example.com/mcp",
      "env": {
        "API_KEY": "${API_KEY}"
      }
    }
  }
}

For environment variables containing secrets, use ${VAR_NAME} syntax — Warp will substitute the value from the user's environment at runtime.

Notes

  • Warp auto-detects changes to .mcp.json files on save — no restart required.
  • Configured servers appear in Warp's Settings under MCP, labeled "Detected from Warp".
  • Global config applies across all sessions; project config only applies when working inside that repository.

Version History

  • 5d87445 Current 2026-07-24 17:36

Same Skill Collection

.agents/skills/add-feature-flag/SKILL.md
.agents/skills/add-telemetry/SKILL.md
.agents/skills/dedupe-issue-local/SKILL.md
.agents/skills/diagnose-ci-failures/SKILL.md
.agents/skills/fix-errors/SKILL.md
.agents/skills/implement-specs/SKILL.md
.agents/skills/promote-feature/SKILL.md
.agents/skills/remove-feature-flag/SKILL.md
.agents/skills/resolve-merge-conflicts/SKILL.md
.agents/skills/review-pr-local/SKILL.md
.agents/skills/review-pr/SKILL.md
.agents/skills/rust-unit-tests/SKILL.md
.agents/skills/spec-driven-implementation/SKILL.md
.agents/skills/triage-issue-local/SKILL.md
.agents/skills/update-skill/SKILL.md
.agents/skills/warp-integration-test/SKILL.md
.agents/skills/warp-ui-guidelines/SKILL.md
.agents/skills/write-product-spec/SKILL.md
.agents/skills/write-tech-spec/SKILL.md
resources/bundled/mcp_skills/figma/figma-code-connect-components/SKILL.md
resources/bundled/mcp_skills/figma/figma-create-design-system-rules/SKILL.md
resources/bundled/mcp_skills/figma/figma-create-new-file/SKILL.md
resources/bundled/mcp_skills/figma/figma-generate-library/SKILL.md
resources/bundled/mcp_skills/figma/figma-implement-design/SKILL.md
resources/bundled/skills/create-skill/SKILL.md
resources/bundled/skills/create-tab-config/SKILL.md
resources/bundled/skills/feedback/SKILL.md
resources/bundled/skills/modify-settings/SKILL.md
resources/bundled/skills/pr-comments/SKILL.md
resources/bundled/skills/tab-configs/SKILL.md
resources/bundled/skills/update-tab-config/SKILL.md
resources/channel-gated-skills/dogfood/triage-vulnerabilities/SKILL.md
resources/bundled/mcp_skills/figma/edit-figma-design/SKILL.md
resources/bundled/mcp_skills/figma/figma-generate-design/SKILL.md
resources/bundled/mcp_skills/figma/figma-use/SKILL.md
resources/bundled/skills/claude-api/SKILL.md

Metadata

Files
0
Version
5d87445
Hash
6f450e66
Indexed
2026-07-24 17:36

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-16 23:43
浙ICP备14020137号-1 $mapa de visitantes$