Hacker News
points by LoganDark 2 days ago | 0 comments
The text doesn't even stay on screen for long enough for you to properly parse it and think it through. How do you think a beginner could ever use this?

Here's a more concise explainer that doesn't take a whole page.

Most language models can only generate content, like text or images, by default. For a model to perform actions, you need to give it tools. These tools are like functions: the model emits special markers signaling a tool call, which includes the name of the tool as well as parameters for the tool. Models can be instructed to do this, but many models are already trained to emit tool calls when tool definitions are provided.

These special markers around the tool call signal to a surrounding system, called a harness, that the model intends to call a tool. The harness, or the provider, will typically stop generation after collecting a tool call or multiple, execute the tool(s) with the specified parameters, and then restart generation with the results of the tool calls.

(The harness could be a desktop app, or a CLI like Claude Code. Sometimes even websites can offer to connect to hosted or even local MCP servers. Some providers like Anthropic also have a server-side harness, which performs server-side tool calls transparently, sending only the client-side tool calls down to be performed by the client-side harness.)

However, some users want models to be able to call tools that aren't built-in to the harness. This includes tools from third-party developers, as well as custom tools; anything the user wants the model to be able to do. MCP allows a harness to achieve this capability by connecting to an MCP server and exchanging messages to communicate tool calls and receive their results.

The harness can connect to the MCP server in one of two ways: using HTTP Server-Sent Events (legacy) or the newer "Streamable HTTP" to connect to an already-running server, or executing a command as a new subprocess and communicating by writing messages (JSON-RPC) to its stdin and reading responses from its stdout.

Once a connection is successful, the harness asks the server for tool definitions. These are JSON schemas, defining the shape and documentation of expected and allowed parameters for each tool the server offers. The harness can include these tool definitions when calling the model. The server can also provide documentation that applies to all tools, and which can also be included to the model.

When the model tries to call one of the server's tools by emitting a tool call, the harness sends the tool call and its parameters as a message to the server, which may perform the desired action before returning a response back to the harness. The harness then communicates this response to the model to continue the model's turn.

This omits some implementation details of precisely how protocols are implemented, because that knowledge is relevant only to the protocols themselves and not to MCP servers in specific. That is one distinction LLMs struggle to make in explainers. It assumes some basic familiarity with certain computing concepts like processes or stdio. In all cases, a search engine should help you study up on anything you might not understand yet.

Aún no hay comentarios.