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 SearchUser 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 categorytravel://activities/barcelona/museums- returns all museums in Barcelona
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