How LLM use MCPs?

Published: (January 8, 2026 at 02:09 AM EST)
2 min read
Source: Dev.to

Source: Dev.to

Overview

To understand how a Large Language Model (LLM) knows what is in a Model Context Protocol (MCP) server, think of the LLM not as a person who “knows” things, but as a chef who is handed a menu right before cooking. The LLM doesn’t actually “know” the MCP exists until you send a message.

Step‑by‑step process

  1. Start a session
    In an MCP‑enabled application (e.g., Claude Desktop or Cursor), the MCP client (the app) contacts the MCP server (the tool) using the standard request tools/list.

  2. Server response
    The server returns a list of every tool it provides. For each tool it supplies:

    • Name
    • Description
    • JSON Schema (the arguments the tool requires)
  3. Inject tool list into the prompt
    The MCP client inserts this list directly into the LLM’s prompt context, typically as part of the system instructions.

  4. Hidden instruction block
    When the LLM receives your message, it also sees a hidden block of text such as:

    You have access to the following tools:
    get_weather: Get current weather. Parameters: location (string).
    query_postgres: Run SQL on the DB. Parameters: query (string).
  5. User query
    You ask, for example, “What’s the weather in Tokyo?”

  6. Tool selection
    The LLM recognizes that it doesn’t know the weather but sees a tool (get_weather) that matches the intent.

  7. Structured tool call
    Following its training on “Tool Use” or “Function Calling” patterns, the LLM stops generating regular text and outputs a structured snippet:

    {
      "call": "get_weather",
      "args": {
        "location": "Tokyo"
      }
    }
  8. Client processes the call

    • The client detects the snippet in the LLM’s output.
    • It pauses the LLM and sends the specified request to the MCP server.
    • The server runs the actual code and returns the result to the client.
  9. Result fed back to the LLM
    The client feeds the result back into the LLM’s context.

  10. Final answer
    The LLM reads the result and replies, e.g., “The weather in Tokyo is 15 °C and sunny.”

Back to Blog

Related posts

Read more »

𝗗𝗲𝘀𝗶𝗴𝗻𝗲𝗱 𝗮 𝗣𝗿𝗼𝗱𝘂𝗰𝘁𝗶𝗼𝗻‑𝗥𝗲𝗮𝗱𝘆 𝗠𝘂𝗹𝘁𝗶‑𝗥𝗲𝗴𝗶𝗼𝗻 𝗔𝗪𝗦 𝗔𝗿𝗰𝗵𝗶𝘁𝗲𝗰𝘁𝘂𝗿𝗲 𝗘𝗞𝗦 | 𝗖𝗜/𝗖𝗗 | 𝗖𝗮𝗻𝗮𝗿𝘆 𝗗𝗲𝗽𝗹𝗼𝘆𝗺𝗲𝗻𝘁𝘀 | 𝗗𝗥 𝗙𝗮𝗶𝗹𝗼𝘃𝗲𝗿

!Architecture Diagramhttps://dev-to-uploads.s3.amazonaws.com/uploads/articles/p20jqk5gukphtqbsnftb.gif I designed a production‑grade multi‑region AWS architectu...