Skip to main content

Understanding MCP servers

MCP servers are programs that expose specific capabilities to AI applications through standardised protocol interfaces.

Common examples: filesystem servers, database servers, GitHub, Slack, and calendar servers.

Adapted from Understanding MCP servers.

Tools, resources and prompts as MCP server primitives

Three server building blocks and who typically controls them. Playbook diagram.

Example weather tool UI in a host — Source: MCP docs

Example of a host surfacing server-backed weather context. Source: modelcontextprotocol/docs (current-weather.png).

Core server features

FeatureExplanationExamplesWho controls it
ToolsFunctions the LLM can call when usefulSearch flights, send messages, create eventsModel
ResourcesPassive read-only data for contextDocuments, schemas, calendarsApplication
PromptsPre-built instruction templatesPlan a vacation, summarise meetingsUser

Tools

Tools are schema-defined operations validated with JSON Schema. They may require user consent before execution.

MethodPurpose
tools/listDiscover tool definitions and schemas
tools/callExecute a tool
{
name: "searchFlights",
description: "Search for available flights",
inputSchema: {
type: "object",
properties: {
origin: { type: "string", description: "Departure city" },
destination: { type: "string", description: "Arrival city" },
date: { type: "string", format: "date", description: "Travel date" }
},
required: ["origin", "destination", "date"]
}
}

Travel booking example: searchFlights, createCalendarEvent, sendEmail — each a single clear action.

User interaction model: hosts should show available tools, approval dialogs, permission presets and activity logs so humans stay in control.

Resources

Resources expose data via unique URIs and MIME types.

PatternExample
Direct resourcecalendar://events/2024
Resource templatetravel://activities/{city}/{category}
MethodPurpose
resources/listList direct resources
resources/templates/listDiscover templates
resources/readRead contents
subscriptions/listenWatch for updates
{
"uriTemplate": "weather://forecast/{city}/{date}",
"name": "weather-forecast",
"title": "Weather Forecast",
"description": "Get weather forecast for any city and date",
"mimeType": "application/json"
}

Parameter completion helps users discover valid values (for example typing Par suggests Paris).

Resources are application-driven: the host decides what to fetch, filter with embeddings, or pass to the model.

Prompts

Prompts are reusable, parameterised templates. They are user-controlled — invoked explicitly (slash commands, command palette), not auto-fired by the model.

MethodPurpose
prompts/listDiscover prompts
prompts/getRetrieve full definition and arguments
{
"name": "plan-vacation",
"title": "Plan a vacation",
"description": "Guide through vacation planning process",
"arguments": [
{ "name": "destination", "type": "string", "required": true },
{ "name": "duration", "type": "number", "description": "days" },
{ "name": "budget", "type": "number", "required": false }
]
}

Bringing servers together

The power of MCP shows when multiple servers collaborate:

  1. User invokes plan-vacation with destination and dates.
  2. User (or host) selects resources: calendar, travel preferences, past trips.
  3. Model uses tools across Travel, Weather and Calendar/Email servers — with approval for booking side effects.

Result: a task that could take hours completes in minutes with structured context and controlled actions.

Negative cases

  • Tool schemas that are too vague → models call tools incorrectly; keep one responsibility per tool.
  • Resources without MIME types → hosts mishandle content; always declare MIME.
  • Prompts that auto-trigger → violates user control; require explicit invocation.
  • Granting filesystem tools to broad home directories → over-privilege; scope paths tightly.

Available MCP tools indicator in a host UI — Source: MCP docs

Hosts often surface a tools affordance so users can see what servers expose. Source: modelcontextprotocol/docs.

Discussion

Comments

Share feedback or questions about this page. No account required.

Loading comments…