FastMCP Prompts Example
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@FastMCP Prompts Exampleresearch prompt on quantum computing"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
š§© FastMCP Prompts Example
A small, focused tutorial showing how to build MCP prompts with FastMCP ā reusable, parameterized message templates that any MCP client (Claude Desktop, IDEs, custom agents) can discover and render.
š Perfect as a first step into the Model Context Protocol before diving into tools and resources.
š What are MCP prompts?
While MCP tools let a model do things and resources let it read things, prompts are user-controlled templates: the client lists them, fills in their arguments, and injects the rendered messages into the conversation. Think of them as slash commands for LLMs.
Related MCP server: MCP Server Template
⨠What this example covers
main.py demonstrates the three patterns you'll use most, from simplest to most powerful:
# | Prompt | Pattern | Concept demonstrated |
1 |
| Return a plain | Simplest form ā auto-wrapped in a single |
2 |
| Optional + constrained args |
|
3 |
| Return | Seed a full multi-turn conversation (user + assistant messages) |
Along the way you'll also see: naming, descriptions, tags, and server instructions.
š Quickstart
Prerequisites: Python 3.12+ and uv.
# 1. Clone and enter the project
git clone https://github.com/mohamedelamraoui1/fastMCP-2-0-example.git
cd fastMCP-2-0-example
# 2. Install dependencies
uv sync
# 3. Run the server (stdio transport)
uv run main.pyIf everything is set up correctly, you'll see the FastMCP banner and the server waiting for a client on stdio:

š Test with the MCP Inspector
The fastest way to explore the prompts is the MCP Inspector ā a web UI for poking at any MCP server. It requires Node.js (the Inspector is an npm package that FastMCP launches for you).
Step 1 ā Launch the Inspector:
uv run fastmcp dev inspector main.pyYou'll see output like this, and your browser opens automatically:
š MCP Inspector is up and running at:
http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=<session-token>
āļø Proxy server listening on localhost:6277If the browser doesn't open, copy the full URL (including the token) from the terminal.
Step 2 ā Connect to the server. The connection form is pre-filled (transport STDIO, command fastmcp run main.py). Just click Connect ā the indicator turns green when the handshake succeeds.
Step 3 ā List the prompts. Open the Prompts tab and click List Prompts. You should see all three: research_prompt, summarize_prompt, and code_review_prompt, each with its description.
Step 4 ā Render a prompt. Click a prompt, fill in its arguments in the form (e.g. topic = "quantum computing" for research_prompt), and click Get Prompt. The right panel shows the exact messages the server returns.
Step 5 ā See the interesting cases:
On
summarize_prompt, notice thelengthandtonefields only accept theLiteralvalues from the type hints ā that's the argument schema in action.On
code_review_prompt, paste any snippet ascodeand notice the result is three messages (userāassistantāuser), not one ā a pre-seeded conversation.
When you're done, stop the Inspector with Ctrl+C in the terminal.
š„ļø Use it from Claude Desktop
Add the server to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"prompt-examples": {
"command": "uv",
"args": ["run", "--directory", "C:/absolute/path/to/fastMCP-2-0-example", "main.py"]
}
}
}Restart Claude Desktop, then look for the prompts in the + (attachments) menu.
š” No API key needed. Claude Desktop uses your Claude account, and this MCP server only serves prompt templates ā it never calls an LLM itself. You'd only need an Anthropic API key if you wrote your own client that sends the rendered prompts to the API.
šļø Project structure
.
āāā main.py # The MCP server ā 3 prompt patterns, fully commented
āāā assets/ # Screenshots used in this README
āāā pyproject.toml # Project metadata & dependencies
āāā uv.lock # Locked dependency versions
āāā README.mdš Learn more
FastMCP documentation ā the framework used here
FastMCP: Prompts guide ā deep dive on the prompt API
Model Context Protocol ā the open protocol specification
MCP: Prompts concept ā how clients consume prompts
š ļø Tech stack
Technology | Role |
Language | |
MCP server framework | |
Dependency & environment management |
š License
This project is licensed under the MIT License ā see the LICENSE file for details.
Made with ā¤ļø for the MCP community. Follow @mcoding_off for more tutorials.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAn educational example demonstrating how to build MCP servers in Python using FastMCP, showing how to expose tools, resources, and prompts to AI clients.Last updated
- FlicenseBquality-maintenanceA production-ready FastMCP server template with modular architecture for building MCP servers with organized tools, resources, and prompts, featuring container support and AI agent documentation system.Last updated3
- FlicenseBqualityDmaintenanceA template and demonstration project for building, testing, and deploying remote MCP servers using FastMCP and uv. It provides a foundational structure for creating MCP-compliant tools that can be hosted publicly and integrated with LLM agents.Last updated2
- Alicense-qualityCmaintenanceA production-ready template for developing MCP servers with Python and FastMCP, including example tools like a multiply calculator and code review prompt generator.Last updatedApache 2.0
Related MCP Connectors
MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.
65+ AI tools as MCP: research, write, code, scrape, translate, RAG, agent memory, workflows
AI code review for GitHub PRs with an MCP autofix loop for Claude Code and Cursor
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mohamedelamraoui1/mcp-prompts-tutorial'
If you have feedback or need assistance with the MCP directory API, please join our Discord server