The Model Context Protocol (MCP) is changing how AI agents work with external systems, services, and data. It uses a client-server model to connect a model’s static capabilities to the dynamic digital ecosystems it has to work within. In previous posts, we explored the basics of how MCP operates and the types of problems it solves. This post covers the three components that make the protocol work: Tools, Resources, and Prompts.
Each component has a distinct job in a contextual, secure AI workflow. If you are building AI assistants, integrating intelligent agents into enterprise systems, or experimenting with multimodal interfaces, you need to understand all three to build reliable systems.
Understanding the MCP Client-Server Architecture
MCP architecture is a client-server framework connecting AI agents to external data and systems. The host application runs a client that manages connections to remote or local services. These services run as servers. Each server exposes specific capabilities to the client using JSON-RPC 2.0 over standard transport layers like stdio or HTTP Server-Sent Events.
This setup standardizes communication. The client requests a list of available actions or data sources. The server replies with a structured catalog. The AI model decides which actions to take based on that catalog. This dynamic discovery allows an agent to read server capabilities at runtime.
The protocol groups server capabilities into three core primitives. These primitives define how data moves and actions execute.
| Primitive | Grammatical Role | Control Model | Function |
|---|---|---|---|
| Tools | Verbs | Model-controlled | Execute actions and modify state |
| Resources | Nouns | Application-controlled | Provide read-only data and context |
| Prompts | Grammar | User-controlled | Structure interactions and workflows |
When an AI agent connects to a server, it discovers these three primitives automatically. This self-describing approach reduces integration overhead for software teams. Developers write the server logic once. Any compatible client can then read the server capabilities and use them.
1. Tools: Enabling AI to Take Action
What Are Tools?
In MCP, Tools are how a model takes action. They are the verbs that let an AI model do more than generate static responses. Tools let models to call external services, interact with APIs, trigger business logic, or manipulate real-time data. These tools are not part of the model itself; they are defined and managed by an MCP server.
Tools connect AI to real-world systems and applications, such as messaging platforms, databases, calendars, web services, or cloud infrastructure. They are entirely model-controlled. The AI decides when and how to invoke them based on the task it is trying to accomplish.
Key Characteristics of Tools
- Discovery – Clients can discover which tools are available through the
tools/listendpoint. This allows dynamic inspection and registration of capabilities. - Invocation – Tools are triggered using the
tools/callendpoint, allowing an AI to request a specific operation with defined input parameters. - Versatility – Tools cover a wide range: performing math operations, querying APIs, orchestrating workflows, and executing scripts.
Examples of Common Tools
search_web(query)– Perform a web search to fetch up-to-date information.send_slack_message(channel, message)– Post a message to a specific Slack channel.create_calendar_event(details)– Create and schedule an event in a calendar.execute_sql_query(sql)– Run a SQL query against a specified database.
How Tools Work
An MCP server advertises a set of available tools, each described in a structured format. Tool metadata typically includes a unique identifier, a human-readable description of what the tool does, and input parameters defined using JSON Schema.
When the AI model decides that a tool should be invoked, it sends a call_tool request containing the tool name and the required parameters. The MCP server then executes the tool’s logic and returns either the output or an error message.
Why Tools Matter
Tools turn what a model decides into action in real systems. They let AI work with live data and systems. They automate backend operations, workflows, and integrations. They let agents respond to external input or services. They extend capabilities without requiring developers to retrain the underlying model.
Best Practices for Implementing Tools
Applying MCP server best practices ensures your integrations are safe and model-friendly.
- Use Clear and Descriptive Naming – Give tools intuitive names and human-readable descriptions that reflect their purpose. This helps models and users understand when and how to use them correctly.
- Define Inputs with JSON Schema – Input parameters must follow strict schema definitions. This helps the model validate data, autocomplete fields, and avoid incorrect usage.
- Provide Realistic Usage Examples – Include concrete examples of how a tool can be used. Models learn patterns and behavior more effectively with demonstrations.
- Implement Error Handling and Input Validation – Validate inputs against expected formats and handle errors gracefully. Avoid assumptions about what the model will send.
- Apply Timeouts and Rate Limiting – Prevent tools from hanging indefinitely or being spammed by setting execution time limits and throttling requests as needed.
- Log All Tool Interactions for Debugging – Maintain detailed logs of when and how tools are used to help with debugging and performance tuning.
- Use Progress Updates for Long Tasks – For time-consuming operations, support intermediate progress updates or asynchronous responses to keep users informed.
Security Considerations
Secure tools prevent misuse and keep the trust of the people relying on them.
- Input Validation – Rigorously enforce schema constraints to prevent malformed requests. Sanitize all inputs, especially commands, file paths, and URLs, to avoid injection attacks or unintended behavior. Validate lengths, formats, and ranges for all string and numeric fields.
- Access Control – Authenticate all sensitive tool requests. Apply fine-grained authorization checks based on user roles, privileges, or scopes. Rate-limit usage to deter abuse or accidental overuse of critical services.
- Error Handling – Never expose internal errors or stack traces to the model. These can reveal vulnerabilities. Log all anomalies securely, and ensure that your error-handling logic includes cleanup routines in case of failures or crashes.
Testing Tools: Ensuring Reliability and Resilience
Testing checks that tools work as expected and do not add vulnerabilities.
- Functional Testing – Verify that each tool performs its expected function correctly using both valid and invalid inputs. Cover edge cases and validate outputs against expected results.
- Integration Testing – Test the entire flow between model, MCP server, and backend systems to ensure smooth end-to-end interactions, including latency, data handling, and response formats.
- Security Testing – Simulate potential attack vectors like injection, privilege escalation, or unauthorized data access. Ensure proper input sanitization and access controls are in place.
- Performance Testing – Stress-test your tools under simulated load. Validate that tools continue to function reliably under concurrent usage and that timeout policies are enforced appropriately.
2. Resources: Contextualizing AI with Data
What Are Resources?
If Tools are the verbs of the protocol, then Resources are the nouns. They are structured data exposed to the AI system so it can reason about its current environment.
Resources provide context, whether it is a configuration file, user profile, or a live sensor reading. They connect the model’s static knowledge to real-time inputs from outside. By accessing these MCP Resources, the AI knows its current situation and can give more relevant answers.
Unlike Tools, which the AI uses to perform actions, Resources are passively made available to the AI by the host environment. The AI can query or reference them as needed, and many AI workflows depend on them.
Types of Resources
Resources are usually identified by URIs (Uniform Resource Identifiers) and can contain either text or binary content. That covers a wide variety of real-world data types.
Text Resources
Text resources are UTF-8 encoded and well-suited for structured or human-readable data. Common examples include:
- Source code files (e.g.,
file://main.py) - Configuration files (JSON, YAML, or XML used for system or application settings)
- Log files (System, application, or audit logs for diagnostics)
- Plain text documents (Notes, transcripts, instructions)
Binary Resources
Binary resources are base64-encoded to ensure safe and consistent handling of non-textual content. These are used for:
- PDF documents (Contracts, reports, or scanned forms)
- Audio and video files (Voice notes, call recordings, or surveillance footage)
- Images and screenshots (UI captures, camera input, or scanned pages)
- Sensor inputs (Thermal images, biometric data, or other binary telemetry)
Examples of Resources
Below are typical resource identifiers that might be encountered in an integrated environment:
file://document.txt– The contents of a file opened in the application.db://customers/id/123– A specific customer record from a database.user://current/profile– The profile of the active user.device://sensor/temperature– Real-time environmental sensor readings.
Why Resources Matter
- Provide relevant context for the AI to reason effectively and personalize output.
- Connect static model capabilities to real-time data.
- Support tasks that require structured input, such as summarization, analysis, or extraction.
- Improve accuracy and responsiveness by grounding the AI in current data rather than relying solely on user prompts.
- Give the AI information specific to the application and its environment.
How Resources Work
Resources are passively exposed to the AI by the host application or server, based on the current user context, application state, or interaction flow. The AI does not request them actively. They are made available at the right moment for reference.
For example, while viewing an email, the body of the message might be made available as a resource (e.g., mail://current/message). The AI can then summarize it, identify action items, or generate a relevant response, all without needing the user to paste the content into a prompt.
Keeping data (Resources) separate from actions (Tools) keeps interactions modular and makes AI systems more secure, predictable, and efficient.
Best Practices for Implementing Resources
- Use descriptive URIs that reflect resource type and context clearly (e.g.,
user://current/settings). - Provide metadata and MIME types to help the AI interpret the resource correctly (e.g.,
application/json,image/png). - Support dynamic URI templates for common data structures (e.g.,
db://users/{id}/orders). - Cache static or frequently accessed resources to minimize latency and avoid redundant processing.
- Implement pagination or real-time subscriptions for large or streaming datasets.
- Return clear, structured errors and retry suggestions for inaccessible or malformed resources.
Security Considerations
- Validate resource URIs before access to prevent injection or tampering.
- Block directory traversal and URI spoofing through strict path sanitization.
- Enforce access controls and encryption for all sensitive data, particularly in user-facing contexts.
- Minimize unnecessary exposure of sensitive binary data such as identification documents or private media.
- Log and rate-limit access to sensitive or high-volume resources to prevent abuse and ensure compliance.
3. Prompts: Structuring AI Interactions
What Are Prompts?
Prompts are reusable interaction templates, instructions, or interface-integrated commands that guide how users or the AI system interact with tools and resources. Servers expose specific capabilities, including prompts that offer reusable templates.
They are structured inputs that encode best practices, common workflows, and reusable queries. The official Model Context Protocol documentation states that prompts are designed to be user-controlled, meaning they are exposed from servers to clients with the intention of the user being able to explicitly select them for use.
Prompts sit between the user, the AI, and the system’s capabilities. They remove ambiguity, keep usage consistent, and make tasks quicker to run. In a user interface or inside the AI, prompts organize how AI features get triggered in context.
Prompts can take the form of:
- Suggestive query templates
- Interactive input fields with placeholders
- Workflow macros or presets
- Structured commands within an application interface
Prompts turn user intent into structured operations in a way that is transparent, repeatable, and accessible. Examining MCP Tools Resources and Prompts together reveals how they complement one another.
Examples of Prompts
Examples of query templates used in real applications:
- “Show me the {metric} for {product} in the {time_period} region.”
- “Summarize the contents of {resource_uri}.”
- “Create a follow-up task for this email.”
- “Generate a compliance report based on {policy_doc_uri}.”
- “Find anomalies in {log_file} between {start_time} and {end_time}.”
These prompts can be either static templates with editable fields or dynamically generated based on user activity, current context, or exposed resources.
How Prompts Work
Just like tools and resources, prompts are advertised by the server. They are made available to both the user interface and the AI agent, depending on the use case.
In a user interface, prompts provide a structured, pre-filled way for users to interact with AI functionality. Think of them as smart autocomplete or command templates. Within an AI agent, prompts help organize reasoning paths, guide decision-making, or trigger specific workflows in response to user needs or system events.
Prompts often contain placeholders, such as {resource_uri}, {date_range}, or {user_intent}, which are filled dynamically at runtime. These values can be derived from user input, current application context, or metadata from exposed resources.
Why Prompts Are Powerful
Prompts make AI interactions more useful, scalable, and reliable. They make AI easier to start with by giving users ready-made, understandable templates to work with. They accelerate workflows by pre-configuring tasks and minimizing repetitive manual input. They ensure consistent usage of AI capabilities, particularly in team environments or across departments. They provide structure for domain-specific applications, helping AI operate within predefined guardrails or business logic.
Best Practices for Implementing Prompts
- Use clear and descriptive names for each prompt so users can easily understand its function.
- Document required arguments and expected input types (e.g., string, date, URI, number) to ensure consistent usage.
- Build in graceful error handling. If a required value is missing or improperly formatted, provide helpful suggestions or fallback behavior.
- Support versioning and localization to allow prompts to evolve over time and be adapted for different regions or user groups.
- Enable modular composition so prompts can be nested, extended, or chained into larger workflows as needed.
- Continuously test across diverse use cases to ensure prompts work correctly in various scenarios, applications, and data contexts.
Security Considerations
Like any user-facing or dynamic interface element, prompts need careful implementation to stay secure. Developers must sanitize all dynamic arguments to prevent prompt injection attacks or unexpected behavior. Servers should limit the exposure of sensitive resource data or context, particularly when prompts may be visible across shared environments. Apply rate limiting and maintain logs of prompt usage to monitor abuse or performance issues. Guard against spoofing, where malicious actors try to manipulate the AI through crafted inputs. Establish role-based permissions to restrict access to prompts tied to sensitive operations.
Example Use Case
Take a business analytics dashboard integrated with MCP. A prompt such as:
“Generate a sales summary for {region} between {start_date} and {end_date}.”
This template can be presented to the user in the UI, pre-filled with defaults or values pulled from recent activity. Once the user selects the inputs, the AI fetches relevant data via resources (like db://sales/records) and invokes a tool (like a report generator) to compile a summary. The prompt is the layer that ties these components together.
Tools, Resources, and Prompts Together
Tools, Resources, and Prompts are each useful alone, but they do the most together. Combined, they let AI agents carry out real tasks, adapt to user intent, and act with the right context.
Together they let an AI act rather than only answer: it knows how, when, and with what data to run an operation.
How They Work Together: A Layered Interaction Model
To understand this interaction loop, let’s walk through a typical workflow where an AI assistant is helping a business user analyze sales trends.
-
Prompt
The interaction begins with a structured prompt. The user selects: “Show sales for product X in region Y over the last quarter.” This guides the user’s intent and helps the AI parse the request accurately by anchoring it in a known pattern. -
Tool
Behind the scenes, the AI agent uses a predefined tool (e.g.,fetch_sales_data(product, region, date_range)) to carry out the request. Tools encapsulate the logic for specific operations, like querying a database, generating a report, or invoking an external API. -
Resource
The result of the tool’s execution is a resource. It is a structured dataset returned in a standardized format, such as:data://sales/q1_productX.json. This resource is now available to the AI agent for further processing, and may be cached, reused, or referenced in future queries. -
Further Interaction
With the resource in hand, the AI can summarize the findings, visualize the trends using charts or dashboards, compare the current data with historical baselines, or recommend follow-up actions.
This layered model lets the AI act in a controlled way. Tools provide the actionable capabilities. Resources deliver the data context. Prompts shape the user interaction model.
The result is an AI system that is context-aware because it can reference real-time or historical resources, task-oriented because it can invoke tools with well-defined operations, and user-friendly because it engages with prompts that remove guesswork.
Accelerating Enterprise Adoption with Pre-Built Servers
Enterprise adoption of these multi-layered models is growing quickly. According to Gartner, forty percent of enterprise applications will be integrated with task-specific AI agents by 2026, up from less than 5% in 2025. This scale requires standardized approaches rather than custom API wrappers.
Knit supports the protocol to allow AI agents to interact with connected systems without custom integration code. Knit offers over 100 pre-built Model Context Protocol servers that give AI clients code-free, server-less access to SaaS tools.
Knit MCP servers can be deployed to AI clients like Claude, Cursor, and Windsurf, or integrated into custom-built clients. A single Knit MCP server can package tools chosen from one or multiple supported SaaS applications. This means an agent can access HR data and project management tasks through one unified connection.
Built for AI developers
Enterprise MCP servers that implement all three primitives — out of the box.
Knit’s MCP Servers expose HRIS, ATS, and ERP data as Tools, Resources, and Prompts for any MCP-compatible agent — Workday, BambooHR, Greenhouse, NetSuite, and 100+ more. No custom server to build or maintain.
For developers exploring MCP server examples, you can browse 109+ Pre-Built MCP Servers with Managed Auth directly in Knit’s directory. If you are developing chat interfaces, Communication MCP Servers connect agents to Slack and Teams. Scheduling bots can rely on Meeting MCP Servers or specific endpoints like the MS Teams Meeting MCP Server: Setup, Tools and Auth. Connecting these platforms provides Instant MCP Servers for AI Agents, removing the need to manage infrastructure.
You can also use automation platforms to chain these tasks. For example, developers can Build AI Agents in n8n with Knit MCP Servers to orchestrate complex multi-step processes across Salesforce and QuickBooks visually.
Conclusion: Building the Future with MCP
MCP is a design approach for connecting AI to software systems, as well as a communication protocol. By defining Tools, Resources, and Prompts and how they connect, it supports AI systems that are modular and composable. Components can be independently built, reused, and orchestrated into workflows.
The framework is secure by design. Access, execution, and data handling can be governed with fine-grained policies. It is contextual: interactions are grounded in live data and operational context, reducing hallucinations and misfires. Finally, it aligns behavior with operations. AI follows best practices and reflects real business processes and domain knowledge.
Next Steps:
See how these components are used in practice:
- MCP Client & Server Architecture Explained
- Scaling AI Capabilities with Multiple MCP Servers
- How to Integrate AI Tools with MCP: Complete Guide
- MCP vs API: What’s the Difference for AI Agents?
- MCP Agent Orchestration: Chaining & Multi-Agent Patterns
- Getting Started with MCP: Simple Single-Server Integrations
- Orchestrating Complex AI Workflows
Frequently Asked Questions
1. What is MCP architecture?
MCP (Model Context Protocol) architecture is the client-server framework that defines how AI models connect to external data sources and tools. An MCP host (the AI application – e.g., Claude Desktop or a custom agent) connects to one or more MCP servers via a standardized protocol. Each MCP server exposes three types of capabilities: tools (functions the AI can call to take actions), resources (data the AI can read for context), and prompts (reusable templates that structure how the AI interacts with that server). The protocol handles capability discovery, request/response formatting, and transport. Any compatible client can connect to any compatible server without custom wiring. Knit offers MCP servers that make enterprise data accessible to any compatible AI agent.
2. What is the difference between MCP tools, resources, and prompts?
Tools execute actions (verbs), resources provide context data (nouns), and prompts guide interactions (grammar). Tools are executable functions. The AI calls a tool to take an action (run a query, write a record, call an API). They are model-controlled: the AI decides when to call them based on the task. Resources are read-only data sources. The AI reads from a resource to get context (a file, a database record, a knowledge base). They are application-controlled: the host decides when to surface them. Prompts are reusable interaction templates. They are pre-defined workflows or instruction structures that guide how the AI should use the server’s tools and resources for a given task. They are user-controlled: exposed to the user as selectable options rather than triggered autonomously by the model.
3. What is the difference between MCP and a regular API?
MCP adds a dynamic discovery and standardization layer on top of regular APIs so AI agents can automatically inspect capabilities without hardcoded integration logic. With a regular API, that logic is bespoke per API. With MCP, a client can connect to any server and automatically discover what tools, resources, and prompts it exposes, without prior knowledge of the server’s implementation. For AI agents specifically, this matters because the model can reason about which tools to call based on their descriptions, rather than being hard-coded to call specific endpoints. In effect, it makes APIs self-describing and AI-native.
4. How does MCP client-server architecture work?
In this client-server architecture, the host (an AI application like Claude or a custom agent framework) contains a client that manages connections to one or more servers. Each server runs as a separate process and exposes its capabilities (tools, resources, prompts). When an AI agent needs to take an action or access data, the client sends a request to the appropriate server using JSON-RPC over the configured transport (stdio for local servers, HTTP/SSE for remote). The server executes the request and returns a structured response. This separation means servers can be built, deployed, and updated independently of the AI application.
5. How do Tools and Resources complement each other in MCP?
Tools perform actions (e.g., querying a database), while Resources provide the data context (e.g., the query result). Together they enable workflows that are both action-driven and data-grounded.
6. What’s the difference between invoking a Tool and referencing a Resource?
Invoking a Tool is an active request (using tools/call), while referencing a Resource is passive. The AI can access it when made available without explicitly requesting execution.
7. Why are JSON Schemas critical for Tool inputs?
Schemas prevent misuse by enforcing strict formats, ensuring the AI provides valid parameters, and reducing the risk of injection or malformed requests.
8. How can binary Resources (like images or PDFs) be used effectively?
Binary Resources, encoded in base64, can be referenced for tasks like summarizing a report, extracting data from a PDF, or analyzing image inputs.
9. What safeguards are needed when exposing Resources to AI agents?
Developers should sanitize URIs, apply access controls, and minimize exposure of sensitive binary data to prevent leakage or unauthorized access.
10. How do Prompts reduce ambiguity in AI interactions?
Prompts provide structured templates (with placeholders like {resource_uri}), guiding the AI’s reasoning and ensuring consistent execution across workflows.
11. Can Prompts dynamically adapt based on available Resources?
Yes. Prompts can auto-populate fields with context (e.g., a current email body or log file), making AI responses more relevant and personalized.
12. What testing strategies apply specifically to Tools?
Alongside functional testing, Tools require integration tests with servers and backend systems to validate latency, schema handling, and error resilience.
13. How do Tools, Resources, and Prompts work together in a layered workflow?
A Prompt structures intent, a Tool executes the operation, and a Resource provides or captures the data. Together they form a modular interaction loop.
14. What’s an example of misuse if these elements aren’t implemented carefully?
Without input validation, a Tool could execute a harmful command. Without URI checks, a Resource might expose sensitive files. Without guardrails, Prompts could be manipulated to trigger unsafe operations.