@mcp_viewset() # <-- Just add this decorator to any ViewSet!
class CustomerViewSet(ModelViewSet):
queryset = Customer.objects.all()
serializer_class = CustomerSerializer
I've been using Claude Desktop to do admin tasks and it's supercharged my workflows: - "Deactivate [email protected]'s account" -> tools/call `deactivate_user`
- "Extend [email protected]'s free trial by 1 week" -> tools/call `update_plans`
- "How many new users joined week-over-week the past 3 months" -> tools/call `list_users` -> LLM synthesizes the returned data into chart!
It automatically generates tool schemas from your Django serializers and works with any existing auth/permissions (or you can set up MCP-specific rules).It's still in alpha (v0.1.0a3), but definitely stable enough for real use. There's a demo Blog Django app set up in the repo to showcase, but I'd really love more feedback from folks trying it with real Django apps.
GitHub: https://github.com/zacharypodbela/djangorestframework-mcp PyPI: pip install django-rest-framework-mcp