Skip to main content
MCP servers are programs that expose specific capabilities to AI applications through standardized protocol interfaces. Common examples include file system servers for document access, database servers for data queries, GitHub servers for code management, Slack servers for team communication, and calendar servers for scheduling.

Core Server Features

Servers provide functionality through three building blocks: We will use a hypothetical scenario to demonstrate the role of each of these features, and show how they can work together.

Tools

Tools enable AI models to perform actions. Each tool defines a specific operation with typed inputs and outputs. The model requests tool execution based on context.

How Tools Work

Tools are schema-defined interfaces that LLMs can invoke. MCP uses JSON Schema for validation. Each tool performs a single operation with clearly defined inputs and outputs. Tools may require user consent prior to execution, helping to ensure users maintain control over actions taken by a model. Protocol operations: Example tool definition:

Example: Travel Booking

Tools enable AI applications to perform actions on behalf of users. In a travel planning scenario, the AI application might use several tools to help book a vacation: Flight Search
Queries multiple airlines and returns structured flight options. Calendar Blocking
Marks the travel dates in the user’s calendar. Email notification
Sends an automated out-of-office message to colleagues.

User Interaction Model

Tools are model-controlled, meaning AI models can discover and invoke them automatically. However, MCP emphasizes human oversight through several mechanisms. For trust and safety, applications can implement user control through various mechanisms, such as:
  • Displaying available tools in the UI, enabling users to define whether a tool should be made available in specific interactions
  • Approval dialogs for individual tool executions
  • Permission settings for pre-approving certain safe operations
  • Activity logs that show all tool executions with their results

Resources

Resources provide structured access to information that the AI application can retrieve and provide to models as context.

How Resources Work

Resources expose data from files, APIs, databases, or any other source that an AI needs to understand context. Applications can access this information directly and decide how to use it - whether that’s selecting relevant portions, searching with embeddings, or passing it all to the model. Each resource has a unique URI (e.g., file:///path/to/document.md) and declares its MIME type for appropriate content handling. Resources support two discovery patterns:
  • Direct Resources - fixed URIs that point to specific data. Example: calendar://events/2024 - returns calendar availability for 2024
  • Resource Templates - dynamic URIs with parameters for flexible queries. Example:
    • travel://activities/{city}/{category} - returns activities by city and category
    • travel://activities/barcelona/museums - returns all museums in Barcelona
Resource Templates include metadata such as title, description, and expected MIME type, making them discoverable and self-documenting. Protocol operations: To watch specific resources for changes, a client sends a subscriptions/listen request with the resource URIs listed in the resourceSubscriptions filter. The server delivers notifications/resources/updated on the resulting stream whenever a watched resource changes.

Example: Getting Travel Planning Context

Continuing with the travel planning example, resources provide the AI application with access to relevant information:
  • Calendar data (calendar://events/2024) - Checks user availability
  • Travel documents (file:///Documents/Travel/passport.pdf) - Accesses important documents
  • Previous itineraries (trips://history/barcelona-2023) - References past trips and preferences
The AI application retrieves these resources and decides how to process them, whether selecting a subset of data using embeddings or keyword search, or passing raw data directly to the model. In this case, it provides calendar data, weather information, and travel preferences to the model, enabling it to check availability, look up weather patterns, and reference past travel preferences. Resource Template Examples: