Help us improve
Share bugs, ideas, or general feedback.
From mcp-builder
Add a resource to your MCP server for agent context (schemas, templates, reference data)
npx claudepluginhub hollaugo/prompt-circle-marketplaceHow this skill is triggered — by the user, by Claude, or both
Slash command
/mcp-builder:skills/add-resourceThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are helping the user add a resource to their MCP server. Resources provide context that agents can read before calling tools.
Adds static or template resources to existing FastMCP servers via interactive prompts for URI, name, MIME type, parameters, content type, and data source, generating TypeScript code.
Guides MCP server development with tool design, resource endpoints, prompt templates, and transport configuration using the MCP SDK.
Guides building MCP (Model Context Protocol) servers in Python and TypeScript to give Claude new tools, resources, and prompts.
Share bugs, ideas, or general feedback.
You are helping the user add a resource to their MCP server. Resources provide context that agents can read before calling tools.
Resources are data the agent can READ to understand context:
| Use Case | Resource or Tool? |
|---|---|
| Agent needs to read a schema before querying | Resource |
| Agent needs to fetch live data | Tool |
| Agent needs reference documentation | Resource |
| Agent needs to perform an action | Tool |
Ask the user:
Common Resource Types:
| Type | URI Pattern | Example |
|---|---|---|
| Schema | schema://{name} | schema://database |
| Template | template://{name} | template://report |
| Reference | ref://{category}/{name} | ref://api/endpoints |
| Config | config://{name} | config://settings |
Python (FastMCP):
# Static resource
@mcp.resource("schema://database")
def get_database_schema() -> str:
"""Database schema for the task management system.
Read this before querying to understand table structure."""
return """
Tables:
- tasks (id, subject, content_md, status, due_at, assignee_id)
- users (id, email, name, role)
- comments (id, task_id, user_id, content, created_at)
Relationships:
- tasks.assignee_id -> users.id
- comments.task_id -> tasks.id
- comments.user_id -> users.id
"""
# Dynamic resource with template
@mcp.resource("template://task-report")
def get_task_report_template() -> str:
"""Template for generating task status reports."""
return """
# Task Report: {title}
## Summary
- Total Tasks: {total}
- Completed: {completed}
- In Progress: {in_progress}
- Pending: {pending}
## Details
{task_list}
"""
TypeScript (MCP SDK):
server.setRequestHandler(ListResourcesRequestSchema, async () => ({
resources: [
{
uri: "schema://database",
name: "Database Schema",
description: "Task management database structure",
mimeType: "text/plain",
},
],
}));
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
const { uri } = request.params;
if (uri === "schema://database") {
return {
contents: [{
uri,
mimeType: "text/plain",
text: `Tables:\n- tasks (id, subject, status...)\n- users (id, email...)`,
}],
};
}
throw new Error(`Unknown resource: ${uri}`);
});
Add a clear description:
@mcp.resource("schema://database")
def get_database_schema() -> str:
"""Database schema for the task management system.
Read this resource before:
- Building database queries
- Understanding data relationships
- Validating user input
The schema includes tables, columns, types, and relationships.
"""
Resource (Schema):
@mcp.resource("schema://database")
def get_schema() -> str:
"""Returns the database schema for reference."""
return "Tables: tasks, users, comments..."
Tool (Query):
@mcp.tool()
def query_database(sql: str) -> str:
"""Execute a read-only SQL query against the database."""
return db.execute(sql)
Agent Workflow:
schema://database resourcequery_database toolschema://, template://, ref://After adding the resource, update .mcp-builder/state.json:
{
"resources": [
{ "uri": "schema://database", "name": "Database Schema" }
]
}