mirror of
https://github.com/HackSoftware/Django-Styleguide.git
synced 2025-10-18 01:24:18 +03:00
3.4 KiB
3.4 KiB
Setting up MCP Documentation Server
This guide explains how to set up the MCP documentation server for the Django Styleguide, which allows IDEs like Cursor and Windsurf to access the documentation context.
Overview
We use mcpdoc to expose our llms.txt
documentation index to IDEs. This allows for better context when working with the Django Styleguide.
Installation
- First, install mcpdoc:
pip install mcpdoc
- Configure your IDE to use the MCP server:
For Cursor
- Open Cursor settings and navigate to the MCP configuration
- Create or edit
~/.cursor/mcp.json
:
{
"mcpServers": {
"django-styleguide-docs-mcp": {
"command": "uvx",
"args": [
"--from",
"mcpdoc",
"mcpdoc",
"--urls",
"DjangoStyleguide:https://raw.githubusercontent.com/HackSoftware/Django-Styleguide/master/llms.txt",
"--transport",
"stdio"
]
}
}
}
- Update Cursor Global Rules (Settings/Rules) with:
for ANY question about Django Styleguide, use the django-styleguide-docs-mcp server to help answer --
+ call list_doc_sources tool to get the available llms.txt file
+ call fetch_docs tool to read it
+ reflect on the urls in llms.txt
+ reflect on the input question
+ call fetch_docs on any urls relevant to the question
+ use this to answer the question
For Windsurf
- Open Cascade with
CMD+L
(on Mac) - Click Configure MCP to open
~/.codeium/windsurf/mcp_config.json
- Add the same configuration as shown above for Cursor
- Update Windsurf Rules/Global rules with the same rule pattern shown above
For Claude Desktop
- Open Settings/Developer to update
~/Library/Application\ Support/Claude/claude_desktop_config.json
- Add the same configuration as shown above
- Restart Claude Desktop app
Note: Currently, Claude Desktop doesn't support global rules, so you'll need to include the rules in your prompts:
<rules>
for ANY question about Django Styleguide, use the django-styleguide-docs-mcp server to help answer --
+ call list_doc_sources tool to get the available llms.txt file
+ call fetch_docs tool to read it
+ reflect on the urls in llms.txt
+ reflect on the input question
+ call fetch_docs on any urls relevant to the question
</rules>
For Claude Code
In a terminal after installing Claude Code, run:
claude mcp add-json django-styleguide-docs '{"type":"stdio","command":"uvx" ,"args":["--from", "mcpdoc", "mcpdoc", "--urls", "DjangoStyleguide:https://raw.githubusercontent.com/HackSoftware/Django-Styleguide/master/llms.txt"]}' -s local
Testing the Setup
To test if the setup is working:
- Open your IDE
- Ask a question about the Django Styleguide
- The IDE should use the MCP server to fetch relevant documentation and provide context-aware answers
Troubleshooting
If you run into issues with Python version incompatibility, you can explicitly specify the filepath to the Python executable in the uvx
command:
{
"mcpServers": {
"django-styleguide-docs-mcp": {
"command": "uvx",
"args": [
"--python",
"/path/to/python",
"--from",
"mcpdoc",
"mcpdoc",
"--urls",
"DjangoStyleguide:https://raw.githubusercontent.com/HackSoftware/Django-Styleguide/master/llms.txt",
"--transport",
"stdio",
"--port",
"8082",
"--host",
"localhost"
]
}
}
}