django-oauth-toolkit
OAuth2 goodies for the Djangonauts!
Django OAuth Toolkit is an OAuth 2.0 authorization server that integrates with Django projects to provide MCP-compliant authentication. Starting with version 3.4.0, it supports the authorization server role required by the Model Context Protocol specification, including PKCE by default and RFC 8414/9728 discovery endpoints. This enables Django applications to authenticate and authorize MCP clients and AI agents through standards-compliant OAuth2 flows. The toolkit can also function as a resource server to protect Django or Django REST Framework APIs with OAuth2 tokens.
Key Features
Use Cases
- 01Adding MCP-compliant OAuth2 authentication to Django applications for AI agent authorization
- 02Securing Django REST Framework APIs accessed by MCP clients and AI assistants
- 03Running an OAuth2 authorization server within an existing Django project instead of deploying a separate service
- 04Implementing standards-based token management for AI agent interactions with Django backends
- 05Enabling dynamic client registration for MCP clients connecting to Django resources
- 06Protecting Django application endpoints with OAuth2 access control for AI workflows
Related MCP Servers
View moremarkitdown
Python tool for converting files and office documents to Markdown.
firecrawl
The context API to search, scrape, and interact with the web at scale. 🔥
prompts.chat
f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.
langflow
Langflow is a powerful tool for building and deploying AI-powered agents and workflows.
django-oauth-toolkit — FAQ
What is django-oauth-toolkit for MCP?+
Django OAuth Toolkit is an OAuth 2.0 authorization server for Django that supports the Model Context Protocol authorization specification as of version 3.4.0. It provides the endpoints, models, and logic needed to authenticate and authorize MCP clients and AI agents using standards-compliant OAuth2 flows.
How do I install django-oauth-toolkit?+
Install the package with pip using 'pip install django-oauth-toolkit', then add 'oauth2_provider' to your Django INSTALLED_APPS setting. For authorization server functionality, include the oauth2_provider URLs in your project's urls.py file.
What are the requirements for django-oauth-toolkit?+
You need Python 3.10 or higher, Django 4.2 or higher, and oauthlib 3.2.2 or higher. No external API keys are required, as it runs entirely within your Django application.
Which MCP clients work with django-oauth-toolkit?+
Any MCP client that implements the MCP authorization specification can work with Django OAuth Toolkit. The toolkit provides the authorization server role, supporting PKCE and the required discovery endpoints for MCP client authentication.
Is django-oauth-toolkit free to use?+
Yes, Django OAuth Toolkit is released under the BSD license and is free and open source software.
How do I enable MCP-specific features like Dynamic Client Registration?+
Dynamic Client Registration (RFC 7591/7592) and Client ID Metadata Documents can be enabled by setting DCR_ENABLED and CIMD_ENABLED to True in your Django settings. PKCE is already required by default in version 3.4.0 and later.
How do I install django-oauth-toolkit?+
Open the source repository on GitHub and follow its README. django-oauth-toolkit is a mcp server — MCP Agents Market links you directly to the official repo.
Is django-oauth-toolkit free?+
django-oauth-toolkit is an open-source project hosted on GitHub. Check the repository for its license and any usage requirements.