逐日AI微信小程序
← 返回全部课程题库

7 天 MCP:把工具接进任何 Agent

课程题库 · 21 / 21 道题

D1 为什么需要一个协议:host / client / server 三角、JSON-RPC 消息与三种原语

  • MCP 和模型自带的函数调用到底差在哪?什么情况下你不该用 MCP?How is MCP actually different from a model's built-in function calling, and when should you not use MCP?
    国内高频海外高频基础#mcp-basics#architecture

    🔒 解锁 D1 后查看答题要点。

  • MCP 规范为什么规定一个客户端只连一个服务端?多路复用不是更省资源吗?Why does the MCP spec require one client per server instead of multiplexing many servers over one connection?
    国内高频海外高频进阶#architecture#security

    🔒 解锁 D1 后查看答题要点。

  • 2026-07-28 这一版把 MCP 改成了无状态协议,删掉了 initialize 握手。这么改的代价是什么?服务端还想保存状态该怎么办?The 2026-07-28 revision made MCP stateless and removed the initialize handshake. What does that cost, and how should a server that still needs state handle it?
    国内高频海外高频深入#protocol-versions#statelessness

    🔒 解锁 D1 后查看答题要点。

D2 写第一个 MCP server:stdio 传输、官方 SDK、参数 schema、工具注解与 Inspector 调试

  • 工具的 description 到底写给谁看?写得太泛,在生产里会造成什么具体后果?Who is a tool's description actually written for, and what concretely goes wrong in production when it is too vague?
    国内高频海外高频基础#tool-design#prompt-surface

    🔒 解锁 D2 后查看答题要点。

  • 什么时候该返回 JSON-RPC 的 error,什么时候该返回 isError 为真的工具结果?给我一个判据。When should a tool return a JSON-RPC error versus a result with isError set to true? Give me a decision rule.
    国内高频海外高频进阶#error-handling#tool-design

    🔒 解锁 D2 后查看答题要点。

  • 一个 stdio 的 MCP 服务端最常见的翻车原因是什么?你会在代码和流程上分别怎么堵住它?What is the most common way a stdio MCP server breaks, and how do you prevent it in code and in process?
    国内高频海外高频深入#stdio-transport#debugging

    🔒 解锁 D2 后查看答题要点。

D3 resources 与 prompts:URI 模板、变更通知、进度与日志、分页,以及客户端能力

  • 同一份数据,做成 MCP 资源和做成工具有什么区别?你按什么标准选?For the same data, what is the difference between exposing it as an MCP resource versus a tool, and how do you choose?
    国内高频海外高频基础#primitives#server-design

    🔒 解锁 D3 后查看答题要点。

  • MCP 的分页游标为什么必须是不透明的?如果客户端去解析它,会出什么问题?Why must MCP pagination cursors be opaque, and what breaks if a client parses them?
    国内高频海外高频进阶#pagination#api-design

    🔒 解锁 D3 后查看答题要点。

  • 订阅流和请求内的进度通知在 HTTP 上都走 SSE,为什么 2026-07-28 规范要把它们分成两个通道?On HTTP both subscription streams and in-request progress notifications ride SSE, so why does the 2026-07-28 spec split them into two channels?
    国内高频海外高频深入#subscriptions#notifications

    🔒 解锁 D3 后查看答题要点。

D4 远程 MCP:Streamable HTTP 绑定、无状态模型与请求元数据、OAuth 2.1 授权、容器部署

  • 2026-07-28 去掉了协议级会话。那一个需要跨调用保存状态的远程服务端——比如购物车、数据库事务——应该怎么设计?The 2026-07-28 revision removed protocol-level sessions. How should a remote server that needs cross-call state — a shopping cart, a database transaction — be designed?
    国内高频海外高频进阶#statelessness#api-design

    🔒 解锁 D4 后查看答题要点。

  • Streamable HTTP 要求 Mcp-Method 头必须和请求体里的 method 一致。为什么要抄一遍?不校验会有什么风险?Streamable HTTP requires the Mcp-Method header to match the method in the request body. Why mirror it at all, and what breaks if the server does not validate the match?
    国内高频海外高频进阶#transport#security

    🔒 解锁 D4 后查看答题要点。

  • 为什么 MCP 服务端绝对不能把客户端给的访问令牌直接转发给下游 API?Why must an MCP server never forward the client's access token straight to a downstream API?
    国内高频海外高频深入#oauth#security

    🔒 解锁 D4 后查看答题要点。

D5 写一个 MCP client:在自己的 Agent 循环里发现并调用工具、多 server 聚合与命名冲突

  • 你的客户端同时连了五个 MCP 服务端,其中两个都有一个叫 search 的工具。合并成一张工具表给模型时,重名该怎么处理?为什么不能直接拿服务端名做前缀?Your client is connected to five MCP servers and two of them expose a tool called search. How do you merge them into one tool list for the model, and why can't you just prefix with the server's name?
    国内高频海外高频进阶#client#tool-naming

    🔒 解锁 D5 后查看答题要点。

  • 线上一个 MCP 服务端超时了。你的 Agent 循环应该怎么反应?One of your MCP servers times out in production. How should your agent loop react?
    国内高频海外高频进阶#client#reliability

    🔒 解锁 D5 后查看答题要点。

  • 把 MCP 的工具定义翻译成模型 API 的工具参数时,最容易丢掉的是什么?丢了会怎样?When translating an MCP tool definition into a model API's tool parameters, what is most easily lost, and what goes wrong when it is?
    国内高频海外高频深入#client#tool-schema

    🔒 解锁 D5 后查看答题要点。

D6 安全与治理:工具描述里的提示注入、混淆代理、最小权限、审计日志与工具白名单

  • 为什么说 MCP 工具的描述是不可信输入?作为客户端作者,你会做哪些防护?Why is an MCP tool's description untrusted input, and what protections would you build as a client author?
    国内高频海外高频进阶#prompt-injection#client

    🔒 解锁 D6 后查看答题要点。

  • 混淆代理攻击在 MCP 场景里具体是怎么发生的?规范要求怎么防?How does the confused deputy attack play out in an MCP setting, and what does the spec require to prevent it?
    国内高频海外高频深入#oauth#confused-deputy

    🔒 解锁 D6 后查看答题要点。

  • 2026-07-28 之后协议是无状态的,服务端要保存状态就得铸一个句柄让客户端带回来。这会带来什么新的攻击面?怎么防?Since the protocol is stateless, a server that needs state mints a handle for the client to carry back. What attack surface does that create, and how do you close it?
    国内高频海外高频进阶#statelessness#security

    🔒 解锁 D6 后查看答题要点。

D7 生产化与复盘:给工具写评估、版本化、发布到 npm 与 registry、可观测与综合项目

  • 怎么评估一个 MCP 工具做得好不好?你会设计哪几类测试用例?How do you evaluate whether an MCP tool is any good, and what categories of test cases would you design?
    国内高频海外高频进阶#eval#tooling

    🔒 解锁 D7 后查看答题要点。

  • 给一个 MCP 服务端做版本管理时,什么样的改动算破坏性变更?为什么说改一句工具描述比改一个字段名更危险?When versioning an MCP server, what counts as a breaking change, and why is editing a tool description more dangerous than renaming a field?
    国内高频海外高频进阶#versioning#tooling

    🔒 解锁 D7 后查看答题要点。

  • 线上有人反馈某个 MCP 工具「总是调不对」。你按什么顺序排查?A user reports that one of your MCP tools is 'always getting it wrong' in production. In what order do you investigate?
    国内高频海外高频进阶#observability#debugging

    🔒 解锁 D7 后查看答题要点。