Claude With The Anthropic Api
← All lessons
Lesson 61Claude With The Anthropic Api

MCP clients

Summary audio

No audio recap for this lesson.

Study notes

Purpose & Role

  • Client provides communication between your server and an MCP server
  • Acts as the access point to all tools implemented by the MCP server

Transport Agnostic Communication

  • Client and server can communicate over multiple protocols
  • Common setup: both running on same physical machine using standard input/output
  • Alternative protocols: HTTP, WebSockets, and others

Message Types

  • List Tools Request: sent from client to server; asks server to list all available tools
  • List Tools Result: server response containing the list of tools it provides
  • Call Tool Request: asks server to run a specific tool with particular arguments
  • Call Tool Result: contains the results from running the tool

Example Communication Flow

  • User submits query to server
  • Server asks MCP client to get list of tools
  • MCP client sends list tools request → MCP server responds with list tools result
  • Server sends user query + tool list to cloud/LLM
  • Cloud decides to call a tool and responds with tool use message
  • Server asks MCP client to run the tool with cloud's arguments
  • MCP client sends call tool request → MCP server executes tool (e. g. , calls GitHub API)
  • MCP server wraps results in call tool result → sends back to MCP client
  • MCP client returns result to server
  • Server sends tool result back to cloud/LLM
  • Cloud formulates final response and sends to user

Takeaways

  • MCP client acts as the communication bridge between your server and an MCP server, providing access to all available tools
  • Client and server communicate via transport-agnostic protocols (stdin/stdout, HTTP, WebSockets, etc. )
  • Four core message types enable tool discovery and execution: List Tools Request/Result and Call Tool Request/Result
  • The typical workflow involves the server requesting available tools from the MCP server, passing them to an LLM, executing the LLM's chosen tool via the MCP client, and returning results back through the chain
Flashcards 8 cards
Question
click to reveal · ←/→
Answer
click to flip back
Export to Anki (.tsv) ↓
Knowledge check 6 questions