Building an MCP client
For engineers
Connecting your own application or agent to MCP servers, turning model tool calls into MCP requests and keeping many servers manageable
110 questions across four stages: Understand, Apply, Solve and Judge.
Try 5 questions
Practice items, not counted towards your mastery. No account needed.
Check yourself · 1 of 5
A server answers tools/list with 40 tools and a nextCursor value. What should your client do?
Check yourself · 2 of 5
Which MCP tool field becomes input_schema in a Claude tool definition?
Check yourself · 3 of 5
Two connected servers both expose a tool called search. What is the standard fix on the client side?
Check yourself · 4 of 5
What does a provider-hosted MCP connector remove from your application?
Check yourself · 5 of 5
A tools/call response is a normal result with isError set to true and the text file not found. What should the client do?
Topics
- Connecting to servers and listing capabilities5 min read · Discovering versions and capabilities, paging through tools/list, caching definitions with freshness hints, and reacting to list changes
- Turning model tool calls into MCP requests5 min read · Converting MCP tool definitions to Claude, OpenAI and Gemini tool formats, sending tools/call, and returning text, structured and image results
- Managing many servers without flooding the context6 min read · Namespacing colliding tool names, filtering tools per task, deferred tool search, calling servers from generated code, and approval prompts
- Hosted MCP connectors in model provider APIs5 min read · Letting Claude or OpenAI APIs call a remote MCP server for you, what you give up in control, and when to run your own client
- Handling protocol errors, tool failures and timeouts6 min read · JSON-RPC errors versus isError tool results, unsupported versions, broken streams that must be retried, timeouts and cancellation
Start here
- Build an MCP client (official tutorial) (opens in a new tab)DocsFree
A working client that connects, lists tools and runs the tool-call loop with a model.
- MCP connector (Claude API docs) (opens in a new tab)DocsFree
How the Claude API connects to remote MCP servers for you, and the limits of that mode.
- Connectors and MCP servers (OpenAI API docs) (opens in a new tab)DocsFree
The OpenAI side of hosted MCP: server config, approvals and tool filtering.
Helps to know first
110 questions · last verified 2026-12