Frisian MCP (Django)

com.frisian-mcp由 frisian-mcp.com 發布官方發布者v1.0.12更新於 Oct 24, 2026

Your DRF API as MCP tools — 1,800 endpoints become 16 dispatchers, permissioned by Django.

已驗證Streamable HTTP可網頁執行知識與記憶開發者工具

概覽

AI 產生的概覽

遠端 MCP 端點,向助理提供 frisian-mcp 文件、線上示範,以及 Django/DRF 整合的安裝與疑難排解指南。

可以做什麼
  • 閱讀伺服器文件:身分資訊、入門步驟、Django/DRF 設定參考、安全性與驗證模型,以及文件瀏覽
  • 體驗線上示範,涵蓋 CRM、維運與平台三類能力,讀寫皆為真實且持久
  • 取得 Nautobot、NetBox、Paperless 與 Open edX 整合的安裝指南,含各版本變更的檔案
  • 取得上述整合的疑難排解與診斷指南,並可依查詢做語意搜尋
適用情境
適合在助理協助你導入 frisian-mcp(將 Django REST Framework 的 ViewSet 暴露為 MCP 工具的閘道)時使用,也適合在安裝 Python 套件前先查看其文件與示範介面。
執行需求
遠端 streamable HTTP 端點;未宣告任何套件、環境變數或標頭。託管示範可用任何相容 MCP 的用戶端存取。若要在自己的專案中執行 frisian-mcp,另需 Python 3.11+、Django 5.x 與 Django REST Framework 3.14+。
安裝前請注意
示範工具會對託管示範資料執行真實且持久的讀寫,請將任何變更視為長期生效。文件與示範由第三方託管,你送出的查詢與內容會傳到該服務。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Frisian MCP (Django),將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Web executable,透過 Streamable HTTP。 遠端服務在工作區中設定後即可從網頁執行環境執行。

交給代理程式安裝

把這段提示詞貼上到 Claude Code、Codex、Cursor 等代理程式,或 SourceWeft 對話中。代理程式會讀取該伺服器的安裝指南,先向你展示發布者、端點和登入方式,經你同意後再把它新增到你的客戶端。金鑰不會寫進任何命令。

閱讀 https://sourceweft.com/mcp/com.frisian-mcp%2Fdjango/install.md,並按其中說明把這個 MCP 伺服器接入我的客戶端。修改任何設定之前,先告訴我它的發布者、端點和登入方式,等我確認。不要把 API 金鑰寫進命令或我會提交的檔案;問我金鑰應從哪裡取得。

檢視代理程式所依據的安裝指南

其他 MCP 客戶端

把它新增到你客戶端的 mcpServers 設定中。

{
  "mcpServers": {
    "frisian-django": {
      "type": "http",
      "url": "https://mcp.frisian-mcp.com/mcp/"
    }
  }
}

README

frisian-mcp

[OpenSSF Best Practices] [Slack] [MCP Queen operational grade]

The Django MCP gateway that discovers your API automatically.

frisian-mcp turns your existing Django REST Framework ViewSets into Model Context Protocol tools with zero boilerplate. Add the package, include one URL, and every ViewSet action becomes a callable MCP tool — name, description, and input schema derived from your serializers automatically.

Designed for token-efficient agent workflows. A 50-action Django app loads in 500–2,000 tokens of tools/list schema instead of the 15,000–25,000 conventional flat MCP would emit; a 60-device bulk-write response is 24 tokens instead of ~10,800 of full echo. Same surface, two orders of magnitude less context burned before the agent has done any reasoning. Full numbers in Token efficiency.

Version: 1.1.1 | License: Apache 2.0 | Python: 3.11+ | Django: 5.x

bash
pip install frisian-mcp

Project site: https://frisian-mcp.com/

A live MCP server is hosted at https://frisian-mcp.com/ for hands-on evaluation — point any MCP-compatible client at it to see the dispatcher pattern and lean envelope behavior against a real surface. The same site serves the project documentation through an MCP-consumable dispatcher, so coding agents (Claude Code, Codex, Gemini CLI, etc.) can connect to it directly and consume installation, configuration, and decorator reference material as part of their working context while integrating frisian-mcp into your own project.


At a glance

