Show HN: Django REST Framework MCP – Expose Your Django APIs to AI Agents

3 skierzp 0 9/2/2025, 2:17:28 PM github.com ↗
I wanted Claude to interact directly with my Django app data, so I built a library that exposes Django REST Framework APIs as callable MCP tools with just a few lines of code.

  @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 josh@gmail.com's account" -> tools/call `deactivate_user`
  - "Extend jack@teams.com'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

Comments (0)

No comments yet