home / mcp / simple mcp server
I created this MCP using Fast MCP
Configuration
View docs{
"mcpServers": {
"haris-khan-dev-mcp-server": {
"url": "http://localhost:8000"
}
}
}You can run a lightweight MCP server that exposes a FastAPI-based application as MCP tools. This lets you query health, user and task data, roll dice, and retrieve statistics through a uniform MCP interface while your FastAPI app handles the core REST endpoints.
Connect an MCP client to the HTTP MCP endpoint to discover and call the available tools. You can perform health checks, fetch application info, manage users and tasks, roll dice, and retrieve statistics through the MCP tools exposed by the server. The MCP layer maps each tool to a corresponding FastAPI endpoint so you can orchestrate actions from your MCP client without directly calling REST routes.
Prerequisites you need before installing anything:
Python 3.8+Install core Python dependencies for the project.
pip install fastapi uvicorn aiohttp google-generativeai python-dotenv requestsOptionally set up a Gemini API key (demo works in simulation mode). Create a .env file and add GEMINI_API_KEY.
GEMINI_API_KEY=your_actual_api_key_hereStart the FastAPI server to expose the REST endpoints.
python app.pyIf you want to run the Gemini integration and MCP bridge components, you can execute the provided scripts when ready.
python simple_gemini_integration.py
```
```
python start_simple_demo.pyConfiguration and usage details follow the key elements shown here. The MCP server connects to the FastAPI runtime at a specific URL, and you can adjust the base URL if you run the FastAPI app on a different host or port.
MCP tools exposed by the Simple MCP Server include a broad set of capabilities that map to FastAPI endpoints. These tools are designed to be called from your MCP client to perform common actions without touching REST calls directly.
Tool list included in this setup covers health status, application info, user and task management, dice rolling, and statistics retrieval. Each tool is described in detail in the next section.
If you are integrating with Gemini, configure the integration to point to the MCP server URL and ensure the environment is ready for API calls. The Gemini integration script assumes the MCP server is running and reachable at the configured base URL.
FastAPI server settings you can adjust include host and port. The default is port 8000 on all interfaces, but you can modify the startup command or environment to bind elsewhere.
If you encounter connection issues to the MCP server, verify that the FastAPI server is running and the MCP URL in your client matches the runtime URL.
Common issues to check include missing API keys for Gemini, Python dependencies, and network access between the MCP client and the FastAPI server.
The system is designed to expose a compact set of MCP tools that directly map to the underlying REST endpoints. You can expand the tool set by adding new endpoints to FastAPI and updating the MCP bridge to expose corresponding tools.
Check application health and responsiveness via the MCP bridge.
Retrieve basic information about the FastAPI application.
Fetch all users from the application.
Create a new user with name, email, and age parameters.
Retrieve a specific user by their ID.
Retrieve all tasks stored in the application.
Create a new task with title and description.
Mark a task as completed.
Roll a number of dice with a given number of sides.
Get aggregated statistics for the application.
Search users by name fragment.
List tasks that are not yet completed.
List tasks that are completed.