FeatureDetails
Auto-discoveryWalks URL patterns at startup; registers every ViewSet action as an MCP tool
Zero boilerplateName, description, and input schema derived from DRF serializers automatically
@mcp_dispatcherOne tool → many actions; built-in help mode; per-action validation
@mcp_toolExplicit single-function tool registration for custom logic
@mcp_resourceExpose server-side content via resources/list / resources/read
Filter introspectionSearchFilter, OrderingFilter, DjangoFilterBackend → schema properties on list
Allowlist / denylistFRISIAN_MCP_TOOL_ALLOWLIST / FRISIAN_MCP_TOOL_DENYLIST for surgical surface control
Dispatch groupsFRISIAN_MCP_DISPATCH_GROUPS — bundle N tools into 1 dispatcher; action="help" for discovery
Deferred discoveryURL scan fires on first request — captures late-loading plugin ViewSets
OAuth 2.0contrib.oauth — authorization code (PKCE) + client credentials; HMAC-hashed tokens
Static tokenscontrib.tokens — HMAC-hashed Bearer tokens for internal agents
Per-agent scopingcontrib.agents — per-credential tool allowlists; fail-closed on inactive connections
Permission tiersFRISIAN_MCP_TOKEN_TIER_MAP / FRISIAN_MCP_MAX_TIER — map roles to read/write gates
Host-app scopingSyncInvocation calls viewset.initial() — host RBAC, queryset filtering, and throttles enforced
Tool middlewareFRISIAN_MCP_TOOL_MIDDLEWARE — audit logging, rate limiting, heartbeats
Rate limitingRateLimitMiddleware — built-in sliding-window, no Redis required
Pluggable backendsCustom discovery and invocation backends via dotted-path settings
SSE supportAccept: text/event-stream wraps any response in a single SSE event
MCP 2025-11-25Streamable HTTP; ping, initialize, tools/list, tools/call, resources/list

Token efficiency

The dispatcher pattern and the lean write envelope exist for one reason: agent context windows are finite, and the conventional MCP shape (one tool per ViewSet action; full serialized echo on every write) burns through that budget before the agent has done anything useful.

Measured numbers from real integrations:

ScenarioDefault MCP shapefrisian-mcpReduction
tools/list for a 50-action Django app~15,000–25,000 tokens500–2,000 tokens with FRISIAN_MCP_DISPATCH_GROUPS~95%
tools/list for a large infrastructure Django app1,737 flat tools15 dispatcher toolstool surface reduced ~99%
60-device bulk-create response~10,798 tokens (full echo)24 tokens (lean envelope)99.8%
200-device bulk-create response~36,000 tokens24 tokens (constant)99.9%

The bulk-write savings are constant regardless of batch size — the lean envelope is fixed-shape and the full response is reachable via the continuation token without re-running the write. The dispatcher reduction is opt-in through FRISIAN_MCP_DISPATCH_GROUPS (autodiscovery alone gives the conventional flat shape).

See The Token Problem, Dispatcher Pattern, and Write-Path Response Filtering for the design rationale and full measurements.


Requirements

  • Python 3.11+
  • Django 5.x
  • Django REST Framework 3.14+

Quickstart

1. Install and add to INSTALLED_APPS:

python
# settings.pyINSTALLED_APPS = [    ...    "frisian_mcp",]

2. Include the gateway URL:

python
# urls.pyfrom django.urls import include, path
urlpatterns = [    ...    path("mcp/", include("frisian_mcp.urls")),]

That's it. With auto-discovery enabled (the default), every DRF ViewSet in your URL tree is now an MCP tool.

python
# myapp/views.py — nothing changes hereclass UserViewSet(viewsets.ModelViewSet):    queryset = User.objects.all()    serializer_class = UserSerializer    permission_classes = [IsAuthenticated]

After startup, the gateway exposes users.list, users.retrieve, users.create, users.update, users.partial_update, and users.destroy — derived entirely from the ViewSet.

3. Generate a client config:

bash
python manage.py mcp_config --token mytoken123
json
{  "mcpServers": {    "frisian-mcp": {      "url": "http://localhost:8000/mcp/",      "transport": "http",      "headers": { "Authorization": "Bearer mytoken123" }    }  }}

Use --client to emit the format expected by a specific MCP client. Use --url and --name to override the server URL and key.

