A full-stack AI agent platform that dynamically discovers tools from MCP (Model Context Protocol) servers, executes them through an LLM-driven agent loop, and enforces real-time policy guardrails before tool execution.
This project was built as part of a systems-focused AI engineering assignment focused on:
- MCP orchestration
- AI tool-calling systems
- runtime governance
- human approval workflows
- realtime observability
- distributed tool execution
The system demonstrates how modern AI agents can safely interact with external tools through a clean separation between:
- Agent reasoning
- Tool execution
- Policy enforcement
- Observability
- Human governance
- LLM-powered tool-use loop using Groq
- Runtime MCP tool discovery
- Dynamic tool execution routing
- Multi-MCP orchestration
- Structured tool execution flow
- Graceful degradation for failed MCP providers
- Multiple MCP servers connected simultaneously
- Tool discovery through MCP protocol
- Dynamic capability registration
- stdio-based MCP transport
- Plug-and-play MCP architecture
- Block tools dynamically at runtime
- Human approval workflows
- Prompt injection detection
- Tool input validation
- Centralized policy enforcement boundary
- Live policy updates without restart
- Realtime websocket updates
- Policy control UI
- Human approval management
- Observability metrics
- Live event stream
- Connection status monitoring
- Conversation logs
- Tool execution logs
- Policy decision logs
- Realtime operational events
User Prompt
↓
React Dashboard / API Client
↓
Express Backend
↓
AI Agent Loop
↓
MCP Tool Discovery
↓
Policy Engine Intercepts Request
↓
Allowed / Blocked / Approval Required
↓
MCP Tool Execution
↓
Tool Result Returned To LLM
↓
Final Response Generated
↓
Realtime Events Broadcast Via WebSocket
- React
- TypeScript
- Tailwind CSS
- WebSockets
- Vite
- Node.js
- TypeScript
- Express.js
- MCP SDK
- Groq API
- WebSockets
- MCP orchestration
- Runtime tool discovery
- Distributed tool routing
- Policy enforcement boundaries
- Human approval workflows
- Event-driven architecture
apps/
dashboard/ React admin dashboard
server/ Main AI agent backend
mcp-server/ Core MCP tools server
notes-mcp-server/ Notes MCP server
packages/
logger/
policy-engine/
shared-types/
Exposes:
- calculator
- get_weather
- tell_joke
Exposes:
- add_note
- list_notes
- delete_note
- clear_notes
These tools are dynamically discovered at runtime by the agent.
No hardcoded tool lists exist inside the agent runtime.
The system intentionally separates:
- model intent
- execution permissions
The LLM cannot directly execute tools.
Every tool request passes through the policy engine first.
Current protections include:
- tool blocking
- runtime governance
- approval workflows
- suspicious input detection
- prompt injection checks
Example:
User Prompt
↓
Model Wants Tool
↓
Policy Engine Evaluates Request
↓
Allowed / Denied / Approval Required
↓
Tool Executes Only If Approved
git clone https://github.com/notshriyansh/ai-guardrails-agent
cd ai-guardrails-agentpnpm installCreate:
apps/server/.env
Add:
PORT=8080
GROQ_API_KEY=your_groq_api_keycd apps/server
pnpm devcd apps/dashboard
pnpm devThe dashboard runs at:
http://localhost:5173
GET /healthPOST /chatExample:
{
"message": "What is 5 * 9?"
}POST /policy/block
POST /policy/unblockGET /approvals
POST /approvals/:id/approveWhat is 12 * 7?
Agent dynamically discovers calculator tool and executes it.
Block:
calculator
Retry request.
Tool execution is denied live without restarting backend.
Prompt:
What is the weather in Delhi?
Policy engine requires approval before execution.
Approve request through dashboard.
Add note buy milk
List my notes
Demonstrates multi-MCP orchestration and runtime discovery.
- MCP orchestration
- runtime capability discovery
- AI tool calling
- policy enforcement boundaries
- human-in-the-loop systems
- realtime admin infrastructure
- distributed tool routing
- graceful degradation
- event-driven architecture
- observability systems
Separating governance from the agent loop creates a strict enforcement boundary between:
- what the model wants to do
- what the system permits
This improves:
- security
- maintainability
- auditability
- extensibility
The agent does not hardcode tool definitions.
Instead, MCP servers expose capabilities dynamically through the protocol.
This allows:
- plug-and-play tool ecosystems
- scalable orchestration
- provider interoperability
WebSockets allow dashboard updates to propagate instantly without polling.
This enables:
- live governance
- realtime observability
- operational visibility
Potential production-grade extensions:
- persistent database storage
- RBAC / authentication
- approval expiration
- policy DSL
- token usage tracking
- retry queues
- SSE transport support
- sandboxed tool execution
- distributed worker execution
- multi-agent orchestration
Frontend:
- Vercel
Backend:
- Railway / Render