Overview
This project is a basic implementation of a Model Context Protocol (MCP) server using FastAPI, designed to demonstrate the core concepts of MCP by providing a simple context service.
To use the server, first install the required dependencies and then run the server using Uvicorn. You can interact with the server through its endpoints.
- Basic health check endpoint - Context endpoint that processes prompt templates - Support for parameterized prompts
- Providing context for various prompts in applications.
- Health monitoring of the server.
- Demonstrating the functionality of MCP in a simple setup.
Add to your AI client
Use these steps to connect Simple MCP Server Example in Cursor, Claude, VS Code, and other MCP-compatible apps. The same JSON appears in the Use with menu above for one-click copy.
Cursor
Add this to your .cursor/mcp.json file in your project root, then restart Cursor.
.cursor/mcp.json
{
"mcpServers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}Claude Desktop
Add this server entry to the mcpServers object in your Claude Desktop config, then restart the app.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
{
"mcpServers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}Claude Code
Add this to your project's .mcp.json file. Claude Code will detect it automatically.
.mcp.json (project root)
{
"mcpServers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}VS Code (Copilot)
Add this to your .vscode/mcp.json file. Requires the GitHub Copilot extension with MCP support enabled.
.vscode/mcp.json
{
"servers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}Windsurf
Add this to your Windsurf MCP config file, then restart Windsurf.
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}Cline
Open Cline settings, navigate to MCP Servers, and add this server configuration.
Cline MCP Settings (via UI)
{
"mcpServers": {
"dabouelhassan-mcp-server-example-v2-mcp-mirror": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-dabouelhassan-mcp-server-example-v2-mcp-mirror"
]
}
}
}FAQ
What is the purpose of the health check endpoint?
The health check endpoint is used to verify that the server is running and responsive.
How can I send a request to the context endpoint?
You can send a POST request to the /context endpoint with the required parameters in JSON format.
Is this server suitable for production use?
This example is primarily for educational purposes and may require additional features and security measures for production use.