knowledge-extension-ecosystem-mcp-protocol-runtime

knowledge-extension-ecosystem-mcp-protocol-runtime is a skill for Claude Code, Codex from echoVic/blade-code. It costs 148 tokens per session (3,033 once invoked), scanned A, original, MIT.

A codebase guide to MCP, a standard way for an agent to connect to external tools and content, including connections, authentication, dynamic tools, and recovery.

In plain words
What is it for?
Use it when adding MCP features, debugging connections or changing tool and content discovery, authentication, tasks, or recovery behavior.
Why use it?
It explains how external MCP capabilities are isolated per session and safely exposed to the agent.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when adding MCP features, debugging connections or changing tool and content discovery, authentication, tasks, or recovery behavior.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/echovic/blade-code/mcp-protocol-runtime
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add echoVic/blade-code --skill mcp-protocol-runtime
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for knowledge-extension-ecosystem-mcp-protocol-runtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/echovic/blade-code/mcp-protocol-runtime/github.svg)](https://agentmods.dev/skills/echovic/blade-code/mcp-protocol-runtime)
Your own site
<a href="https://agentmods.dev/skills/echovic/blade-code/mcp-protocol-runtime"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/mcp-protocol-runtime/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for knowledge-extension-ecosystem-mcp-protocol-runtime

Your own site · 80×15
<a href="https://agentmods.dev/skills/echovic/blade-code/mcp-protocol-runtime"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/mcp-protocol-runtime.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 148 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,033 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00148 $0.03033
Opus 5.5 $0.00059 $0.01213
Sonnet 5.5 $0.00030 $0.00607
Haiku 4.5 $0.00015 $0.00303

Measured 1mo ago against content hash a0d9fa85278d, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

knowledge-extension-ecosystem-mcp-protocol-runtime scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.trae/knowledges/extension-ecosystem/mcp-protocol-runtime/SKILL.md · 84 lines

How it starts

The opening of the file, as written. The whole thing — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Module Structure

MCP 运行时由每个 SessionRuntime 独占:配置先按 source project 合并,Registry 管理 多个 client 的安全投影,动态工具和内容能力再进入该 Session 的 ToolRegistry 与事件流。

Directory Layout

  • packages/cli/src/mcp/ — client、registry、目录、交互、恢复、日志、任务与结果归一化
  • packages/cli/src/mcp/auth/ — OAuth 策略、回调 provider 与凭据账本
  • packages/cli/src/tools/builtin/mcp/ — Resources、Prompts、Completion 与 Tasks 工具适配
  • packages/cli/src/commands/mcp.ts — 进程外 MCP 管理命令
  • packages/cli/src/server/routes/mcp.ts — 当前 Web Session 的 MCP 管理 API
  • packages/cli/src/slash-commands/mcp.ts — 活动 TUI/ACP Session 的 MCP 命令
  • packages/cli/web/src/components/mcp/ — Web MCP 状态与操作面板

Key Entry Points

  • resolveWorkspaceMcpConfig() in packages/cli/src/mcp/resolveWorkspaceMcpConfig.ts — 合并并规范化单个 Session 的 MCP 配置
  • McpRegistry.createIsolated() in packages/cli/src/mcp/McpRegistry.ts — 创建 Session 独占 Registry
  • McpClient.connect() and McpClient.callTool() in packages/cli/src/mcp/McpClient.ts — 建连、能力协商与工具调用
  • createMcpTool() in packages/cli/src/mcp/createMcpTool.ts — 将协议工具映射为 Blade Tool
  • SessionRuntime.registerMcpTools() in packages/cli/src/agent/runtime/SessionRuntime.ts — 注册动态目录、内容工具和事件监听

Gotchas

  • MCP 配置覆盖顺序是 workspace → plugin →显式 Session → CLI,strictCliConfig 会跳过前三类来源;相对 stdio cwd 始终按 source project 解析而不是 task worktree(packages/cli/src/mcp/resolveWorkspaceMcpConfig.ts)
  • --mcp-config 的单个非法文件或 JSON 只记录 warning 并跳过,后续参数仍继续覆盖;调用方不能假设解析失败会使 Session 创建失败(packages/cli/src/mcp/loadMcpConfig.ts)
  • McpRegistry.registerServer() 默认吞掉初始连接异常并保留 ERROR server,Session 可继续启动;需要通过状态或显式 reconnect 区分“已注册”与“已连接”(packages/cli/src/mcp/McpRegistry.ts)
  • 同一 client 同时只允许一个交互式工具调用或 task 创建,因为 Elicitation/Sampling 缺少可靠的父调用关联;并发重叠会在发请求前拒绝(packages/cli/src/mcp/McpClient.ts)
  • transport 进入恢复前会立即撤销旧 tools、resources、prompts 和 instructions;持有旧 Tool 对象或旧 catalog identity 重试会命中死亡 connection generation(packages/cli/src/mcp/McpClient.ts, packages/cli/src/mcp/McpRegistry.ts)
  • list_changed 通知只登记有界合并刷新,完整新目录全部校验成功后才替换;notification 刷新失败保留上一有效目录,而手动刷新会把错误返回调用方(packages/cli/src/mcp/McpClient.ts, packages/cli/src/mcp/McpToolCatalog.ts)
  • Resource subscription 分为 desired 与 active:异常断连只清 active 并在新目录确认 URI 后恢复,手动 disconnect、unsubscribe 或 Session dispose 才清 desired(packages/cli/src/mcp/McpClient.ts)
  • MCP Tasks 默认关闭;taskSupport=required 的动态工具会自动后台化,optional 仍以前台调用为默认,只有显式 StartMcpTask 才进入 task 路径(packages/cli/src/mcp/createMcpTool.ts, packages/cli/src/mcp/McpTasks.ts)
  • 模型和用户只能看到 Blade 生成的 mcp_task_*,原始 server task ID 必须留在 manager 内部;ownership 同时校验 Session ID 与 canonical execution workspace(packages/cli/src/mcp/McpTaskManager.ts, packages/cli/src/tools/builtin/mcp/mcpTaskTools.ts)
  • 二进制结果绝不能把 base64 直接注入模型;大文本超过 inline budget 后写 Session 私有 artifact,写入失败也只能返回 hash/size/omitted 元数据(packages/cli/src/mcp/McpToolResult.ts, packages/cli/src/mcp/McpToolArtifactStore.ts)
  • MCP 日志是用户诊断事件而非模型输入,server instructions 才会以明确标注“不可信外部文档”的 scoped reminder 进入 provider boundary;二者不能共用注入路径(packages/cli/src/mcp/McpLogging.ts, packages/cli/src/mcp/McpServerInstructions.ts)

Read the full file on GitHub · 84 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 84 lines · 148 tokens per session scan A a0d9fa85278d

Subscribe to this mod's changes

knowledge-extension-ecosystem-mcp-protocol-runtime is a skill published in the GitHub repository echoVic/blade-code (181 stars, last pushed 3d ago), licensed MIT. It adds 148 tokens to every session and 3,033 once invoked, about $0.0006 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

clinical-reports

Write comprehensive clinical reports including case reports (CARE guidelines), diagnostic reports (radiology/pathology/lab), clinical trial reports (ICH-E3, SAE, CSR), and patient documentation (SOAP, H&P, discharge summaries). Full support with templates, regulatory compliance (HIPAA, FDA, ICH-GCP), and validation…

synthetic-sciences/openscience · 71 tokens

clinical-decision-support

Generate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading…

synthetic-sciences/openscience · 97 tokens

gget

Fast CLI/Python queries to 20+ bioinformatics databases. Use for quick lookups: gene info, BLAST searches, AlphaFold structures, enrichment analysis. Best for interactive exploration, simple queries. For batch processing or advanced BLAST use biopython; for multi-database Python workflows use bioservices.

synthetic-sciences/openscience · 66 tokens

immunology-assays

Computational analysis of immunology experimental data. ATAC-seq differential accessibility, immune cell tracking from microscopy, ELISA data processing with 4-parameter logistic fitting, immunohistochemistry quantification, antibody titer analysis, and cell cycle phase duration estimation. For flow cytometry use…

synthetic-sciences/openscience · 79 tokens

molecular-cloning

Molecular cloning simulation and design. PCR amplicon prediction, restriction enzyme digestion, Golden Gate and Gibson assembly simulation, primer design, CRISPR sgRNA design, and plasmid annotation. For protein-level sequence analysis use biopython or esm; for database lookups use gene-database or ensembl-database.

synthetic-sciences/openscience · 70 tokens

geo-database

Access NCBI GEO for gene expression/genomics data. Search/download microarray and RNA-seq datasets (GSE, GSM, GPL), retrieve SOFT/Matrix files, for transcriptomics and expression analysis.

synthetic-sciences/openscience · 47 tokens