MCPServer (FastMCP)

MCPServer (FastMCP)

A minimal Model Context Protocol server built with FastMCP that provides basic utility tools including user greetings, number addition, and file listing operations. Includes examples of exposing tools, resources, and prompts for MCP-aware clients.

Category
Visit Server

README

MCPServer (FastMCP) – Ubuntu Setup and GitHub Guide

This repository contains a minimal Model Context Protocol (MCP) server built with FastMCP from the mcp package. It exposes:

  • Tools: greet_user(name), add_numbers(a,b), list_files(directory) in server.py
  • Example server with resources and prompts in main.py (add, greeting://{name}, and greet_user prompt)

The project is configured with a pyproject.toml that depends on mcp[cli] and includes an optional mcp_settings.json for MCP-aware clients.

Requirements

  • Ubuntu (tested on 22.04+)
  • Python 3.12+
  • Git

Optional:

  • uv for faster Python dependency management (you can also use pip)

Quickstart (Ubuntu)

  1. Install system prerequisites
sudo apt update
sudo apt install -y python3.12 python3.12-venv git
  1. Create and activate a virtual environment
python3.12 -m venv venv
source venv/bin/activate

3a) Install dependencies with pip

pip install --upgrade pip
pip install "mcp[cli]>=1.25.0"

3b) Or install with uv (optional)

curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv venv
source venv/bin/activate
uv pip install "mcp[cli]>=1.25.0"

Running the server

You have two entry points. Pick the one that matches your use case.

  1. Minimal tool server (server.py)
source venv/bin/activate
python server.py

This exposes tools:

  • greet_user(name: str) -> str
  • add_numbers(a: int, b: int) -> int
  • list_files(directory: str = ".") -> str
  1. Example server with resources and prompts (main.py)
source venv/bin/activate
python main.py

This exposes:

  • Tool: add(a: int, b: int)
  • Resource: greeting://{name}
  • Prompt: greet_user(name: str, style: str = "friendly")

The example runs with transport="streamable-http" (see main.py).

MCP client settings (optional)

If your MCP client supports a settings file (e.g., Windsurf, IDEs), you can point it to your server via mcp_settings.json:

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "/absolute/path/to/your/project/venv/bin/python",
      "args": [
        "/absolute/path/to/your/project/server.py"
      ]
    }
  }
}

Note: In this repo, mcp_settings.json is configured with an absolute path under this user's home directory. You should update the paths to match your machine if you use it locally.

Project layout

  • server.py – Minimal FastMCP server exposing three tools
  • main.py – Demo FastMCP server with a tool, a resource, and a prompt
  • pyproject.toml – Project metadata and dependency on mcp[cli]
  • mcp_settings.json – Example MCP client configuration (absolute paths; edit for your machine)
  • .gitignore – Ignores venv/ and build artifacts

Development tips

  • Keep your virtual environment out of Git: .gitignore already excludes .venv and venv/.
  • When moving the project to another machine, recreate the venv and install mcp[cli].
  • If you want to package this repo later, consider adding a proper module and entry points in pyproject.toml.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured