Secure Multi-Tenant MCP Server with FastAPI and DjangoSecure Multi-Tenant MCP Server with FastAPI and Django
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
Giving an LLM access to your product's data is easy. Doing it safely for every user is the hard part.
I built an MCP server for a multi-tenant data platform. It was internal-only by design.
The approach: • FastAPI for the MCP server • Dedicated MCP endpoints on the existing Django backend • MCP tools built on those endpoints, not on direct DB access
How auth worked:
The frontend issued an encrypted per-user token
Every tool call carried that token
The backend enforced the same permissions as the normal app
What I learned: • Never let tools bypass your API layer. Reuse the permissions you already trust. • One tool, one job. Small tools get called correctly more often. • Private-by-default is a feature. Not every integration needs to be public.
If you want your product's data usable from AI assistants without leaking across tenants, this is what I build.
Are you exposing your product to LLMs yet, or still deciding?
#MCP #FastAPI #Django #AI #Python
Post image
Eros's avatar
"Never let tools bypass your API layer" is the rule I agree with most: the AI gets the same limits as the user, never more. My Telegram booking demo follows the same idea on a small scale: the Mini App only sends the client's choice, and the server checks the rules and...
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started