JSONPlaceholder MCP Server
Provides access to JSONPlaceholder's free fake REST API for testing and prototyping, enabling interaction with sample posts, users, comments, albums, photos, and todos through tools, resources, and prompts.
README
JSONPlaceholder MCP Server
A modern Model Context Protocol (MCP) server built with FastMCP that provides access to the JSONPlaceholder API - a free fake REST API for testing and prototyping.
Features
This MCP server provides Resources, Tools, and Prompts for interacting with JSONPlaceholder:
🔧 Tools (Actions)
- get_posts - Retrieve all posts or a specific post by ID
- get_users - Retrieve all users or a specific user by ID
- get_comments - Retrieve comments, optionally filtered by post ID
- get_albums - Retrieve albums, optionally filtered by user ID
- get_photos - Retrieve photos, optionally filtered by album ID
- get_todos - Retrieve todos, optionally filtered by user ID
- create_post - Create a new post (simulated)
- search_posts - Search posts by title or body content
📄 Resources (Data Access)
- posts://all - Get all posts as a resource
- posts://{post_id} - Get a specific post as a resource
- users://all - Get all users as a resource
- users://{user_id} - Get a specific user as a resource
📝 Prompts (Templates)
- analyze_post - Generate analysis prompt for a specific post
- user_profile_summary - Create comprehensive user profile analysis
How to add it to cursor:
"mcpServers": {
"jsonplaceholder": {
"command": "/Users/danielpopa/Projects/work/mcp-server/cursor_runner.sh",
"args": []
}
}
}
Prerequisites
- Python 3.10+
- uv package manager
Installation
- Clone or download this project
- The project is already configured with uv. Simply run:
uv sync
Development & Testing
MCP Inspector (recommended for development):
uv run mcp dev server.py
This opens an interactive web interface to test all tools, resources, and prompts.
Direct server execution:
uv run python server.py
Test API connectivity:
uv run python test_server.py
Claude Desktop Integration
Install directly into Claude Desktop:
uv run mcp install server.py --name "JSONPlaceholder API"
Usage Examples
Once connected to an MCP client, you can:
Use Tools:
- "Get all posts from JSONPlaceholder"
- "Show me user details for user ID 1"
- "Search for posts containing 'dolor'"
- "Create a new post titled 'Test' with body 'Hello World' for user 1"
Access Resources:
- The client can load
posts://allto get all posts as context - Load
users://5to get user 5's details as background information
Use Prompts:
- Use the "analyze_post" prompt with post ID 1 for detailed post analysis
- Use "user_profile_summary" with user ID 2 for comprehensive user profiling
API Information
This server uses the JSONPlaceholder API (https://jsonplaceholder.typicode.com/), which provides:
- 100 posts
- 10 users
- 500 comments
- 100 albums
- 5000 photos
- 200 todos
No API key is required as it's completely free and public.
Architecture
Built with FastMCP, this server demonstrates modern MCP patterns:
- Decorator-based setup - Clean, Pythonic code
- Type hints - Better development experience
- Async/await - Efficient HTTP requests
- Resource management - Proper data exposure to LLMs
- Prompt templates - Reusable interaction patterns
- Development tools - Built-in testing and debugging
Development
The server uses:
- FastMCP - Modern MCP server framework
- httpx - Async HTTP client
- Python 3.10+ - Modern Python features
- uv - Fast Python package management
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。