You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,14 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
18
18
19
19
## [Unreleased]
20
20
21
+
### Added
22
+
23
+
- Standalone CLI via `python -m mcp_django_shell`.
24
+
25
+
### Deprecated
26
+
27
+
- Soft-deprecation of the management command `manage.py mcp_shell`. It's now just a wrapper around the CLI, so there's no harm in keeping it, but the recommended usage will be the standalone CLI going forward.
Copy file name to clipboardExpand all lines: README.md
+42-6Lines changed: 42 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version !=
47
47
uv sync
48
48
```
49
49
50
-
2. Add to your Django project's `INSTALLED_APPS`:
50
+
2. (Optional) Add to your Django project's `INSTALLED_APPS` if you want to use the management command:
51
51
52
52
```python
53
53
DEBUG = ...
@@ -56,6 +56,8 @@ cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version !=
56
56
INSTALLED_APPS.append("mcp_django_shell")
57
57
```
58
58
59
+
**Note**: You can now run mcp-django-shell without adding it to `INSTALLED_APPS` by using `python -m mcp_django_shell` directly. [See below](#getting-started) for more info.
60
+
59
61
> [!WARNING]
60
62
>
61
63
> **Only enable in development!**
@@ -64,7 +66,35 @@ cog.outl(f"- Django {', '.join([version for version in DJ_VERSIONS if version !=
64
66
65
67
## Getting Started
66
68
67
-
mcp-django-shell provides a Django management command that MCP clients can connect to. Configure your client using one of the examples below.
69
+
Run the MCP server directly from your Django project directory:
The server automatically detects `DJANGO_SETTINGS_MODULE` from your environment. You can override it with `--settings` or add to your Python path with `--pythonpath`.
88
+
89
+
There's also a Django management commandif you prefer, but that requires adding mcp-django-shell to `INSTALLED_APPS`:
90
+
91
+
```bash
92
+
python manage.py mcp_shell
93
+
```
94
+
95
+
### Client Configuration
96
+
97
+
Configure your MCP client using one of the examples below. The command is the same forall clients, just expressedin annoyingly different JSON soup.
68
98
69
99
Don't see your client? [Submit a PR](CONTRIBUTING.md) with setup instructions.
70
100
@@ -75,8 +105,11 @@ Don't see your client? [Submit a PR](CONTRIBUTING.md) with setup instructions.
75
105
"mcpServers": {
76
106
"django_shell": {
77
107
"command": "python",
78
-
"args": ["manage.py", "mcp_shell"],
79
-
"cwd": "/path/to/your/django/project"
108
+
"args": ["-m", "mcp_django_shell"],
109
+
"cwd": "/path/to/your/django/project",
110
+
"env": {
111
+
"DJANGO_SETTINGS_MODULE": "myproject.settings"
112
+
}
80
113
}
81
114
}
82
115
}
@@ -90,8 +123,11 @@ Don't see your client? [Submit a PR](CONTRIBUTING.md) with setup instructions.
0 commit comments