Example MCP Server with image blocks
Overview
An example MCP server that returns a random image from the Lorem Picsum API. This is just an example to show how MCP servers can return image blocks.
See also: Image Content in the Model Context Protocol specification
Usage
Using with VS Code
Add this to your settings JSON file:
{
"mcp": {
"servers": {
"random_image": {
"command": "npx",
"args": [
"-y",
"@larryhudson/mcp-server-example-image-block"
],
}
}
}
}
Using with Claude or other MCP-compatible applications
Add this to your MCP configuration JSON file:
{
"mcpServers": {
"random_image": {
"command": "npx",
"args": ["-y", "@larryhudson/mcp-server-example-image-block"],
}
}
}
Available Tools
get_random_image- get a random image using the Lorem Picsum API.
Technical Details
Built with:
- Model Context Protocol (MCP): Framework for allowing AI assistants to interact with external tools
- TypeScript: For type safety and better developer experience
Development
You can use the Model Context Protocol inspector to try out the server:
npx @modelcontextprotocol/inspector npx tsx src/index.ts
License
MIT
Recommend MCP Servers 💡
paper-search
An MCP server that provides a tool for searching and retrieving academic papers from arXiv.
tfmcp
🌍 Terraform Model Context Protocol (MCP) Tool - An experimental CLI tool that enables AI assistants to manage and operate Terraform environments. Supports reading Terraform configurations, analyzing plans, applying configurations, and managing state with Claude Desktop integration. ⚡️
@canva/cli
An AI-powered Model Context Protocol (MCP) server from Canva, designed to provide development assistance for Canva apps and integrations.
@xiaohui-wang/mcpadvisor
A discovery and recommendation service that helps AI assistants find and leverage Model Context Protocol (MCP) servers using natural language queries.
scrapling-fetch-mcp
MCP server that helps AI assistants access text content from bot-protected websites using Scrapling
drand-mcp-server
Provides verifiable randomness from the drand network as an input seed for AI applications via the Model Context Protocol.