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 💡
stitch-ai-mcp
MCP server implementation for Stitch AI's memory management system, providing tools for creating, retrieving, and managing AI agent memories.
mcp-naver
A server implementation for Naver OpenAPI using the Model Context Protocol (MCP), providing tools to interact with various Naver services like search, shopping, and more.
graphlit-mcp-server
Model Context Protocol (MCP) Server for Graphlit Platform
azure-wiki-search-server
An MCP server that enables AI agents to search and retrieve content from Azure Wiki.
@abhiz123/todoist-mcp-server
An MCP server that integrates Claude with Todoist, enabling natural language task management for creating, updating, completing, and deleting tasks.
mcp-server-cortex
MCP Server for Cortex allows MCP clients to leverage Cortex analyzers for threat intelligence tasks.