4. Verify the install:

bash
python manage.py mcp_doctor                # standard auditpython manage.py mcp_doctor --security     # extended OAuth security audit

Walks the configuration end-to-end and exits non-zero on errors. Run after every install, every config change, and as the first diagnostic step on any unexpected behaviour. See the mcp_doctor guide for the full check list.


Architecture overview

text
MCP Client       │  JSON-RPC 2.0 over HTTP POST       ▼┌──────────────────────────────────────────────────┐│  McpView  (DRF APIView)                           ││  ├─ Authentication  (FRISIAN_MCP_AUTHENTICATION_CLASSES) ││  ├─ Permissions     (FRISIAN_MCP_PERMISSION_CLASSES)     ││  └─ Method dispatch                              ││       ├─ initialize / initialized / ping / help  ││       ├─ tools/list  ──────────────── ToolRegistry ││       ├─ tools/call  ── ToolMiddleware ── Registry ││       ├─ resources/list ───────── ResourceRegistry ││       └─ resources/read ───────── ResourceRegistry │└──────────────────────────────────────────────────┘       │┌──────────────────┐   ┌─────────────────────────┐│  ToolRegistry    │   │  Auto-discovery          ││  (module-level   │◄──│  (DRFSyncDiscovery)      ││   singleton)     │   │  Walks URL patterns at   ││                  │   │  AppConfig.ready()       │└──────────────────┘   └─────────────────────────┘       │┌──────────────────────────────────────────────────┐│  InvocationBackend  (SyncInvocation by default)  ││  Builds synthetic DRF Request → calls ViewSet    ││  action → returns ToolResult                     │└──────────────────────────────────────────────────┘
  • Separation of discovery and invocation. Two pluggable backends — override either independently.
  • Registry is the source of truth. @mcp_tool, @mcp_dispatcher, and auto-discovery all write to the same tool_registry singleton.
  • Tool errors are isError: true, not JSON-RPC errors. Permission denials and handler exceptions return isError: true inside a normal HTTP 200 response — the session stays alive.
  • Two enforcement points. Gateway-level permissions gate the entire /mcp/ surface. Tool-level tiers gate individual tools/call invocations.

Dispatcher pattern

For teams building purpose-built agent tools, frisian-mcp ships the @mcp_dispatcher pattern: one MCP tool name routes to many actions internally.

python
from frisian_mcp import mcp_dispatcher, mcp_action
@mcp_dispatcher(name="tasks", description="Manage project tasks.")class TasksDispatcher:
    @mcp_action(name="create", description="Create a task.")    def create(self, request, params):        task = Task.objects.create(title=params["title"])        return {"id": task.pk}
    @mcp_action(name="list", description="List tasks by status.")    def list(self, request, params):        return {"tasks": list(Task.objects.values("id", "title", "status"))}

One tool in tools/list instead of many. Call with action="help" for a structured listing of available actions. Per-action JSON Schema validation runs before the method.

This is the pattern for agent-facing APIs where tool count matters and progressive disclosure beats a flat list.

For high-volume APIs, FRISIAN_MCP_DISPATCH_GROUPS can automatically bundle existing auto-discovered tools into dispatchers with no extra code.


Authentication and security

frisian-mcp delegates authentication to DRF — any DRF authentication class works out of the box via FRISIAN_MCP_AUTHENTICATION_CLASSES. Three ready-to-use contrib modules cover the most common cases:

ModuleWhat it provides
frisian_mcp.contrib.tokensHMAC-hashed static Bearer tokens for internal agents and service accounts
frisian_mcp.contrib.oauthFull OAuth 2.0 — authorization code (PKCE) + client credentials; redirect URI allowlist
frisian_mcp.contrib.agentsPer-credential tool allowlists; connections fail-closed when the credential is deactivated

Gateway-level access is controlled by FRISIAN_MCP_PERMISSION_CLASSES. Tool-level access is controlled by permission tiers (read / read_write / admin) mapped via FRISIAN_MCP_TOKEN_TIER_MAP. Use FRISIAN_MCP_MAX_TIER to cap all callers on an endpoint regardless of their credential tier.

Hardened-by-default posture (1.0.x)

