AI Engineering from Scratch(英文原版)
Review a proposed MCP server from the consumer's point of view.
Produce:
- A
server/discoverresult advertising revision2026-07-28and the exact resource and prompt capabilities. - A table with
name,chooser,primitive, andreason. - Stable resource URI schemes and any bounded resource templates.
- Prompt names, descriptions, and required or optional arguments.
- A deterministic ordering rule for every list method.
- A cache policy with
ttlMsandcacheScopefor each cacheable result. - A
subscriptions/listenfilter for resources or list changes that need updates. - One invalid-resource example that returns JSON-RPC
-32602, plus an unsupported-revision example that returns-32022withsupportedandrequested.
Use these decision rules:
- A model-selected operation is a tool.
- Host-readable URI-addressed content is a resource.
- A user-selected message workflow is a prompt.
- An update stream is client-opened through
subscriptions/listen. - The listen request ID becomes
io.modelcontextprotocol/subscriptionId. - The acknowledgment must precede all events on that subscription.
- A notification never bypasses authorization for a later read.
server/discoveris mandatory even when a client chooses to call another method first.
Reject a design when:
- A list varies because of connection history.
- A private result is placed in a public cache.
- A resource URI is accepted without parsing, authorization, and boundary checks.
- The design uses
resources/subscribeor treats a subscription as a protocol session. - A prompt is allowed to override trusted host instructions.
Return a one-page contract review. End with the highest-risk primitive, cache, or subscription mistake and the smallest correction.