Module 3: MCP Primitives - Resources, Prompts & Tools
Explore core MCP objects: register prompts templates, construct read-only resources schemes, and build schemas for execution tools.
MCP Resources
Why this matters
MCP Resources: Resources let apps inject read-only context the model should see but not invoke.
Resources are read-only context endpoints the application can attach — file URIs, log tails, database snapshots. The model does not invoke them directly; the host decides when to fetch.
- URI scheme identifies data (
file://, customdb://). - Good for grounding: docs, schemas, ticket details.
- Not a substitute for tools — resources do not mutate state.
Common mistakes
- Confusing host with server (the host runs the client; the server is a separate process).
- Hard-coding API keys inside tool implementations instead of env vars.
- Using SSE locally when stdio is simpler and more secure.
Interview checkpoints
- Q: What is mcp resources in MCP? A: One-sentence definition + when it runs in the lifecycle.
- Q: One production pitfall? A: Name transport, auth, or schema mismatch.
Practice
- Basic: Sketch MCP Resources on a whiteboard.
- Intermediate: Find it in a real Claude Desktop or Cursor config.
- Advanced: Break it on purpose and document the error message.
Recap
- You can explain mcp resources clearly.
- You know host vs client vs server roles.
- You see how this connects to the next part.
Next: Tools and Schemas
Tools, Prompts & JSON Schemas
Why this matters
Tools and Schemas: Tools are model-invoked functions; prompts are user-invoked templates — confusing them breaks UX.
Tools are callable functions the model may invoke. Each tool declares a name, description, and JSON Schema for parameters.
{
"name": "search_repo",
"description": "Search GitHub issues",
"inputSchema": {
"type": "object",
"properties": {
"query": { "type": "string" }
},
"required": ["query"]
}
}Prompts are user-invoked templates (slash commands) with parameters — useful for canned workflows, not model-discretion calls.
Common mistakes
- Confusing host with server (the host runs the client; the server is a separate process).
- Hard-coding API keys inside tool implementations instead of env vars.
- Using SSE locally when stdio is simpler and more secure.
Interview checkpoints
- Q: What is tools and schemas in MCP? A: One-sentence definition + when it runs in the lifecycle.
- Q: One production pitfall? A: Name transport, auth, or schema mismatch.
Practice
- Basic: Sketch Tools and Schemas on a whiteboard.
- Intermediate: Find it in a real Claude Desktop or Cursor config.
- Advanced: Break it on purpose and document the error message.
Recap
- You can explain tools and schemas clearly.
- You know host vs client vs server roles.
- You see how this connects to the next part.
Next: Handshake
