Quick-start scripts for running the entire application stack locally.
Before using these scripts, ensure you have:
-
Python Virtual Environments:
# Backend cd src\backend python -m venv .venv .\.venv\Scripts\pip install -r requirements.txt # MCP Server cd src\mcp-servers\ai-foundry-agent python -m venv .venv .\.venv\Scripts\pip install -r requirements.txt
-
Frontend Dependencies:
cd src\frontend npm install
-
Environment Variables:
- Copy
.azure/RTtest/.env(or your environment) tosrc/backend/.envfor local testing - Or ensure Azure credentials are configured
- Copy
Simply double-click start-local-dev.cmd to start all services.
.\start-local-dev.ps1This will open 3 terminal windows:
- MCP Server - http://localhost:8888
- Backend API - http://localhost:8000
- Frontend - http://localhost:5173
.\start-local-dev.ps1 -McpPort 9000 -BackendPort 8001 -FrontendPort 3000# Use Azure MCP server instead of local
.\start-local-dev.ps1 -SkipMcp
# Only start frontend (backend already running)
.\start-local-dev.ps1 -SkipMcp -SkipBackend
# Only start MCP and backend
.\start-local-dev.ps1 -SkipFrontend.\stop-local-dev.ps1Or close each terminal window individually.
| Service | Default Port | URL | Purpose |
|---|---|---|---|
| Frontend | 5173 | http://localhost:5173 | React UI (Vite dev server) |
| Backend | 8000 | http://localhost:8000 | FastAPI server with realtime WebSocket |
| MCP Server | 8888 | http://localhost:8888 | AI Foundry Agent MCP server |
Backend:
- API Docs: http://localhost:8000/docs
- WebSocket: ws://localhost:8000/api/realtime
- Health: http://localhost:8000/health
MCP Server:
- Health: http://localhost:8888/health
- MCP Endpoint: http://localhost:8888/mcp (JSON-RPC 2.0)
Frontend:
- Main UI: http://localhost:5173
- Proxies
/apirequests to backend
If you see "port already in use" errors:
-
Check running processes:
Get-NetTCPConnection -LocalPort 8000,8888,5173 | Select OwningProcess | Get-Process
-
Stop all services:
.\stop-local-dev.ps1
-
Use different ports:
.\start-local-dev.ps1 -BackendPort 8001 -McpPort 8889
# Recreate backend venv
cd src\backend
python -m venv .venv
.\.venv\Scripts\pip install -r requirements.txt
# Recreate MCP venv
cd src\mcp-servers\ai-foundry-agent
python -m venv .venv
.\.venv\Scripts\pip install -r requirements.txtIf backend shows "MCP connection error":
-
Check MCP server is running:
curl http://localhost:8888/health
-
Check environment variable:
- Backend should have
AZURE_AI_FOUNDRY_MCP_URL=http://localhost:8888 - The script sets this automatically
- Backend should have
-
Use Azure MCP server instead:
.\start-local-dev.ps1 -SkipMcp
- Check backend is running: http://localhost:8000/docs
- Check Vite proxy configuration:
src/frontend/vite.config.ts - Clear browser cache and reload
Once all services are running:
- Open Frontend: http://localhost:5173
- Click "Start Session" to begin voice chat
- Test Web Search: Ask "What's the weather in Seattle?"
- Check Logs: Look at the terminal windows to see request flow
Frontend Console:
Connected to backend WebSocket
Session started
Backend Terminal:
INFO: WebSocket connection established
INFO: MCP Client initialized: base_url=http://localhost:8888
INFO: Executing MCP tool: search_web_ai_foundry
MCP Terminal:
INFO: Received MCP request: method=tools/call
INFO: Executing tool: search_web_ai_foundry
INFO: ✅ Search completed: 456 chars
The script automatically sets:
AZURE_AI_FOUNDRY_MCP_URL=http://localhost:8888(for backend)PORT=8888(for MCP server)
Other required variables should be in:
src/backend/.env(Azure credentials, AI Foundry config)src/mcp-servers/ai-foundry-agent/.env(AI Foundry config)
- Checks prerequisites (venvs, node_modules)
- Opens 3 PowerShell windows
- Sets environment variables for each service
- Starts services in order (MCP → Backend → Frontend)
- Displays startup summary
- Finds processes listening on ports 8888, 8000, 5173
- Kills those processes
- Confirms shutdown
- Keep the main script window open to see the startup summary
- Each service window shows its own logs
- Close any window to stop that service
- Use Ctrl+C in a terminal to gracefully stop
- Check health endpoints if something isn't working
After starting services:
- Develop: Edit code, servers will auto-reload
- Debug: Check logs in each terminal window
- Test: Use frontend UI or API docs
- Deploy: Run
azd deploywhen ready
Happy coding! 🎉