The MCP interaction model
These three interaction types work together through what’s known as the “MCP interaction model”:- Prompts are user-driven, typically exposed through slash commands or menu options
- Resources are application-driven, where the client decides how to use the data
- Tools are model-driven, where the AI chooses when and how to call them
Please refer to the full Model Context Protocol specification for more details.
Prompts: User-driven templates for AI interactions
Prompts in MCP are predefined templates that users can invoke directly. Think of them as shortcuts or examples that help users get started with your MCP server’s capabilities.Why prompts matter
As the creator of an MCP server, you know best how your tools should be used. Prompts let you provide users with working examples they can invoke immediately, rather than expecting them to figure out the right way to phrase their requests.How prompts work
The prompt interaction follows a specific flow between the user, client application, and MCP server:Dynamic prompt capabilities
Under the hood, prompts are just code, which means they can be dynamic. They can:- Fetch live data from APIs
- Include current system state
- Offer autocomplete for arguments
- Adapt based on user context
When to use prompts
Use prompts when you want to:- Provide examples of how to use your MCP server
- Give users shortcuts for common workflows
- Include dynamic context that would be tedious to type manually
- Onboard new users with working examples
Resources: Application-driven data exposure
Resources represent raw data that your MCP server can expose to client applications. Unlike prompts that users invoke or tools that models call, resources are consumed by the application itself.The power of application choice
Resources give applications complete freedom in how they use your data. A client might:- Build embeddings for retrieval-augmented generation (RAG)
- Cache frequently accessed data
- Transform data for specific use cases
- Combine multiple resources in novel ways
Resource types
MCP supports two types of resources: Direct resources have fixed URIs and represent specific data:Implementing resources
Here’s a Python example showing how to expose database schemas as resources:When to use resources
Use resources when you want to:- Expose raw data for the application to process
- Enable RAG implementations
- Provide data that applications might cache or index
- Support multiple data consumption patterns
Tools: Model-driven actions
Tools are the most familiar MCP primitive—functions that the AI model can choose to call during conversations. They represent actions your MCP server can perform.Tool design principles
Effective tools should:- Have clear, descriptive names
- Include comprehensive descriptions
- Define precise input schemas
- Return structured, helpful results
Tool implementation
Here’s a TypeScript example of a calculation tool:How tools work in practice
Tools follow the familiar function calling pattern, but within the MCP framework:When to use tools
Use tools when you want the AI to:- Perform actions on behalf of users
- Query external systems
- Transform or process data
- Make decisions about when to invoke functionality
Bringing it all together: A GitHub issue tracker example
Here’s how these three primitives work together in a GitHub issue tracker MCP server: Prompts provide shortcuts like “summarize recent issues” with autocomplete for project repositories and milestones, giving users an easy way to catch up on project status and outstanding work. Resources expose repository metadata, issue lists, pull request data, and commit histories that applications can use for embeddings, caching, or building comprehensive project dashboards. Tools handle actions like creating issues, updating labels, assigning team members, and searching across repositories that the AI can invoke as needed based on user requests. This combination allows users to interact with GitHub repositories through natural language while giving applications the flexibility to process GitHub data in sophisticated ways. By using all three interaction types together, you create a much richer experience than tool calling alone could provide.Building richer MCP experiences with Upsun
When you’re building MCP servers that take advantage of these three interaction types, you need a platform that can handle the complexity. Upsun’s Cloud Application Platform provides the infrastructure you need:- Preview environments let you test MCP server changes in production-like environments
- Multi-app architecture supports complex MCP implementations with multiple services
- Built-in observability helps you monitor MCP server performance and usage
- Git-driven infrastructure ensures your MCP server deployments are consistent and version-controlled