Agent skill

Diagnosing MCP

by zai-org in zai-org/ZCode

A skill your agent uses to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client.

Apache-2.0Auto-check passedAgent Workflows

Install Diagnosing MCP

skills CLI
$ npx skills add zai-org/ZCode --skill diagnosing-mcp -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install zai-org/ZCode diagnosing-mcp --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/zai-org/ZCode.git skills-src && mkdir -p .claude/skills && cp -r skills-src/apps/zcode-cli/packages/zcode-guide-plugin/skills/diagnosing-mcp .claude/skills/diagnosing-mcp && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
diagnosing-mcp
GitHub stars
7.7k
Token cost
~2.8k tokens
SKILL.md length
1,412 words
Files
1
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

A skill your agent uses to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client.

  • Works in 5 steps: Configuration locations and precedence → Configuration schema → How to inspect status → …
  • Diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client
  • SKILL.md covers 1. Configuration locations and…, 2. Configuration schema, 3. How to inspect status and 4. Common pitfalls (symptom →…, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Diagnosing MCP is an agent skill from zai-org/ZCode. Use to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client. Applies when an MCP server will not connect, its tools (mcpservertool) do not appear, it shows as disabled or failed, connections time out, a command cannot be found, template variables are not expanded, or a server defined in a configuration file has no effect. Provides configuration locations, how to inspect status in Settings, common pitfalls, and a step-by-step localization and repair workflow.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Agent Workflows, covering MCP servers and Internationalization. It works with Model Context Protocol. The repository describes itself as: Z.ai's coding agent harness. Powerful, intelligent, extensible. The licence is Apache-2.0.

When your agent uses it

  • Diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client
  • Tasks that involve MCP servers
  • Tasks that involve Internationalization

Example prompts

  • “/diagnosing-mcp”

Requirements

  • Node.js

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Configuration locations and precedence
  2. Configuration schema
  3. How to inspect status
  4. Common pitfalls (symptom → cause → fix)
  5. Localization workflow (in order; stop when the cause is found)

What it can do on your machine

Read from SKILL.md and the folder at commit aac4755. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Diagnosing MCP loads about 2.8k tokens when it runs. Until then it costs about 133 tokens; SKILL.md has 1,412 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~133
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from zai-org/ZCode at commit aac4755, republished under its Apache-2.0 licence (© zai-org). 1,412 words, ~2,803 tokens.

Download SKILL.mdSave it as .claude/skills/diagnosing-mcp/SKILL.md (or your agent's skills folder).
name
diagnosing-mcp
description
Use to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client. Applies when an MCP server will not connect, its tools (mcp__server__tool) do not appear, it shows as disabled or failed, connections time out, a command cannot be found, template variables are not expanded, or a server defined in a configuration file has no effect. Provides configuration locations, how to inspect status in Settings, common pitfalls, and a step-by-step localization and repair workflow.

Diagnosing MCP Configuration

Goal: reduce any MCP problem to a single concrete file-field edit. A person inspects status from the client; an agent reads and edits the configuration files directly.

Key points that are often misunderstood: the user configuration file is ~/.zcode/cli/config.json; .agents/mcp.json is a compatibility fallback (read only when the same scope's .zcode has no MCP servers); and in the desktop client, MCP status and repair live under Settings → MCP.

1. Configuration locations and precedence

ScopeFileField
User~/.zcode/cli/config.jsonmcp.servers
User (fallback)~/.agents/mcp.jsonmcpServers (used only if ~/.zcode/cli/config.json has no MCP servers)
Workspace<repo>/.zcode/config.json or <repo>/zcode.json (every directory from the repository root down to the working directory is read)mcp.servers
Workspace (fallback)<repo>/.agents/mcp.jsonmcpServers (used only if the workspace .zcode has no MCP servers)
Plugin<pluginRoot>/.mcp.json or the manifest's mcpServers fieldKeys are namespaced as plugin:<plugin>:<server>

Within each scope, .zcode takes priority and .agents/mcp.json is a same-scope fallback: if that scope's .zcode defines any MCP server, its .agents/mcp.json is ignored entirely. Note the different key shape — .zcode uses nested mcp.servers, while .agents/mcp.json uses a top-level mcpServers.

Override order across scopes for a same-named server: CLI → environment → user → workspace → system. In short, user overrides workspace. Plugin-provided servers form the base layer and are overridden by explicit configuration.

Auto-connect: MCP servers from every scope — user, workspace, plugin, environment, and CLI — are trusted and connected automatically at session start. Workspace-scoped servers were previously untrusted (reported Project MCP server requires explicit connection before use.); they now connect by default like any other scope. Use Settings → MCP as the supported client surface for inspecting status and repairing configuration.

2. Configuration schema

  • stdio: requires command; optional args[], cwd, env, enabled, timeoutMs.
  • http / sse: requires url; optional headers, enabled, timeoutMs.
  • Standard field names are env for stdio environment variables and headers for HTTP/SSE request headers. command is a string and args is an array of strings; do not paste OpenCode-style command: ["npx", "-y", "..."] into ZCode's JSON editor.
  • When type is omitted it is inferred: a command implies stdio, a url implies http. Legacy forms are migrated automatically when the CLI reads config directly (type: "remote" → http, environment → env, enable → enabled, http_headers → headers). Desktop app-managed session creation may bypass part of that CLI file parser, so prefer canonical fields (env, headers, enabled, type: "http") in files that the desktop Settings → MCP page reads.
  • The configuration-file server schema is strict: an unknown key causes the server to be dropped.
  • Template variables ${...} are expanded only for plugin-provided MCP servers (for example ${CLAUDE_PLUGIN_ROOT} / ${ZCODE_PLUGIN_ROOT}, ${CLAUDE_PROJECT_DIR}, ${user_config.KEY}). Configuration-file MCP servers do not expand templates — use absolute paths there.
  • The default timeout is 30000 ms.

Canonical examples:

json
{
  "mcp": {
    "servers": {
      "mysql-local": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@benborla29/mcp-server-mysql"],
        "env": {
          "MYSQL_HOST": "127.0.0.1",
          "MYSQL_PORT": "3306"
        }
      },
      "remote-reader": {
        "type": "http",
        "url": "https://example.com/mcp",
        "headers": {
          "Authorization": "Bearer ..."
        }
      }
    }
  }
}

3. How to inspect status

  • List and status: open Settings → MCP in the client. Each entry shows whether the server is connected, disabled, disconnected, or failed, with any error inline. Plugin-provided servers are marked as built-in. (untrusted is a legacy status that no longer appears for normally configured servers now that every scope auto-connects.)
  • After edits: restart the affected session, or restart ZCode if the Settings page still shows stale data, then reopen Settings → MCP to confirm the server status.
  • Standard-I/O error output (the root cause of most failures): a stdio server's captured error stream is written to the ZCode log. To see the full output, run the server's command with its arguments directly in a terminal.

4. Common pitfalls (symptom → cause → fix)

  1. Workspace server does not connect — a server defined in <repo>/.zcode/config.json (or <repo>/.agents/mcp.json) is not connecting. Workspace servers now auto-connect like any other scope, so this is no longer a trust gate — the cause is a real config or startup problem. → Check its Settings → MCP status: failed → go to step 4; absent → the config was not loaded (pitfall 5/9) or it is in .agents/mcp.json but shadowed (pitfall 12).
  2. command not found — the server shows failed with an error such as spawn npx ENOENT. The command is not on PATH, or a relative path was not resolved. → Use an absolute path, add cwd when needed, and on Windows point at the .cmd/.exe.
  3. ${...} reaches the process literally — configuration-file MCP servers do not expand templates. → Use concrete absolute paths (templates are a plugin-only feature).
  4. Plugin is missing an environment value or secret — the plugin reports a missing variable. → Set the plugin's configuration value (Plugin Management → the plugin's advanced settings) or export the required environment variable; sensitive values may only be placed in env/headers, not in command/url.
  5. Wrong transport type or unknown key — the server is silently dropped. → Make type match the fields, remove any extra top-level keys (the schema is strict), and ensure exactly one of command (stdio) or url (http/sse) is present.
  6. Unexpected override — editing the workspace mcp.servers entry has no effect. A same-named server in the user configuration is shadowing it (user overrides workspace for MCP). → Edit the user entry, or rename one of the servers.
  7. Connection or tool-listing timeout — failed ... timed out after 30000ms. → Add "timeoutMs": 60000 to that server, and address the slow startup.
  8. Only Connection closed with no cause — the error stream was not surfaced in the status line. → Check the ZCode log for the captured error output, or run the command with its arguments in a terminal.
  9. JSON syntax error in the configuration file — MCP servers (and possibly the whole file) go missing. → Validate the JSON, then fix the syntax.
  10. Server shows as disabled — enabled: false (or legacy enable: false). → Set "enabled": true or remove the field.
  11. A desktop-managed server list overrides the file — edits to configuration files have no effect because the client is supplying the MCP list. → Manage MCP through Settings → MCP in that context.
  12. .agents/mcp.json edits have no effect, or use the wrong key — a server added to .agents/mcp.json never appears. Either the same scope's .zcode already defines MCP servers (so .agents/mcp.json is ignored entirely for that scope), or the servers were placed under mcp.servers instead of the top-level mcpServers that .agents/mcp.json expects. → Move the definition into the .zcode file for that scope, or ensure that scope's .zcode has no MCP servers and use the top-level mcpServers key in .agents/mcp.json.
  13. Server name appears in logs but no MCP tools appear in the model request — the desktop app read the server entry and passed its name to the runtime, but the server failed during startup, so toolCount and registeredToolCount are zero. A common cause is a legacy environment field in ~/.zcode/cli/config.json: CLI direct config parsing can migrate it, but the desktop app-managed path currently expects env when converting to protocol mcpServers. → Rename environment to env, keep the values unchanged, restart ZCode, and reopen Settings → MCP.
  14. Settings → MCP crashes after JSON editing with command.trim is not a function — the saved server has a non-string command, usually OpenCode-style command: ["npx", "-y", "server"]. → Edit ~/.zcode/cli/config.json manually: set "command": "npx" and move the rest into "args": ["-y", "server"], then restart the app.
Show full SKILL.md (267 more words)Show less

5. Localization workflow (in order; stop when the cause is found)

  1. Confirm MCP is enabled (it is by default).
  2. Open Settings → MCP and read the status: disabled → pitfall 10; failed (<error>) → read the inline error and go to step 4; not listed at all → step 3. (untrusted should no longer appear for a normally configured server.)
  3. Verify the configuration is loaded and valid: check the JSON validity of ~/.zcode/cli/config.json and <repo>/.zcode/config.json (and zcode.json) — pitfall 9. A server that is in the file but not listed failed schema validation (pitfall 5 — look for unknown keys, wrong type, or a missing command/url); a server defined only in .agents/mcp.json but not appearing points to the fallback shadowing or wrong-key issue (pitfall 12).
  4. Diagnose a failed server: ENOENT → pitfall 2; timed out → pitfall 7; Connection closed → pitfall 8; an http/sse network error → check proxy/CA, URL reachability, and headers.
  5. If Settings → MCP or service logs show mcpServerCount / server names but the model request has no mcp__... tools, check startup logs for mcp.startup.completed and mcp.tools.registered. If toolCount=0 with failed statuses, inspect the config field names first (env vs environment, string command vs array command) before treating it as a model-selection issue.
  6. If edits have no effect → pitfall 6 (user overrides workspace) or pitfall 11 (desktop-managed list).
  7. If a ${...} appears literally → pitfall 3 (configuration files do not expand templates) or pitfall 4 (an unset plugin variable).
  8. Apply the concrete fix — most commonly editing ~/.zcode/cli/config.json at mcp.servers.<name> (command / args / cwd / env / headers / timeoutMs / enabled) — then restart the session (every scope auto-connects) and reopen Settings → MCP to confirm.

© zai-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in apps/zcode-cli/packages/zcode-guide-plugin/skills/diagnosing-mcp of zai-org/ZCode.

Open the folder on GitHubat commit aac4755

Compare with similar skills

Diagnosing MCP next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Diagnosing MCP compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Diagnosing MCP this skillzai-org/ZCode7.7k—~2.8kAutomated safety check: PassApache-2.0
Tutti Agent Workspace Apptutti-os/tutti3.8k—~1.9kAutomated safety check: PassApache-2.0
Managing MCP IndexComfy-Org/workflow_templates1.3k—~1.9kAutomated safety check: NotesMIT
SlintMoosync/Moosync259—~2.4kAutomated safety check: PassGPL-3.0
Frontend Build Timing Auditopenops-cloud/openops1.1k—~2.3kAutomated safety check: PassCustom licence
MCP Server Builderanthropics/skills180k63 repos~2.3kAutomated safety check: PassApache-2.0

Similar skills

  • Build or evolve a complex agent-enabled Tutti workspace app repository.

    3.8k GitHub stars~1.9k tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Managing MCP Index

    Comfy-Org/workflow_templates

    Builds and maintains templates/index.mcp.json for Comfy Cloud MCP tools.

    1.3k GitHub stars~1.9k tokensUpdated today
    Frontend & DesignAuto-check: notes
  • Slint

    Moosync/Moosync

    Expert guidance for building, debugging, and working with Slint GUI applications.

    259 GitHub stars~2.4k tokensUpdated 9 days ago
    DevelopmentAuto-check passed
  • Frontend Build Timing Audit

    openops-cloud/openops

    Detects and diagnoses chunk-evaluation timing bugs in the Vite/rolldown production build of react-ui (works-in-dev / broken-in-build i18n regressions, missing UI labels, module-scope t()…

    1.1k GitHub stars~2.3k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • MCP Server Builder

    anthropics/skills

    Official

    Guides the design and implementation of Model Context Protocol servers in TypeScript or Python, from tool naming and error messages to evaluation.

    180k GitHub starsUsed in 63 repos~2.3k tokens
    Agent WorkflowsAuto-check passed
  • MCP Server Builder

    shareAI-lab/learn-claude-code

    Walks through building MCP servers in Python or TypeScript that expose tools, resources and prompts to Claude, with templates, registration and testing.

    78k GitHub starsUsed in 4 repos~1.2k tokens
    Agent WorkflowsAuto-check passed

More from zai-org/ZCode

All 25 skills in this repo
  • DOCX

    zai-org/ZCode

    Complete DOCX document creation, editing, and analysis capabilities with support for revisions, comments, formatting preservation, and text extraction.

    7.7k GitHub stars~4.9k tokensUpdated yesterday
    Auto-check: notes
  • Visualize

    zai-org/ZCode

    Create visualizations and interactive tools directly in conversation.

    7.7k GitHub stars~8.7k tokensUpdated yesterday
    Auto-check passed
  • PDF

    zai-org/ZCode

    Professional PDF toolkit covering four production workflows: reports, creative visuals, academic LaTeX, and existing PDF processing.

    7.7k GitHub stars~18k tokensUpdated yesterday
    Auto-check: notes
  • A skill your agent uses when ZCode needs to inspect, plan, or execute restoration of old ACP-era ZCode sessions from ~/.zcode/v2/sessions into the new ZCode task/session stores.

    7.7k GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Generate, verify, or remove large synthetic ZCode task fixtures in local ~/.zcode persistence for UI/session performance testing.

    7.7k GitHub stars~698 tokensUpdated yesterday
    Auto-check passed
  • Check ZCode module and layer boundaries for code changes. An agent skill from zai-org/ZCode.

    7.7k GitHub stars~1.3k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Diagnosing MCP

What does Diagnosing MCP do?

A skill your agent uses to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client. Diagnosing MCP is an agent skill from zai-org/ZCode. Use to diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client.

When should I use Diagnosing MCP?

Diagnosing MCP fits situations like: diagnose and fix ZCode MCP (Model Context Protocol) server configuration problems in the ZCode client; tasks that involve MCP servers; tasks that involve Internationalization.

How do I install Diagnosing MCP in Claude Code?

Run `npx skills add zai-org/ZCode --skill diagnosing-mcp -a claude-code`. Or copy the skill folder (apps/zcode-cli/packages/zcode-guide-plugin/skills/diagnosing-mcp in zai-org/ZCode) into .claude/skills/diagnosing-mcp in your project. Claude Code loads it when a task matches its description.

How do I install Diagnosing MCP in Codex?

Run `npx skills add zai-org/ZCode --skill diagnosing-mcp -a codex`. Or copy the skill folder (apps/zcode-cli/packages/zcode-guide-plugin/skills/diagnosing-mcp in zai-org/ZCode) into .agents/skills/diagnosing-mcp in your project. Codex loads it when a task matches its description.

Can I use Diagnosing MCP in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add zai-org/ZCode --skill diagnosing-mcp -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/diagnosing-mcp, .gemini/skills/diagnosing-mcp, .github/skills/diagnosing-mcp and .opencode/skills/diagnosing-mcp in your project.

What does Diagnosing MCP need to run?

SKILL.md names no scripts, command-line tools or credentials: Diagnosing MCP is instructions for the agent only. Our summary lists: Node.js.

Does Diagnosing MCP access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Diagnosing MCP safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Diagnosing MCP use?

Diagnosing MCP is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Diagnosing MCP use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Diagnosing MCP?

Skills that share tags, products or a category with Diagnosing MCP: Tutti Agent Workspace App (tutti-os/tutti, 3.8k stars), Managing MCP Index (Comfy-Org/workflow_templates, 1.3k stars), Slint (Moosync/Moosync, 259 stars) and Frontend Build Timing Audit (openops-cloud/openops, 1.1k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Diagnosing MCP?

zai-org (a GitHub organization) maintains it in zai-org/ZCode, which has 7,659 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on October 10, 2026.

Source: zai-org/ZCode on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.