Most "AI features" in web apps are a chat box bolted onto the side: a separate service, a separate account, and a separate idea of what's allowed. I wanted the opposite for DataGroceries , a kanban board and a wiki that install into an existing Django project. An AI agent should be a user of the app, just like the people on the team. It works as the person who connected it, under the same rules, through the same code. It shows up in the same history, and nothing gets a side door.
Here is what that took, and what I'd do again.
One code path: a tool is a REST view
Every app has a REST API, and every MCP tool is one of those views, run in-process. A tool is a few lines of description around a view that already exists:
Tool ( ' comment_on_ticket ' , ' Comment on a ticket ' , " Add a comment, or a reply to one. The ticket ' s watchers and anyone @-mentioned hear about it at once. " , TicketCommentsView , ' POST ' , { ' key ' : KEY , ' body ' : { ' type ' : ' string ' , ' description ' : ' Markdown. ...…