CCDV-F · Domain 8: Tools and MCP · 10% of the exam
Task 8.2: MCP Server Development and Integration
Building and deploying an MCP server and connecting it to Claude applications and workflows: its resources, tools and prompts, the stdio or HTTP transport, and authentication.
Study it
MCP servers: resources, tools, prompts, transports and authentication
Lesson coming
Sample questions
Try each one before opening the answer. Every option is explained, with the Anthropic documentation page that proves it.
Question 1 · choose 1
You wrote a local MCP server in Python that Claude Code launches with the stdio transport:mcp = FastMCP("inventory")
@mcp.tool()
def stock_level(sku: str) -> str:
print(f"looking up {sku}")
return lookup(sku)The server connects, but whenever stock_level runs, Claude Code reports a broken connection or unreadable messages. What should you change?
APrint each debug line as a JSON object so that the client can parse it
BRaise the client's tool timeout so that the lookup has time to finish
CSend the debug output to stderr, for example through the logging module
DKeep the print, which goes to the terminal, and return the result as structured content instead
Show the answer and why
APrint each debug line as a JSON object so that the client can parse it
Incorrect
Only valid MCP messages may go to stdout; any other JSON still corrupts the stream.
BRaise the client's tool timeout so that the lookup has time to finish
Incorrect
The messages break because of the print, not because the call takes too long.
CSend the debug output to stderr, for example through the logging module
Correct
stdout carries the protocol messages; the server may log to stderr.
DKeep the print, which goes to the terminal, and return the result as structured content instead
Incorrect
print() writes to stdout, which is the server's protocol channel under stdio.
Under stdio, the client reads MCP messages from the server's stdout, and the server must not write anything there that is not a valid MCP message. print() writes to stdout by default, so log to stderr, for example with the logging module.
Your MCP server gives Claude read access to customer records. There are about 40,000 customers, and Claude should be able to read any one record when a conversation needs it. You want clients to discover the data without the server announcing 40,000 separate entries. How should the server expose the records?
AAs a resource template with a parameterized URI, such as crm://customers/{customer_id}
BAs 40,000 direct resources, one fixed URI per customer, listed by the server
CAs one prompt per customer that the user selects before each conversation
DAs a single direct resource whose content holds all 40,000 records at once
Show the answer and why
AAs a resource template with a parameterized URI, such as crm://customers/{customer_id}
Correct
Resource templates are parameterized URIs for flexible queries and are discoverable through resources/templates/list.
BAs 40,000 direct resources, one fixed URI per customer, listed by the server
Incorrect
That is exactly the per-record listing the design must avoid.
CAs one prompt per customer that the user selects before each conversation
Incorrect
Prompts are user-controlled instruction templates, not a way to read records on demand.
DAs a single direct resource whose content holds all 40,000 records at once
Incorrect
One fixed URI would return the whole data set instead of the record a conversation needs.
Resources come as direct resources with fixed URIs or as resource templates, parameterized URIs such as travel://activities/{city}/{category} that serve flexible queries. Templates carry their own metadata and are discoverable, so one template can cover every customer record.
Your remote MCP server uses the Streamable HTTP transport of the 2026-07-28 specification and answers a long tools/call request with an SSE response stream. The user cancels the call in the client. How does the client signal the cancellation on this transport?
AIt sends a notifications/cancelled message in a new POST, naming the ID of the request
BIt sends a DELETE request with the Mcp-Session-Id header to end the whole session
CIt closes that request's SSE response stream, which the server treats as cancellation
DIt can't; the server keeps working on the call until it has sent the final response
Show the answer and why
AIt sends a notifications/cancelled message in a new POST, naming the ID of the request
Incorrect
On Streamable HTTP no notifications/cancelled message is expected; that message is used on stdio.
BIt sends a DELETE request with the Mcp-Session-Id header to end the whole session
Incorrect
The 2026-07-28 revision removed protocol-level sessions from Streamable HTTP.
CIt closes that request's SSE response stream, which the server treats as cancellation
Correct
The server must treat closing a request's SSE response stream as cancellation of that request.
DIt can't; the server keeps working on the call until it has sent the final response
Incorrect
After the stream closes, the server should stop work and must not send further messages for the request.
In the 2026-07-28 Streamable HTTP transport each request has its own response stream, so closing that SSE stream is itself the cancellation signal: the server must treat it as cancellation, should stop work as soon as practical and must not send further messages for the request. The notifications/cancelled message belongs to the stdio transport, which has no per-request stream.
You are adding authentication to a local MCP server that Claude Code launches over stdio. A teammate plans to implement the MCP OAuth authorization flow for it. What does the specification say?
AEvery transport must implement the OAuth authorization flow
Bstdio servers must put a bearer token in each JSON-RPC message they send
Cstdio servers authenticate through the client's API key only
Dstdio servers should retrieve credentials from the environment
Show the answer and why
AEvery transport must implement the OAuth authorization flow
Incorrect
The authorization specification targets HTTP-based transports.
Bstdio servers must put a bearer token in each JSON-RPC message they send
Incorrect
The specification points stdio servers to credentials from the environment.
Cstdio servers authenticate through the client's API key only
Incorrect
The specification does not route stdio credentials through the client's key.
Dstdio servers should retrieve credentials from the environment
Correct
HTTP-based transports should conform; stdio should retrieve credentials from the environment.
Implementations using an HTTP-based transport should conform to the MCP authorization specification. Implementations using stdio should not follow it and should instead retrieve credentials from the environment.