MCP Resources and Prompts
Expose read-only resources and reusable prompt templates beyond tools.
Why
MCP launched in November 2024; by December 2025 it had 97M+ monthly SDK downloads, and by September 2026 the npm SDK alone reached ~204M monthly downloads (5x growth in 9 months) with 10,000+ published servers. Tools are for actions; resources are for read-only context (schemas, configs) and prompts are reusable templates.
Using all three keeps your server idiomatic: the AI browses resources, calls tools, and instantiates prompts instead of cramming everything into tool descriptions.
When
Add resources when the AI should browse data (table schemas, open tickets). Add prompts for reusable workflows (investigate-incident).
Skip if tools alone cover it.
How
Example
Common Problems
- ⚠Error: Cannot find module '@modelcontextprotocol/sdk' → run `npm install @modelcontextprotocol/sdk zod`; the SDK requires Node.js 18+.
- ⚠"Error: transport closed" / server not listed by client → verify the stdio/HTTP transport matches on both sides; check `npx @modelcontextprotocol/inspector` output.
- ⚠Tool call returns `{"error": "Invalid params"}` → validate the input schema with zod; common cause is missing required field or wrong type.
Best Practices
- ✓Keep resources read-only and small (<4KB).
- ✓Use prompts for multi-step workflows with arguments.
- ✓Measure the outcome with a concrete metric (time saved, defect rate, test coverage) so the practice can be justified and improved.
FAQ
What is MCP Resources and Prompts?
Expose read-only resources and reusable prompt templates beyond tools. It helps developers quickly grasp the core value and use cases of MCP Resources and Prompts.
How do I get started with MCP Resources and Prompts?
To get started with MCP Resources and Prompts, focus on these points first: Resources: uri scheme + handler returning small text/JSON (<4KB).
What are common mistakes with MCP Resources and Prompts?
Common mistakes when using MCP Resources and Prompts include: Error: Cannot find module '@modelcontextprotocol/sdk' → run `npm install @modelcontextprotocol/sdk zod`; the SDK requires Node.js 18+.; "Error: transport closed" / server not listed by client → verify the stdio/HTTP transport matches on both sides; check `npx @modelcontextprotocol/inspector` output.; Tool call returns `{"error": "Invalid params"}` → validate the input schema with zod; common cause is missing required field or wrong type..
What are the best practices for MCP Resources and Prompts?
Best practices for MCP Resources and Prompts include: Keep resources read-only and small (<4KB).; Use prompts for multi-step workflows with arguments.; Measure the outcome with a concrete metric (time saved, defect rate, test coverage) so the practice can be justified and improved..
How do I learn more about MCP Resources and Prompts?
Start with the official docs, then search real-world examples on GitHub. Validate patterns in a small scratch repo before applying them to production code.