DEV Community

Cover image for Everything You Need to Know About MCP
tdk-cli
tdk-cli

Posted on

Everything You Need to Know About MCP

The Model Context Protocol (MCP) is an open standard for connecting AI agents to the tools and data they need. Before MCP, every agent had its own way to call a database, read a file, or run a command, so each integration was built from scratch. MCP defines one protocol, so a server written once can serve any agent that speaks it.

The three parts

An MCP server offers three kinds of things:

  • Tools are functions the agent can call, such as "run tests" or "query orders". Each tool has a name, a description, and a schema for its arguments.
  • Resources are data the agent can read, such as a file, a document, or a log snapshot.
  • Prompts are reusable templates the user or client can invoke.

Most servers today mainly offer tools. The agent decides when to call them, based on their descriptions.

How it works

A client, such as an IDE or a coding agent, starts the server as a process and talks to it over a transport. The common transport is standard input and output on the same machine. Some servers run over HTTP instead. The client asks the server which tools it offers, then calls them as the agent needs them. Each call returns a structured result.

Why descriptions matter

The agent chooses tools by reading their names and descriptions. A vague description leads to wrong calls, and a missing argument description leads to guessed values. Treat tool descriptions as part of the interface, and write them the way you would write an API reference.

Security

A tool is a capability. If an agent can call a tool that deletes data, the agent can delete data. Good practice:

  • give each server the narrowest scope it needs,
  • make destructive tools explicit and separate from read-only ones,
  • require a person to approve actions that are hard to undo,
  • log every call so you can review what happened,
  • never expose a local server to a network you do not control.

Choosing servers

Common categories include documentation lookup, browser testing, version control, databases, and error tracking. Pick the few that match your work, and check the source before installing one. A server runs with your permissions.

A local example

TDK CLI includes an MCP server, started with tdk mcp from a project folder. It exposes doctor, up, down, status, logs, and resource_list. The up tool returns before the stack is ready, so the agent should poll status until readiness is true. That gives the agent a clear finish line instead of a guess.

Summary

MCP standardises how agents reach tools and data. Its value depends on good tool descriptions, narrow permissions, and review of what the agent does with them.

Top comments (0)