prompt-server or using MCP types directly.
Quick Start
Using with_resource()
The simplest way to add resources to a prompt:Using Prompt Helper
For more control over message structure:Supported Media Types
Images
Images
Images can be processed by vision-enabled models:Supported formats: PNG, JPEG, GIF, WebP
Videos
Videos
Process video content with compatible models:
Google’s models support video processing, including YouTube URLs and direct video files.
PDFs
PDFs
PDFs can be processed by supported models:
- Anthropic: Supports text and images from PDFs
- Google: Native PDF support with full content extraction
- OpenAI: PDF content converted to text
MCP Resource Conversion
LLM APIs have different restrictions on content types that can be returned as Tool Call results:OpenAI
- Text
Anthropic
- Text
- Images
- Text
- Images
- PDFs
- Video (up to 20MB inline)
ImageResources and EmbeddedResources are automatically converted to User Messages and added to the conversation.
Advanced Usage
Multi-File Processing
Process multiple files in a single prompt:Interactive Vision Demo
Combine multiple MCP servers for complex workflows:Resource URIs
Resources can be referenced using various URI schemes:Best Practices
Choose the Right Model
Not all models support all media types. Use vision-capable models (e.g., GPT-4 Vision, Claude 3, Gemini) for image/video tasks.
Optimize File Sizes
- Images: Keep under 20MB for best performance
- Videos: Use YouTube URLs for large files
- PDFs: Consider extracting text for very large documents
Troubleshooting
Model doesn't support media type
Model doesn't support media type
Check provider-specific documentation:
- OpenAI: Images only in vision models
- Anthropic: Images and PDFs in Claude 3+
- Google: Full multimodal support in Gemini models
File not found errors
File not found errors
Ensure:
- File paths are correct and accessible
- MCP server is properly configured
- Filesystem server has appropriate permissions
Large file handling
Large file handling
For files exceeding size limits:
- Use external hosting (S3, CDN) with URLs
- Split large documents into chunks
- Use Google’s File API for videos >20MB
Related Topics
Prompts
Learn about MCP Prompts and prompt templates
MCP Servers
Configure servers for resource access
