From Theory to Working Code in 30 Minutes
Muhammad Abdugafarov
October 11, 2025
Khujand, Tajikistan
Scan to view slides
Name: Muhammad Abdugafarov
Role: Team Lead at SilkRoad Professionals
Experience: 8 years in IT
Interests: AI, product development
💡 LLM = "Brain" that understands human language
💡 LLMs can think, but can't act
LLM (Just a model)
↓
+ Tools
+ Memory
+ Decision-making ability
↓
AI Agent (Can act)
AI Agent = LLM + ability to interact with the world
Agent = Not just a chatbot, but an assistant that can act!
Question: How to give LLMs the ability to use tools?
MCP = USB for AI tools
User → AI Agent (Agno) → MCP Server → FastAPI → SQLite
↓
OpenAI GPT-4
↓
Processes request
Selects tools
Formats response
from fastapi import FastAPI
from fastapi_mcp import FastApiMCP
app = FastAPI()
# That's it! 5 lines of code
mcp = FastApiMCP(
app,
name="Expense Tracker MCP"
)
# Automatically converts all FastAPI routes into MCP tools!
@app.post("/transactions")
async def create_transaction(
data: TransactionCreate
):
return store.create(data)
# Regular FastAPI route
# Becomes MCP tool automatically
# AI can call it via MCP
agent = Agent(
name="Expense Tracker Agent",
model=OpenAIChat(id="gpt-4"),
# Connect to MCP server
tools=[MCPTools(
url="http://localhost:9002/mcp"
)],
# System instructions
instructions=SYSTEM_PROMPT
)
Let's see how it works!
1. User: "Show my balance" ↓ 2. GPT-4 thinks: - Need tool: get_summary ↓ 3. MCP call: POST /mcp/tools/get_summary ↓ 4. FastAPI executes: SELECT SUM(...) FROM transactions ↓ 5. Agent responds: "Your balance: 5000.00"
# Clone the repository
git clone https://github.com/dev-muhammad/MCPAgent
cd MCPAgent
# Configure
cp .env.example .env
# Add OPENAI_API_KEY to .env
# Run
cd server && python start.py --mcp
cd server && python start.py --api
cd agent && python agent.py
Thank you for your attention! 🎉