Skip to main content

django-mcp-discovery

Exposes /.well-known/mcp-server on your Django project so AI agents can discover it via mcp://. Implements draft-serra-mcp-discovery-uri-03.

Installation

pip install django-mcp-discovery

Setup

1. Add to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'mcp_discovery',
]

2. Include URLs:

urlpatterns = [
    ...
    path('', include('mcp_discovery.urls')),
]

3. Done. Visit https://yoursite.com/.well-known/mcp-server.

Configuration (optional)

MCP_DISCOVERY = {
    'NAME':             'My Site MCP Server',
    'ENDPOINT':         'https://mysite.com/mcp/',
    'DESCRIPTION':      'Natural language description of the server',
    'AUTH':             'none',         # none | apikey | oauth2
    'CAPABILITIES':     ['tools', 'resources'],
    'CATEGORIES':       ['e-commerce', 'fashion'],
    'LANGUAGES':        ['it', 'en'],
    'CONTACT':          'api@mysite.com',
    'DOCS':             'https://mysite.com/mcp/docs/',
    'EXPIRES_DAYS':     90,             # manifest expiry in days
    'CRAWL':            True,           # False to opt out of indexing

    # Optional — primitive previews (draft-03 Section 6.10)
    # Use a list for static tools, or 'dynamic' for dynamic ones
    'TOOLS_PREVIEW': [
        {'name': 'search_products', 'description': 'Search by category'},
        {'name': 'check_stock',     'description': 'Real-time availability'},
    ],
    'RESOURCES_PREVIEW': 'dynamic',
    'PROMPTS_PREVIEW':   'dynamic',
}

Auto-detected if not set:

  • Name — from django.contrib.sites or SITE_NAME setting
  • Endpoint — from SITE_URL or first non-localhost ALLOWED_HOSTS
  • Language — from LANGUAGE_CODE setting

Example output

Minimal (no configuration):

{
  "mcp_version": "2025-06-18",
  "name": "My Shop MCP Server",
  "endpoint": "https://myshop.com/mcp/",
  "transport": "http",
  "auth": { "type": "none" },
  "capabilities": ["tools", "resources"],
  "languages": ["it"],
  "last_updated": "2026-03-25T00:00:00+00:00",
  "expires": "2026-09-23T00:00:00+00:00",
  "crawl": true
}

With tools_preview (draft-03 Section 6.10):

{
  "mcp_version": "2025-06-18",
  "name": "My Shop MCP Server",
  "endpoint": "https://myshop.com/mcp/",
  "transport": "http",
  "auth": { "type": "none" },
  "capabilities": ["tools", "resources"],
  "categories": ["e-commerce"],
  "languages": ["it"],
  "expires": "2026-09-23T00:00:00+00:00",
  "crawl": true,
  "tools_preview": [
    {
      "name": "search_products",
      "description": "Search products by category and material"
    },
    {
      "name": "check_stock",
      "description": "Check real-time warehouse availability"
    }
  ],
  "resources_preview": "dynamic",
  "prompts_preview": "dynamic"
}

Security

  • Endpoint domain validation — custom endpoint MUST be on same domain or subdomain. Invalid endpoints fall back to default. (draft-03 Section 6.8)
  • Expires field — manifest declares its own expiry date. (draft-03 Section 6.9)

Changelog

v0.3.0

  • Added tools_preview, resources_preview, prompts_preview fields (draft-03 Section 6.10)
  • Use a list for static previews, or 'dynamic' for dynamic ones

v0.2.0

  • Security: endpoint domain validation (Section 6.8)
  • Security: expires field with EXPIRES_DAYS setting (Section 6.9)

v0.1.0

  • Initial release

Links

Author

Mumble Group — Milan, Italy — support@mumble.group

Metadata

Release files for django-mcp-discovery 0.4.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-mcp-discovery 0.4.3
File Size Uploaded Provenance
django_mcp_discovery-0.4.3.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-mcp-discovery 0.4.3
File Interpreter ABI Platform
django_mcp_discovery-0.4.3-py3-none-any.whl Python 3 none any Details

Total release size: 13.2 kB

Release files / django_mcp_discovery-0.4.3.tar.gz

Download URL django_mcp_discovery-0.4.3.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7ad1d1ce84a5f67bca33444c10858e67067cfc58640d6764eb3577e80cf31d0c
BLAKE2b-256 checksum
How to use checksums
ce3a179e61b388128eac490f0fb4a5d273ea47a6108e8f33a3741588f346db1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / django_mcp_discovery-0.4.3-py3-none-any.whl

Download URL django_mcp_discovery-0.4.3-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b48236351653bc28b7b48c5ea7950ce68daa3bf6f73fd591c8bd718cf26e51c6
BLAKE2b-256 checksum
How to use checksums
48233582734678b4782c0ebf32b2cbe29e14d1e12efb4dcbf4abe158efe27dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Security for django-mcp-discovery 0.4.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page