Your Django + DRF app already serializes models, validates input, and generates an OpenAPI schema via drf-spectacular. Here's how to point wmcp.sh at that schema and ship a Model Context Protocol server agents can call — without touching a single view.
wmcp.sh is not affiliated with the Django Software Foundation or Anthropic. Django, DRF, and drf-spectacular are open-source projects.
DRF viewsets and serializers in views.py, routed through a DefaultRouter, with drf-spectacular emitting an OpenAPI 3 schema at /api/schema/. Auth handled by DRF's authentication classes (Token, JWT, Session, OAuth2).
A Model Context Protocol server exposing each viewset action as a typed tool. wmcp.sh reads /api/schema/ and emits the MCP server at https://wmcp.sh/mcp/<your-id>. Zero changes to views.py.
Plain Django REST Framework; drf-spectacular emits the spec; wmcp.sh ingests it.
# views.py — Django 5 + DRF
from rest_framework import viewsets, serializers
from drf_spectacular.utils import extend_schema
from .models import Order
class OrderSerializer(serializers.ModelSerializer):
class Meta:
model = Order
fields = ['id', 'sku', 'qty', 'status', 'created_at']
class OrderViewSet(viewsets.ModelViewSet):
queryset = Order.objects.all()
serializer_class = OrderSerializer
@extend_schema(tags=['agent'], summary='Update order status')
def partial_update(self, request, *args, **kwargs):
return super().partial_update(request, *args, **kwargs)
# urls.py — drf-spectacular publishes the schema at /api/schema/
# Then: curl 'https://wmcp.sh/api/v1/tools?url=https://acme.example.com/api/schema/&tag=agent'
# Result: every tagged operation becomes an MCP tool, types inferred from your serializer.
| Capability | Hand-rolled | wmcp.sh + drf-spectacular |
|---|---|---|
| Tool schemas synced with serializers | ⚠️ Manual; drifts when serializers change | ✅ drf-spectacular regenerates spec on every deploy |
| Authentication declared once | ⚠️ Re-implement DRF auth at the MCP layer | ✅ DRF's securitySchemes flow through to wmcp.sh |
| Pagination + filtering | ⚠️ Re-export DRF filters as MCP parameters by hand | ✅ Spec lists query params; wmcp.sh exposes them as tool inputs |
| MCP transport (Streamable HTTP) | ⚠️ You build it | ✅ Served at https://wmcp.sh/mcp/<your-id> |
| Per-tool gating | ⚠️ Manual | ✅ @extend_schema(tags=['agent']) + &tag=agent ingest filter |
| Spec drift detection | ❌ Silent breakage | ✅ Re-ingest in CI; type mismatches surface immediately |
securitySchemes in drf-spectacular's output. wmcp.sh reads it and forwards the appropriate credential — bearer tokens, API keys, or full OAuth 2.1 via /mcp/<provider>.@extend_schema(tags=['agent']) to mark MCP-callable operations, then pass &tag=agent when ingesting. Admin and internal endpoints stay invisible./api/openapi.json and it works identically. The "Django" name on this page covers any Django-rooted API framework that publishes OpenAPI.Audit your DRF viewsets, tune drf-spectacular for agent traffic, deploy MCP at mcp.yourbrand.com. Starter $499 one-time setup; Managed Retainer $999/mo for ongoing maintenance; Enterprise $4,999+/mo for SLA + private deploy.