# MCP Explained: Tools, Resources, Prompts, and Protocol Compatibility

**Harness Engineering · Module 6 of 16**

> **Start here:** know what a tool request and result are. No server installation is required.
>
> **Your goal:** design a policy integration and identify the version assumptions before implementing it.

Our policy assistant could call a Python function directly. Another application might need the same policy operation through a remote service. Model Context Protocol, or MCP, standardizes communication between AI applications and external capabilities. It does not decide the application's goal, choose its model, or supply its entire authorization policy.

The most expensive integration mistake is often mixing two individually reasonable examples from different protocol generations. This article separates the stable concepts from version-specific message flow.

![A host coordinates model interaction while separate MCP clients connect it to policy and research servers.](https://cdn.hashnode.com/uploads/covers/5fb3b801b589f1618af9d143/4a6ab9f2-c21e-4f19-8219-0d164e8ce670.png align="center")

*The server exposes capabilities. The host remains responsible for how they participate in the user's task.*

## 1\. Place the components correctly

| Component | Responsibility | Policy example |
| --- | --- | --- |
| Host | Coordinates the user experience and model interaction | Support-assistant application |
| Client | Connects the host to an MCP server | Policy-service connector |
| Server | Exposes capabilities and enforces its access rules | Authorized policy service |
| Underlying source | Holds application data | Versioned policy store |

A host may use several clients for different servers. The model does not directly acquire every capability just because a server is reachable. The host selects what to expose, and the server must enforce actual access.

## 2\. Distinguish the server primitives

**Tools** perform operations. `lookup_policy` reads a policy by ID. **Resources** supply contextual data, such as an identified policy document. **Prompts** provide reusable interaction templates, such as a source-based answer format.

A tool can be read-only or consequential. The word “tool” says nothing by itself about whether it can send messages or change records. Discovery metadata describes capabilities; it is not permission to use everything listed.

Here is a simplified teaching contract, not a complete protocol request:

```json
{
  "name": "lookup_policy",
  "description": "Read one policy available to the authenticated caller",
  "inputSchema": {
    "type": "object",
    "properties": {"policy_id": {"type": "string"}},
    "required": ["policy_id"],
    "additionalProperties": false
  }
}
```

Return source identity, version, relevant text, and an explicit outcome. Distinguish an unavailable service from an available service that has no matching policy. Preserve content types and errors rather than converting every result into an unlabelled string.

## 3\. Pin the protocol before drawing the sequence

The [2026-07-28 specification](https://modelcontextprotocol.io/specification/2026-07-28), checked for this draft, describes stateless, self-contained requests and per-request capability negotiation. Earlier course material commonly begins with an initialization lifecycle and session-level negotiation. Do not combine those flows in one implementation.

| Question | Record before coding |
| --- | --- |
| Which protocol revision? | Exact supported revision on both sides |
| Which client and server SDKs? | Installed versions and supported features |
| How are capabilities communicated? | The selected revision's discovery and metadata rules |
| Which transport? | Local stdio or supported remote HTTP behavior |
| Which optional features? | Explicitly supported extensions and fallbacks |

In the 2026-07-28 architecture, clients declare capabilities on each request and servers advertise capabilities through `server/discover`. Current guidance also deprecates sampling and protocol logging. Older sampling lessons remain useful for understanding server-requested model work through a client, but they are not a reason to implement a deprecated feature in a new integration. Consult the [versioned architecture](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture) for the chosen flow.

An existing working client may support a different revision. Establish compatibility first; a version note is not an instruction to migrate blindly.

## 4\. Keep transport and workflow state separate

Local stdio connects a host to a child process. Protocol output must remain parseable; diagnostic logs do not belong in its stdout message stream. Remote HTTP introduces network authentication, routing, and timeout behavior. Legacy HTTP/SSE examples should not be assumed interchangeable with newer designs.

Stateless protocol requests do not mean your business process has no state. A pending approval, an indexing job, and a document version still need application records. A server process's temporary memory also is not durable recovery.

Requests and results need identifiers so concurrent completions remain associated. Notifications may report progress without carrying the same request/result semantics. A 25% progress event does not prove a job completed. Cancellation may stop future work while leaving earlier external effects intact.

## 5\. Draw a complete permitted interaction

For a read-only policy lookup:

1. The host establishes caller context and selects the compatible server.
2. It discovers or verifies the needed capability using the supported revision.
3. The model proposes `lookup_policy` with a policy ID.
4. The host validates the request; the server enforces caller-specific source access.
5. The server returns a source-labelled policy or an explicit failure.
6. The host associates the result with the call and supplies the observation to the model.
7. The model drafts; the application displays the draft without sending it.

Roots or directory announcements are scope information, not filesystem isolation. Actual process permissions, resolved-path checks, and sandbox configuration determine access. Likewise, a read-only description is not a substitute for a server that only implements permitted reads.

## 6\. Diagnose the first broken contract

| Symptom | Evidence to inspect |
| --- | --- |
| Tool missing | Discovery response and supported capabilities |
| Call rejected | Arguments, caller identity, and sanitized error |
| Old demonstration fails | Protocol and SDK version record |
| Wrong result attached | Request/result IDs and event order |
| Job duplicated after timeout | Stable operation ID and existing job receipt |
| Data from another tenant | Authorization before returning source content |

Do not broaden permissions merely to make an integration test pass. A capability can be healthy and still unavailable to a particular caller.

## 7\. Follow along

Specify one policy tool, one policy resource, and one drafting prompt. Draw success, missing-policy, and server-unavailable paths. Include a compatibility table for the exact revision assumed by your diagram.

Then simulate a long indexing job with a progress event, interruption, status lookup, and final completion. **Expected behavior:** the existing job is identified before starting another; progress and completion remain distinct; no document content is returned without access checks.

## Further reading

- [MCP specification, 2026-07-28](https://modelcontextprotocol.io/specification/2026-07-28) — revision-specific requirements.
- [MCP architecture](https://modelcontextprotocol.io/docs/2026-07-28/learn/architecture) — current component and lifecycle guidance.
- [Hugging Face MCP fundamentals](https://huggingface.co/learn/mcp-course/unit1/introduction) — beginner course framing; check its revision assumptions.

## Next module

**[Stateful workflows](https://blog.sant.sh/stateful-workflows-and-review):** add routing, checkpoints, and human review without losing track of completed work.
