Architecture Pattern: Using MCP as a Secure Middleware for 4-Phase Agent Workflows #1757
preet7777777
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
www.linkedin.com/in/preet-sirohi-467913257
"I’ve been developing a Tech Support AI system using FastAPI and the Model Context Protocol. While the connectivity to tools like Jira, SMTP, and SSH is straightforward, scaling it for internal company use required a more robust 'Gateway' pattern.My Current Stack:Backend: FastAPI (port 8081)Gateway: MCP Hub (port 8000) managing f40115bd (Gmail), 28e07cd6 (Jira), and eb4c9a45 (Postgres).Pipeline: A 4-phase sequence (Classifier -> KB -> Investigator -> Synthesizer).The Challenge I Solved:To prevent unauthorized actions, I built an intermediary PII Engine and Role-validation layer between the Agent and the MCP tools. The agent requests a 'Write' action, but the Gateway validates the user's JWT/Role before executing the tool call.I’m looking for feedback on this 'Gatekeeper' pattern. Is it better to handle RBAC at the Agent level or as a middleware within the MCP server itself? I’ve found the middleware approach much cleaner for auditing."
All reactions