home / mcp / simple mcp server

Simple MCP Server

I created this MCP using Fast MCP

Installation
Add the following to your MCP client configuration file.

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.

How to use

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.

How to install

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 requests

Optionally 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_here

Start the FastAPI server to expose the REST endpoints.

python app.py

If 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.py

Additional sections

Configuration 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.

Configuration and troubleshooting

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.

Notes

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.

Available tools

get_health_status

Check application health and responsiveness via the MCP bridge.

get_app_info

Retrieve basic information about the FastAPI application.

get_all_users

Fetch all users from the application.

create_user

Create a new user with name, email, and age parameters.

get_user_by_id

Retrieve a specific user by their ID.

get_all_tasks

Retrieve all tasks stored in the application.

create_task

Create a new task with title and description.

complete_task

Mark a task as completed.

roll_dice

Roll a number of dice with a given number of sides.

get_app_statistics

Get aggregated statistics for the application.

search_users_by_name

Search users by name fragment.

get_pending_tasks

List tasks that are not yet completed.

get_completed_tasks

List tasks that are completed.