
Django Telescope
io.github.raisiqueira由 GitHub 帳號 raisiqueira 發布v0.1.2更新於 Nov 3, 2026
A Model Context Protocol (MCP) server for Django applications, inspired by Laravel Boost
概覽
此 MCP 伺服器把 Django 專案的模型、路由、資料庫結構、設定與日誌提供給 AI 助理,協助它理解並檢視程式碼庫。
- 可以做什麼
- 檢視專案結構:列出模型及其欄位與關聯、URL 樣式、管理指令,以及 Django/Python 版本、已安裝應用程式等資訊
- 讀取設定:以點號語法查詢任意 Django 設定並查看除錯模式狀態
- 檢視資料庫:查看資料表結構、索引與外鍵,列出遷移及其套用狀態,並以唯讀方式依條件、排序與分頁查詢模型
- 解析 URL:反向解析具名路由,取得模型實體的絕對 URL
- 診斷問題:執行 Django 系統檢查,讀取檔案型日誌處理器中的近期日誌
- 使用提示範本產生符合目前 Django 版本的說明文件檢索請求
- 適用情境
- 適合在用 AI 助理開發 Django 專案時使用,讓它不必手動貼上程式碼就能回答關於模型、路由、資料庫結構、遷移、設定或日誌的問題。最適用於自己專案的本機開發環境。
- 執行需求
- 以本機 Python 套件執行,需要 Python 3.12+ 與 Django 4.2+。需設定 DJANGO_SETTINGS_MODULE 環境變數或傳入 --settings 參數,通常還需以 PYTHONPATH 指向專案根目錄。專案資料庫必須可連線。預設 stdio 傳輸不佔用網路埠;選用的 SSE 傳輸需要主機與埠。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Django Telescope,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
Django AI Boost
A Model Context Protocol (MCP) server for developing Django applications, inspired by Laravel Boost. This server exposes Django project information through MCP tools, enabling AI assistants to better understand and interact with Django codebases.
Table of Contents
- Features
- Screenshots
- Installation
- Usage
- AI Tools Setup
- Available Tools
- Example Usage
- Development & Testing
- Troubleshooting
- Requirements
- Contributing
- License
Features
- Project Discovery: List models, URLs, and management commands
- Database Introspection: View schema, migrations, and relationships
- Configuration Access: Query Django settings with dot notation
- Log Reading: Access recent application logs with filtering
- Production-Ready Authentication: Bearer token authentication for secure deployments
- Read-Only: All tools are safe, read-only operations
- Fast: Built on FastMCP for efficient async operations
Screenshots
Click to view screenshots
Django AI Boost in Action
Django AI Boost MCP server providing Django project introspection through AI assistants (Example using OpenCode)
Installation
For End Users
For Development
If you want to contribute or run the latest development version:
Usage
Running the Server
The server requires access to your Django project's settings:
Note: The stdio transport (default) communicates via standard input/output and does not use network ports. The --port and --host options only apply when using --transport sse.
Authentication
Django AI Boost supports bearer token authentication for secure production deployments when using SSE transport.
Quick Start
Set authentication token (recommended for production):
Or use CLI argument:
How It Works
- Automatic Production Mode: When Django's
DEBUG=Falseand using SSE transport, authentication is automatically required - Token Precedence: Environment variable takes precedence over CLI argument for security
- Transport Support:
- ✅ SSE Transport: Full authentication support (HTTP-based)
- ❌ Stdio Transport: No authentication (local-only, trusted environments)
- Error on Mismatch: If you provide
--auth-tokenwith--transport stdio, the server will exit with an error to prevent false security assumptions
Production Deployment
When running in production (DEBUG=False) with SSE transport, you must provide an authentication token:
Security Best Practices
-
Generate strong tokens:
-
Never commit tokens to version control
-
Use environment variables in production (not CLI arguments)
-
Rotate tokens periodically
-
Use HTTPS with a reverse proxy for external access
Client Configuration with Authentication
When using authentication, configure your MCP clients to include the token:
Cursor / Claude Desktop:
Testing with curl:
Troubleshooting Authentication
"Production mode detected but no authentication token provided"
- Set
DJANGO_MCP_AUTH_TOKENenvironment variable or use--auth-token
"Authentication token provided but transport is 'stdio'"
- This is now an error that stops the server from starting
- Authentication only works with
--transport sse - Either use
--transport ssewith your token, or remove the--auth-tokenargument for stdio
"Running in production mode with stdio transport"
- This is OK for local/trusted environments, but stdio has no authentication capability
- For remote access, use
--transport ssewith authentication
AI Tools Setup
Cursor
Cursor is a popular AI-powered code editor with built-in MCP support.
- Open Cursor Settings (Cmd/Ctrl + Shift + J)
- Navigate to the "Tools & MCP" section
- Add the Django AI Boost server configuration:
Note: Replace /path/to/your/django/project with the actual path to your Django project root directory.
For more information, see the Cursor MCP documentation.
Claude Desktop
Add to your Claude Desktop configuration:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/claude/claude_desktop_config.json
Note: Make sure to replace /path/to/your/django/project with the actual path to your Django project root directory.
Github Copilot (VS Code Extension)
- Install the Github Copilot Chat extension from VS Code marketplace
- Create or edit
.vscode/mcp.jsonin your Django project root:
-
Click "Start" in the JSON [image]
-
Github Copilot Code will automatically connect to the MCP server when you start a conversation in "Agent" mode.
Claude Code (VS Code Extension)
- Install the Claude Code extension from VS Code marketplace
- Create or edit
.mcp.jsonin your Django project root:
- Restart VS Code or reload the Claude Code extension
- Claude Code will automatically connect to the MCP server when you start a conversation
OpenAI ChatGPT Desktop with MCP
OpenAI ChatGPT Desktop supports MCP servers. Add to your configuration file:
- macOS:
~/Library/Application Support/OpenAI/ChatGPT/config.json - Windows:
%APPDATA%\OpenAI\ChatGPT\config.json
Cline (VS Code Extension)
- Install the Cline extension from VS Code marketplace
- Open Cline settings (Cmd/Ctrl + Shift + P → "Cline: Open Settings")
- Add MCP server configuration in the MCP Servers section:
Zed Editor
Add to your Zed MCP configuration (~/.config/zed/mcp.json):
Generic MCP Client
For any MCP-compatible client, you can run the server manually:
Available Tools and Prompts
Tools
1. application_info
Get Django and Python versions, installed apps, middleware, database engine, and debug mode status.
2. get_setting
Retrieve any Django setting using dot notation (e.g., DATABASES.default.ENGINE).
3. list_models
List all Django models with fields, types, max_length, null/blank status, and relationships.
Arguments:
app_labels: Optional list of app labels to filter (e.g.,["blog", "auth"]). If not provided, returns all models.
Note: For large projects, some MCP clients (like PyCharm) may truncate output due to display limits. Use the app_labels parameter to filter by specific apps to avoid truncation. See Troubleshooting for more details.
4. list_urls
Show all URL patterns with names, patterns, and view handlers (including nested includes).
5. database_schema
Get complete database schema including tables, columns, types, indexes, and foreign keys.
6. list_migrations
View all migrations per app with their applied/unapplied status.
7. list_management_commands
List all available manage.py commands with their source apps.
8. get_absolute_url
Get the absolute URL for a specific model instance. Requires the model to have a get_absolute_url() method defined.
Arguments:
app_label: The Django app label (e.g., "blog")model_name: The model name (e.g., "Post")pk: The primary key of the instance
9. reverse_url
Reverse a named URL pattern to get its actual URL path. Supports both positional args and keyword arguments.
Arguments:
url_name: The URL pattern name (e.g., "post_detail", "admin:index")args: Optional list of positional argumentskwargs: Optional dict of keyword arguments
10. query_model
Query a Django model with read-only operations using the Django ORM manager. This tool allows safe querying of any Django model with filtering, ordering, and pagination.
Arguments:
app_label: The Django app label (e.g., "blog")model_name: The model name (e.g., "Post")filters: Optional dict of field lookups (e.g.,{"status": "published", "featured": true})order_by: Optional list of fields to order by (e.g.,["-created_at", "title"])limit: Maximum number of results to return (default: 100, max: 1000)
Returns:
- Total count of matching objects
- Number of results returned
- List of model instances as dictionaries with all field values
- For foreign keys, includes both the ID and string representation
Example Queries:
- Get all published posts:
filters={"status": "published"} - Get featured posts ordered by date:
filters={"featured": true},order_by=["-created_at"] - Get recent posts with limit:
order_by=["-created_at"],limit=10
11. run_check
Run Django's system checks to identify potential issues in models, settings, and deployment configuration.
Arguments:
app_labels: Optional list of app labels to checktags: Optional list of check tags (e.g.,"models","compatibility")deploy: Include deployment checks whentruefail_level: Minimum severity ("CRITICAL","ERROR","WARNING","INFO","DEBUG")databases: Optional list of database aliases to include
12. read_recent_logs
Read recent lines from file-based log handlers configured in LOGGING.handlers.
Arguments:
lines: Number of lines to return per file (default:100, configurable viaDJANGO_MCP_MAX_LOG_LINESenv var)handler_name: Optional handler name to read from a single file handler
Note: This tool reads only file-based handlers (
*FileHandlerclasses). If your project logs to the console only, configure aFileHandlerin your DjangoLOGGINGsettings so the AI can access log output. Example:
Prompts
MCP prompts provide reusable message templates to help guide interactions with AI assistants.
1. search_django_docs
Generate a formatted prompt to help search for specific topics in Django documentation.
Arguments:
topic: The Django topic or feature to search for (e.g., "models", "queryset", "migrations", "authentication")
Returns: A formatted prompt that includes:
- The current Django version being used
- Direct links to the appropriate version of Django documentation
- Guidance on what information to look for
- Request for best practices and code examples
Example topics:
- "models" - Learn about Django models and ORM
- "queryset filtering" - Query optimization and filtering
- "migrations" - Database schema management
- "authentication" - User authentication and permissions
- "middleware" - Request/response processing
- "forms" - Form handling and validation
This prompt automatically adapts to your Django version (e.g., 5.2, 4.2) to ensure documentation compatibility.
Example Usage with AI Assistants
Once configured, you can ask your AI assistant questions like:
Using Tools:
- "What models are in this Django project?"
- "Show me all URL patterns"
- "What's the database schema for the users table?"
- "Are there any unapplied migrations?"
- "What's the value of the DEBUG setting?"
- "What's the URL for blog post with ID 5?"
- "Reverse the 'post_detail' URL pattern with pk=10"
- "Show me all published blog posts"
- "Get the 10 most recent posts ordered by creation date"
- "Find all featured posts in the blog"
- "Show me recent error logs"
Using Prompts:
- "Use the search_django_docs prompt for 'models'" - Get help finding Django model documentation
- "Search Django docs for 'authentication'" - Learn about Django authentication
- "Show me Django documentation about 'migrations'" - Migration best practices and guides
Development & Testing
The project includes a comprehensive test suite and a fixture Django project for development:
The fixtures/testproject/ directory contains a complete Django application for testing all MCP tools. See fixtures/README.md for details about the test project structure.
Troubleshooting
"Django is not configured" Error
Make sure you've set the DJANGO_SETTINGS_MODULE environment variable or used the --settings flag:
PYTHONPATH Issues
If Django can't find your project modules, add your project directory to PYTHONPATH:
Or in your MCP client configuration:
MCP Server Not Connecting
- Check that the
django-ai-boostcommand is accessible in your PATH - Verify your MCP client configuration file syntax is valid JSON
- Check the logs in your AI tool (usually in settings or help menu)
- Try running the server manually to see any error messages:
Database Connection Issues
Ensure your Django database is properly configured and accessible. The MCP server needs the same database access as your Django application.
Port Already in Use (SSE Transport)
If you see an error like "Address already in use" when using SSE transport, the default port 8000 is likely occupied by another service (such as your Django development server). Use a different port:
Note: The stdio transport (default) does not use network ports and will not have this issue.
Output Truncation in MCP Clients
Some MCP clients have display limits that may truncate long tool outputs:
PyCharm: Limits tool output to 2000 lines (~100 Django models with typical field counts) Claude Code: Truncates at ~700 characters in terminal display
Symptoms:
- Message stating "output truncated due to length"
- Incomplete model listings when calling
list_models
Solution:
Use the app_labels parameter to filter models by specific Django apps:
Verification: The truncation is happening client-side, not in the server. To verify:
- Count your Django models:
python manage.py shell -c "from django.apps import apps; print(len(apps.get_models()))" - Estimate lines: models × 20 lines per model ≈ total output lines
- If > 2000 lines (PyCharm) or very large (Claude Code), use app filtering
Requirements
- Python 3.12+
- Django 4.2+
- FastMCP 3.2.4+
License
MIT License - see LICENSE file for details.
Inspiration
This project is inspired by Laravel Boost, which provides similar MCP functionality for Laravel applications.
Contributing
We welcome contributions from the community! Whether it's bug fixes, new features, documentation improvements, or bug reports, your help is appreciated.
Getting Started
- Fork the repository on GitHub
- Clone your fork locally:
- Install development dependencies:
- Create a new branch for your changes:
Development Workflow
- Make your changes in your feature branch
- Follow code style:
- Test your changes:
Run broad integration coverage
uv run pytest test_server.py
uv run django-ai-boost --settings testproject.settings
We follow Conventional Commits:
feat:for new featuresfix:for bug fixesdocs:for documentation changeschore:for maintenance taskstest:for test changesrefactor:for code refactoring
- Push to your fork:
- Create a Pull Request on GitHub from your fork to the main repository
Contribution Guidelines
- Code Quality: Ensure your code passes linting (
ruff check) and formatting (ruff format) - Testing: Add tests for new features and ensure existing tests pass
- Documentation: Update the README and relevant documentation for new features
- Commits: Use clear, descriptive commit messages following Conventional Commits
- Pull Requests: Provide a clear description of what your PR does and why
- Issues: Check existing issues before creating a new one
What to Contribute
We're especially interested in:
- New MCP Tools: Add new tools to expose more Django functionality
- Bug Fixes: Fix issues reported in GitHub Issues
- Documentation: Improve setup guides, add examples, or clarify existing docs
- Tests: Expand test coverage for existing features
- Performance: Optimize slow operations or reduce memory usage
- Compatibility: Ensure compatibility with different Django versions
Need Help?
- Look at existing code for examples
- Open a GitHub Issue for questions or discussions
- Review closed PRs to see how others have contributed
Code of Conduct
Please be respectful and constructive in all interactions. We aim to maintain a welcoming and inclusive community.
Commercial Support
This project is maintained by Vinta Software. Our team of design and development experts is available to help your company launch successful Django-powered products. If you need any commercial support, feel free to get in touch: [email protected]
來源:README.md,提交 c8007a5
工具
0版本歷史
1- v0.1.2最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分