Skip to content
Optimal Lab

Tools · interactive

MCP: tools the model can call

MCP is a socket between your app and a tool server. The server lists what it can do. The model picks one. Your app forwards the call. The model never opens the tool itself.

Model

picks a tool

Your app

MCP client

MCP server

2 tools

get_weather

the real work

Run the call and follow it from the model to the tool and back.

Step 1 of 6

  1. 1

    Connect to the server

    The app opens the MCP server at startup and keeps that connection.

    server: local tools

  2. 2

    Read the tool list

    Each tool has a name and a one-line description. That list is what the model is allowed to choose from.

    • get_weatherCurrent temperature for a city
    • search_docsFind a page in the docs
  3. 3

    A question arrives

    The question decides which tool is useful. Change it and the call changes.

    How warm is it in Lahore?

  4. 4

    The model picks a tool

    It names the tool and the arguments. That is a request, not a result.

    get_weather({ "city": "Lahore" })

  5. 5

    The app forwards it

    Your app sends the call to the MCP server and waits. The model is idle here.

    App → MCP server → get_weather

  6. 6

    Hand the result back

    The server's reply goes back into the conversation. The model's next sentence can use it.

    34°C, dry (sample reading)

In production

Tools and technologies

MCP is the wire format between an app and a tool server — any language can implement either side.

Not tied to one language — use these names when you search docs or design a system.