Rishabh Kataria

Build an MCP server with FastMCP

By Rishabh Kataria ·

The Model Context Protocol (MCP) is an open standard that lets an AI assistant call tools you write, such as reading a file, listing processes or querying a database. An MCP server is a small program that describes those tools and runs them when the model asks. F.R.I.D.A.Y uses a custom MCP server to control a Windows desktop.

Install

pip install fastmcp

A first server

# server.py
from pathlib import Path
from fastmcp import FastMCP

mcp = FastMCP("Desk tools")

NOTES = Path.home() / "Notes"

@mcp.tool()
def list_notes() -> list[str]:
    """List the note files in the Notes folder."""
    return sorted(p.name for p in NOTES.glob("*.md"))

@mcp.tool()
def read_note(name: str) -> str:
    """Read one note by file name, for example 'ideas.md'."""
    path = (NOTES / name).resolve()
    if path.parent != NOTES.resolve():
        raise ValueError("Only files directly inside the Notes folder can be read")
    return path.read_text(encoding="utf-8")

if __name__ == "__main__":
    mcp.run()

FastMCP reads the type hints and docstrings to tell the model what each tool does and what arguments it takes, so write them clearly: they are the model's instructions.

Connect it to Claude Desktop

Add the server to Claude Desktop's claude_desktop_config.json and restart the app:

{
  "mcpServers": {
    "desk-tools": {
      "command": "python",
      "args": ["C:/path/to/server.py"]
    }
  }
}

By default mcp.run() talks over standard input and output, which is how desktop apps launch local servers.

Keep it safe

An MCP tool runs with your permissions, so treat every model request as untrusted input:

Going further

F.R.I.D.A.Y adds tools for processes, terminal commands and keyboard macros, pairs the server with LiveKit for real-time voice, and stores long-term memory in ChromaDB so the assistant remembers past sessions.