Django Shell
Enables AI assistants to execute Python code within a persistent Django shell session.
About
Designed for AI assistants, this tool provides a Model Context Protocol (MCP) server that establishes a stateful Django shell. It allows AI assistants to interact directly with a Django project, maintaining session state for variables and imports across calls. This facilitates iterative exploration of models, testing queries, and debugging within the Django environment, offering full shell access in a controlled development setting for AI-driven tasks.
Key Features
- Executes Python code in your Django environment via a single `django_shell` tool
- Optimized for Large Language Models (LLMs) that understand Python
- Requires zero configuration, seamlessly integrating with Django projects
- Maintains persistent session state for imports and variables between calls
- 9 GitHub stars
- Provides a `django_reset` tool to clear the session when needed
Use Cases
- Testing database queries and ORM operations directly from an AI interface
- Debugging issues within a Django project by allowing AI to execute and observe code
- Exploring Django models and project structure interactively with an AI assistant