Hello, I'm Shrijith Venkatramana. I'm building git-lrc, an AI code reviewer that runs on every commit. (configurable). You now have a live MCP endpoint with automatic schema generation from type hints and docstrings.
Exploring Your Server: Tools, Resources, and Prompts
FastMCP supports three core primitives.
Tools — Executable functions the LLM can call.
Resources — Readable data (static or dynamic) the LLM can fetch.
Prompts — Reusable prompt templates with parameters.
Add these to the same file:
from typing import List, Dict
import datetime
# Dynamic resource example
@mcp.resource("resource://time/now")
def current_time() -> str:
"""Return current UTC time as ISO string."""
return datetime.datetime.now(datetime.timezone.utc).isoformat()
# List resource
@mcp.resource("resource://users")
def list_users() -> List[Dict]:
"""Return a list of sample users. In production, query your DB here."""
return [
{"id": 1, "name": "Alice", "role": "engineer"},
{"id": 2, "name": "Bob", "role": "designer"}
]
# Prompt template
@mcp.prompt
def research_topic(topic: str, depth: str = "medium") -> str:
"""Generate a structured research prompt."""
return f"""
Research {topic} at {depth} depth.
1. Use available tools to gather latest information.
2. Summarize key findings.
3. List open questions.
"""
These are automatically discoverable. Resources are great for live data (JIRA tickets, GitHub issues, database views) without forcing the LLM to call a tool every time.
Connecting Clients and Testing Locally
FastMCP includes a rich client library. Create client.py:
import asyncio
from fastmcp import Client
async def main():
async with Client("http://localhost:8000") as client: # Adjust URL/port
# List capabilities
tools = await client.list_tools()
print("Available tools:", [t.name for t in tools])
# Call a tool
result = await client.call_tool("add", {"a": 15, "b": 27})
print("15 + 27 =", result)
# Read a resource
time_data = await client.read_resource("resource://time/now")
print("Current time:", time_data)
asyncio.run(main())
For local development with interactive UIs, use the built-in dev server (more on that below).
Building Interactive Apps Inside the Conversation
One of FastMCP’s most powerful features is Apps — tools that return rich, interactive UIs rendered directly in the host’s conversation.
Mark a tool with app=True and return Prefab components (or custom HTML).
Example dashboard.py:
from fastmcp import FastMCP
from prefab import Column, Header, Chart, DataTable, Button, CallTool # Prefab components
mcp = FastMCP("sales-demo")
def fetch_sales_data(region: str):
# Simulate or query real data
return [
{"month": "Jan", "revenue": 12000},
{"month": "Feb", "revenue": 15000},
# ...
]
@mcp.tool(app=True)
def sales_dashboard(region: str = "Global"):
"""Interactive sales dashboard for the selected region."""
data = fetch_sales_data(region)
return Column([
Header(f"Sales Dashboard - {region}"),
Chart(data, type="bar", title="Monthly Revenue"),
DataTable(data, searchable=True),
Button(
"Export CSV",
on_click=CallTool("export_sales", {"region": region})
)
])
# Backend tool used by the UI (hidden from LLM by default)
@mcp.tool
def export_sales(region: str):
# Generate and return file or link
return {"status": "success", "message": f"CSV for {region} ready"}
Run with fastmcp dev apps dashboard.py to preview locally. The dev UI gives you a picker, auto-generated forms, live rendering, and an MCP inspector showing all traffic. Changes hot-reload.
Advanced Patterns and Production Considerations
Server Composition & Namespacing
from fastmcp import FastMCP, Provider
main_mcp = FastMCP("main")
# Mount another server under a prefix
github_provider = ... # or another FastMCP instance
main_mcp.mount(github_provider, prefix="github")
Authentication & Security
FastMCP supports multiple auth methods. You keep credentials server-side; the LLM only sees tool results. This is a major advantage over exposing raw API keys or full shell access.
Deployment
- Run locally or on any VPS with
mcp.run(). - For production, Prefect Horizon offers managed hosting, GitHub-based deploys, branch previews, SSO, RBAC, audit logs, etc.
- Containerize easily with Docker for self-hosting.
Debugging Tips
- Use
fastmcp dev appsfor UI tools. - Append
.mdto any docs URL on gofastmcp.com for markdown. - The server at
https://gofastmcp.com/mcplets you query the docs via MCP itself.
Common Real-World Use Cases
Internal Tools: Expose company DB queries, ticket systems, or monitoring data safely.
Personal Agents: Connect to your calendar, email summaries, or note-taking app.
Data Analysis: Dynamic resources for CSVs, live API feeds, or vector search results.
Workflow Automation: Tools that trigger Prefect flows or other orchestration.
E-commerce / CRM Demos: As seen in community examples with order management and dashboards.
Next Steps and Resources
- Read the official quickstart and tutorials at
*AI agents write code fast. They also silently remove logic, change behavior, and introduce bugs -- without telling you. You often find out in production.
git-lrc fixes this. It hooks into git commit and reviews every diff before it lands. 60-second setup. Completely free.*
Any feedback or contributors are welcome! It's online, source-available, and ready for anyone to use.
Free, Micro AI Code Reviews That Run on Commit
| | | | | |
↗ Original-Artikel auf dev.to lesenVollständiger Original-BerichtAusführliche Details, Code-Beispiele & Hersteller-Stellungnahme auf dev.to.Wie bewertest du diesen Beitrag?1 Klick FeedbackTeilen mit Netzwerk & Team:Hat Ihnen dieser Tipp / Anleitung geholfen?Community-Analysen & Experten-Meinungen 0
Verfasse deine eigene Analyse, teile Workarounds oder diskutiere diesen Vorfall im Blog.Noch keine Community-Analyse verfasst. Markiere einen Textabschnitt oder klicke oben auf „ Eigene Analyse verfassen“!Community Pulse: Relevanz-Einschätzung1 Klick Experten-Votum🔴 Akute Relevanz 46%🟡 In Evaluierung 23%🟢 Keine Auswirkung 14%Spannende Innovation 17%Port 8095 EngineVerwandte Story-Cluster & Quellen (Vektor-KI)
3 QuellenHow to Manage Your Workspace With ChatGPT Work2 QuellenBuild agent-ready sites with WebMCP1 QuelleReddit Is Deleting 25,000 Posts a Day #shortsTipp: Mit Pfeiltasten [ ← ] und [ → ] blättern
Ähnliche Beiträge
🔍 Verwandte NewsAuch interessante Nachrichten FastMCP: Build Production-Ready MCP Servers in Python with Minimal Boilerplate
Thematisch verwandte Begriffe: FastMCP, Build, ProductionReady, Servers · 6 Treffer
Laden...Videos werden geladen ...
Laden...Beiträge werden geladen ...
Laden...Videos werden geladen ...
Laden...Beiträge werden geladen ...
Laden...Videos werden geladen ...
Laden...Beiträge werden geladen ...
Laden...Videos werden geladen ...
Laden...Beiträge werden geladen ...
Laden...Videos werden geladen ...
SOCIAL SHARE CARD GENERATOR