The defaults are oriented toward production safety rather than walk-up convenience:

  • Token and client-secret storage uses HMAC-SHA256 digests (FRISIAN_MCP_HMAC_KEY). A leaked database row cannot be replayed directly — the raw secret is only ever shown once at creation time.
  • OAuth dynamic client registration is closed by default (FRISIAN_MCP_OAUTH_REGISTRATION_OPEN=False, FRISIAN_MCP_OAUTH_PKCE_AUTO_REGISTER=False, FRISIAN_MCP_OAUTH_AUTO_APPROVE=False). The operator pre-registers every OAuth client via the Django admin; anonymous walk-up registration is not possible without an explicit opt-in.
  • The PKCE default permission tier is read. Mis-configurations cannot accidentally hand out write or admin scopes on first connect.
  • Permission-aware discovery (FRISIAN_MCP_PERMISSION_AWARE_DISCOVERY=True) rebuilds dispatcher action enums per-request — a read-tier token sees only list / retrieve actions, write and admin actions are hidden from tools/list rather than just blocked at execution.
  • .well-known discovery metadata is gated by FRISIAN_MCP_OAUTH_PUBLIC_DISCOVERY. With it set to False, the OAuth metadata endpoints return parseable JSON 404s so discovery-first MCP clients fall back to their configured Bearer instead of being routed into a dead-end OAuth cascade.
  • Authenticator chain ordering is no longer load-bearing for correctness — both FrisianMcpTokenAuthentication and OAuthTokenAuthentication return None on lookup-miss so either order works. Tokens-first is the recommended convention for the WWW-Authenticate challenge shape (see docs/Getting Started/getting-started.md).
  • SSE keepalive structure is documented, with a one-time runtime warning when the package detects it is running under a synchronous WSGI worker (which cannot scale SSE without starving the worker pool). The recommended deployment is an ASGI worker class (uvicorn.workers.UvicornWorker or uvicorn directly).

Authorize-path hardening

The unauthenticated OAuth authorize path (AUTO_REGISTER) is a walk-up surface: request inputs describe what the caller wants, never what the caller is permitted to do. See ADR-009 for the design rationale and the security guide for the threat model and recommended deployment patterns.

Per-route permission tiers

FRISIAN_MCP_ROUTES mounts read, read_write, and admin surfaces on separate paths, each with its own tool allow/deny list and tier ceiling on a deny-all baseline. A tool denied on a route does not exist there — it is absent from discovery and invocation, not merely rejected at call time. Misconfigurations are caught at startup; a route that would serve a privileged surface anonymously refuses to boot. See ADR-010 for the model and its security rationale.


Full documentation

Full settings reference, auth configuration, decorator API, middleware, pluggable backends, security guide, and troubleshooting are in docs/.

For browsable docs, a live MCP server, and the agent-consumable docs dispatcher (point your coding agent at it directly), visit https://frisian-mcp.com/.

來源:README.md,提交 3029db1

工具

4

docs

Start here — frisian-mcp documentation and server guide. Actions: about (server identity and links), getting_started (step-by-step adoption guide), integrations (Django/DRF config reference), security (auth model, OAuth, API keys, tiers), demo (explore the live demo endpoints), documents (browse all documentation articles), rag (semantic and full-text doc search).

輸入參數modepageactionparamspage_sizefilter_keyscontinuation_token

demo

Live working demo of frisian-mcp. Three capability groups: crm (contacts, companies, deals, tasks, memos), ops (automation, infrastructure, notifications, security, compliance), platform (analytics, data, reporting, integrations, users). All reads and writes are real and persistent.

輸入參數modepageactionparamspage_sizefilter_keyscontinuation_token

install

Installation guides for frisian-mcp integrations (Django framework tier). Actions: nautobot, netbox, paperless, edx. Each action returns the files changed to make the integration work, organised by version. Pass query for semantic search within the section.

輸入參數modepageactionparamspage_sizefilter_keyscontinuation_token

troubleshooting

Troubleshooting guides for frisian-mcp integrations (Django framework tier). Actions: nautobot, netbox, paperless, edx. Each action returns diagnostic guides and relevant files for that integration. Pass query for semantic search within the section.

輸入參數modepageactionparamspage_sizefilter_keyscontinuation_token

版本歷史

1
  1. v1.0.12最新Sep 16, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通必需25 分
  • 已宣告認證方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。