0
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill xmcp-dev/skills --skill resource-design- SKILL.md3.7 KB
Overview
This skill helps you design MCP resources for xmcp so LLMs can consume content reliably. It guides you through an interactive info-gathering workflow, then generates a properly routed resource file with metadata, schema (if needed), and a handler.
How this skill works
I first prompt you for key inputs: resource name, type (static, dynamic, or file-based), URI pattern, content details, and whether widget rendering is needed. Based on your answers I create a TypeScript file under src/resources/ using Next.js-style file routing, include optional metadata and zod schema for dynamic parameters, and implement a handler that returns the appropriate content type. I also run through a checklist to ensure routing, metadata, and return types match xmcp expectations.
When to use it
- Creating a simple static resource to expose docs or configuration to LLMs.
- Building a dynamic resource that accepts parameters (e.g., user profiles or reports).
- Wrapping file-based content such as logs or binary assets for LLM access.
- Conforming file layout to xmcp routing conventions for predictable URIs.
- Adding OpenAI widget metadata or other vendor extensions for richer rendering.
Best practices
- Use kebab-case for resource filenames and clear, descriptive names in metadata.
- Prefer explicit mimeType and size in metadata when serving binary or non-text content.
- For dynamic resources, define a zod schema and call .describe() on parameters for clear documentation.
- Place route groups in parentheses to exclude them from the URI and use [param] for dynamic segments.
- Return { text: string } for clear text responses, and use Uint8Array with mimeType for binary blobs.
Example use cases
- Static config: src/resources/(config)/app.ts → config://app with plain text config.
- User profile: src/resources/(users)/[userId]/profile.ts → users://[userId]/profile returning JSON.
- Monthly report: src/resources/reports/[year]/[month]/summary.ts → reports://[year]/[month]/summary generating dynamic summaries.
- File-based logs: src/resources/logs/[fileName].ts reading a log file and returning its contents with correct mimeType.
- Widget-enabled docs: add OpenAI metadata to enable rich rendering of a documentation resource.
FAQ
Use src/resources with route groups in parentheses to exclude segments and [param] for dynamic parts; the filename becomes the final URI segment.
When should I include metadata?
Include metadata when you need a human-readable title, explicit mimeType, size, or vendor-specific extensions; otherwise xmcp uses the filename as the resource name.
How do I validate dynamic parameters?
Define a zod schema exported as schema and call .describe() on each parameter so xmcp and developers understand expected inputs.