Tutorial: Build a MCP Server with FastMCP
My Obsidian MCP Server project

Overview
FastMCP (Github Repo) is the standard framework for building Model Context Protocol applications with Python. With FastMCP, you don’t need to deal with protocol details. You can just decorate MCP Primitives with annotations for most use cases.
The central piece of a FastMCP application is the FastMCP server class. This class acts as the main container for your application’s tools, resources, and prompts, and manages communication with MCP clients.
from fastmcp import FastMCP
# Create a basic server instance
mcp = FastMCP(name="MyAssistantServer")
# You can also add instructions for how to interact with the server
mcp_with_instructions = FastMCP(
name="HelpfulAssistant",
instructions="""
This server provides data analysis tools.
Call get_average() to analyze numerical data.
""",
)List of all Constructor Parameters can be found here
Tips
FastMCP Docs via MCP
The FastMCP docs are accessible via MCP! The server URL is https://gofastmcp.com/mcp
import asyncio
from fastmcp import Client
async def main():
async with Client("https://gofastmcp.com/mcp") as client:
result = await client.call_tool(
name="SearchFastMcp",
arguments={"query": "deploy a FastMCP server"}
)
print(result)
asyncio.run(main())The docs are also available in llms.txt format:
- llms.txt - A sitemap listing all documentation pages
- llms-full.txt - The entire documentation in one file (may exceed context windows)
Any page can be accessed as markdown by appending .md to the URL.
For example: https://gofastmcp.com/getting-started/welcome.md.