跪拜 Guibai
← All articles
Artificial Intelligence

MCP Is Three Primitives, Not One — and Your Token Should Never Touch the LLM

By 开发江鸟 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Treating MCP as just a tool-calling protocol leaves two-thirds of its surface area unused and muddies the separation between the LLM, the transport layer, and external APIs. Getting the credential boundary wrong — especially letting tokens leak into URL query params or LLM context — creates a logging and security hazard that survives HTTPS encryption.

Summary

A developer who built a GitLab MCP Server early on discovered their mental model was incomplete. They had registered only Tools and assumed that was the whole protocol. MCP actually defines three primitives: Tools for actions, Resources for readable data, and Prompts for reusable templates. The distinction matters once an integration grows beyond simple tool-calling.

The same re-examination untangled the Host, Client, and Server roles. In stdio mode, a local Server process is launched by the Client-side application, which creates the illusion that the Server runs inside the Client. Switching to Streamable HTTP makes the separation obvious: the Client connects to an independently deployed remote Server and never manages its lifecycle.

A concrete trust-boundary experiment tested three scenarios — stdio, HTTP with an Authorization header, and HTTP with the token stuffed into a query parameter. The unsafe variant was rejected before any downstream GitLab API call occurred, preventing side effects and keeping the token out of the simulated LLM context. The demo also clarifies how MCP, API, Tool, Skill, and Plugin each solve different problems in an agentic stack.

Takeaways
MCP Servers can expose three capability types: Tool (actions), Resource (readable data), and Prompt (reusable templates).
The Host is the application that coordinates the Agent and user interaction; the MCP Client is a protocol component inside the Host that connects to one Server.
In stdio mode, the Client-side app launches a local Server child process; in Streamable HTTP mode, the Client connects to an already-running remote Server.
API access tokens must travel through the Authorization header and must never appear in URL query parameters or the LLM context window.
Credential validation must happen before any downstream API call to avoid side effects from a request that will ultimately be rejected.
MCP, API, Tool, Skill, and Plugin are distinct layers: MCP is the discovery/calling protocol, API is the external interface, Tool is a callable capability, Skill is a procedural instruction set, and Plugin is a distribution and versioning wrapper.
Conclusions

Many developers who have built and used MCP Servers still operate with an incomplete mental model, mistaking their narrow implementation for the full protocol.

The stdio transport creates a deceptive coupling: because the Client process spawns the Server, it is easy to conflate their roles and assume the Server lives inside the Client.

Placing a token in a URL query parameter is dangerous not only because it is visible in transit but because it persists in proxy logs, access logs, and monitoring systems even after HTTPS decryption.

The distinction between Skill and MCP Server is underappreciated — a Skill defines when and how to act, but the actual side effect always originates from a Tool handler calling an external API.

Concepts & terms
MCP (Model Context Protocol)
An open protocol that lets AI applications discover and invoke external capabilities — Tools, Resources, and Prompts — through a standardized client-server architecture, avoiding per-Agent custom integrations.
MCP Host
The application that orchestrates the user interaction, the AI Agent, and one or more MCP Clients. Codex and Claude Desktop are examples.
MCP Client
A protocol component inside a Host that manages the connection lifecycle, capability discovery, and request/response communication with a single MCP Server.
Streamable HTTP transport
An MCP transport mode where the Client connects to a remotely deployed Server over HTTP, as opposed to stdio, where the Client spawns a local child process.
Skill (in agentic context)
A procedural instruction set that tells an Agent when to invoke a Tool and what workflow to follow, distinct from the Tool itself and from the MCP Server that executes the Tool.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