Spec Driven Development
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
作者提供的说明(英文原文)
OAuth 2.1/OIDC resource-server reference for secure MCP authorization
这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。
我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。
选择你使用的 AI 应用,然后复制设置。
MCP_SERVER_RESOURCE_SERVER_URL, MCP_SERVER_AUTH_PROVIDER, MCP_SERVER_REQUIRED_SCOPES, MCP_SERVER_TRANSPORT_ALLOWED_HOSTS, MCP_SERVER_ENTRA_TENANT_ID, MCP_SERVER_ENTRA_AUDIENCE, MCP_SERVER_ENTRA_APPLICATION_ID_URI, MCP_SERVER_GENERIC_ISSUER_URL, MCP_SERVER_GENERIC_AUDIENCE, MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS你需要
你用的是哪个应用?
在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。
打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json
{
"mcpServers": {
"auth-template": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_SERVER_RESOURCE_SERVER_URL",
"-e",
"MCP_SERVER_AUTH_PROVIDER",
"-e",
"MCP_SERVER_REQUIRED_SCOPES",
"-e",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS",
"-e",
"MCP_SERVER_ENTRA_TENANT_ID",
"-e",
"MCP_SERVER_ENTRA_AUDIENCE",
"-e",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI",
"-e",
"MCP_SERVER_GENERIC_ISSUER_URL",
"-e",
"MCP_SERVER_GENERIC_AUDIENCE",
"-e",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS",
"ghcr.io/brunovicco/mcp-server-auth-template:v0.7.0"
],
"env": {
"MCP_SERVER_RESOURCE_SERVER_URL": "your-value",
"MCP_SERVER_AUTH_PROVIDER": "your-value",
"MCP_SERVER_REQUIRED_SCOPES": "your-value",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS": "your-value",
"MCP_SERVER_ENTRA_TENANT_ID": "your-value",
"MCP_SERVER_ENTRA_AUDIENCE": "your-value",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI": "your-value",
"MCP_SERVER_GENERIC_ISSUER_URL": "your-value",
"MCP_SERVER_GENERIC_AUDIENCE": "your-value",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS": "your-value"
}
}
}
}在终端中运行这条命令
claude mcp add auth-template --env MCP_SERVER_RESOURCE_SERVER_URL=your-value --env MCP_SERVER_AUTH_PROVIDER=your-value --env MCP_SERVER_REQUIRED_SCOPES=your-value --env MCP_SERVER_TRANSPORT_ALLOWED_HOSTS=your-value --env MCP_SERVER_ENTRA_TENANT_ID=your-value --env MCP_SERVER_ENTRA_AUDIENCE=your-value --env MCP_SERVER_ENTRA_APPLICATION_ID_URI=your-value --env MCP_SERVER_GENERIC_ISSUER_URL=your-value --env MCP_SERVER_GENERIC_AUDIENCE=your-value --env MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS=your-value -- docker run -i --rm -e MCP_SERVER_RESOURCE_SERVER_URL -e MCP_SERVER_AUTH_PROVIDER -e MCP_SERVER_REQUIRED_SCOPES -e MCP_SERVER_TRANSPORT_ALLOWED_HOSTS -e MCP_SERVER_ENTRA_TENANT_ID -e MCP_SERVER_ENTRA_AUDIENCE -e MCP_SERVER_ENTRA_APPLICATION_ID_URI -e MCP_SERVER_GENERIC_ISSUER_URL -e MCP_SERVER_GENERIC_AUDIENCE -e MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS ghcr.io/brunovicco/mcp-server-auth-template:v0.7.0运行前请先填写空着的值。
粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json
{
"mcpServers": {
"auth-template": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_SERVER_RESOURCE_SERVER_URL",
"-e",
"MCP_SERVER_AUTH_PROVIDER",
"-e",
"MCP_SERVER_REQUIRED_SCOPES",
"-e",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS",
"-e",
"MCP_SERVER_ENTRA_TENANT_ID",
"-e",
"MCP_SERVER_ENTRA_AUDIENCE",
"-e",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI",
"-e",
"MCP_SERVER_GENERIC_ISSUER_URL",
"-e",
"MCP_SERVER_GENERIC_AUDIENCE",
"-e",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS",
"ghcr.io/brunovicco/mcp-server-auth-template:v0.7.0"
],
"env": {
"MCP_SERVER_RESOURCE_SERVER_URL": "your-value",
"MCP_SERVER_AUTH_PROVIDER": "your-value",
"MCP_SERVER_REQUIRED_SCOPES": "your-value",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS": "your-value",
"MCP_SERVER_ENTRA_TENANT_ID": "your-value",
"MCP_SERVER_ENTRA_AUDIENCE": "your-value",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI": "your-value",
"MCP_SERVER_GENERIC_ISSUER_URL": "your-value",
"MCP_SERVER_GENERIC_AUDIENCE": "your-value",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
粘贴到项目中的 .vscode/mcp.json
{
"servers": {
"auth-template": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"MCP_SERVER_RESOURCE_SERVER_URL",
"-e",
"MCP_SERVER_AUTH_PROVIDER",
"-e",
"MCP_SERVER_REQUIRED_SCOPES",
"-e",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS",
"-e",
"MCP_SERVER_ENTRA_TENANT_ID",
"-e",
"MCP_SERVER_ENTRA_AUDIENCE",
"-e",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI",
"-e",
"MCP_SERVER_GENERIC_ISSUER_URL",
"-e",
"MCP_SERVER_GENERIC_AUDIENCE",
"-e",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS",
"ghcr.io/brunovicco/mcp-server-auth-template:v0.7.0"
],
"env": {
"MCP_SERVER_RESOURCE_SERVER_URL": "your-value",
"MCP_SERVER_AUTH_PROVIDER": "your-value",
"MCP_SERVER_REQUIRED_SCOPES": "your-value",
"MCP_SERVER_TRANSPORT_ALLOWED_HOSTS": "your-value",
"MCP_SERVER_ENTRA_TENANT_ID": "your-value",
"MCP_SERVER_ENTRA_AUDIENCE": "your-value",
"MCP_SERVER_ENTRA_APPLICATION_ID_URI": "your-value",
"MCP_SERVER_GENERIC_ISSUER_URL": "your-value",
"MCP_SERVER_GENERIC_AUDIENCE": "your-value",
"MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS": "your-value"
}
}
}
}浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。
这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。
你的选择通过 Cookie 保存在这台设备上,无需账户。
MCP_SERVER_REQUIRED_SCOPES envMCP_SERVER_TRANSPORT_ALLOWED_HOSTS envMCP_SERVER_ENTRA_TENANT_ID envMCP_SERVER_ENTRA_AUDIENCE envMCP_SERVER_ENTRA_APPLICATION_ID_URI envMCP_SERVER_GENERIC_ISSUER_URL envMCP_SERVER_GENERIC_AUDIENCE envMCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS env这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。
它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。
我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日
注册名称已通过 GitHub 账户 brunovicco 验证,该账户拥有此仓库
我们还没有从 GitHub 读取这个仓库
我们还没有从 GitHub 读取这个仓库
它在你的电脑上运行,没有互联网端点
在你的电脑上运行,改用本地设置
它在你的电脑上运行;我们只能读取互联网端点的工具列表
与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。
它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。
你需要填写:MCP_SERVER_RESOURCE_SERVER_URL, MCP_SERVER_AUTH_PROVIDER
它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。
GitHub 仓库最后更新于–,最新版本(0.7.0)于上个月进入注册中心。
支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Docker。
同一分类中有:Spec Driven Development, Remote Desktop Commander, LexPact UK Contracts
同一分类中其他作者的服务器,按星标数排序。
如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i
MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.
Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.
Generate UK-law contracts: NDA, service, freelance, recruiter terms of business, IR35.
按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。
*Leia em português*
A production-oriented OAuth 2.1 resource-server reference for remote MCP: Microsoft Entra ID and
generic OIDC, exact token/resource validation, fail-closed authorization, progressive scope
challenges, stateless MCP
2026-07-28, and metadata-only OpenTelemetry evidence.
Use this repository when the hard part is not "how do I expose an MCP tool?" but how do I expose it without weakening identity, authorization, transport, and observability boundaries. The server pairs with mcp-client-auth-template for an executable end-to-end reference using synthetic identities and no production credentials.
The paired executable path validates real resource-server behavior rather than configuration claims:
403 insufficient_scope is returned before dispatch for progressive authorization401, with an explicit token-resource policy that does not depend on MCP SDK defaultstools/list is filtered per principal and carries only bounded private cache hints2026-07-28 stays stateless and does not mint Mcp-Session-IdFor a requirement-by-requirement view of the paired OAuth/MCP behavior, including explicit evidence gaps and discussion topics for the MCP Authorization Interest Group / Tool Scopes Working Group, see the Authorization Implementer Report.
flowchart LR
Client["MCP client"] -->|"OAuth 2.1 / OIDC"| AS["Authorization server Entra ID or generic OIDC"] Client -->|"MCP 2026-07-28 resource-bound bearer"| Admission["Transport admission"] Admission --> AuthN["Token verification"] AuthN --> AuthZ["Tool authorization"] AuthZ --> Tools["MCP tools"] Server["This resource server"] --- Admission
Server -->|"OIDC discovery + cached JWKS"| AS Server -.->|"W3C trace context + OTLP"| Collector["OpenTelemetry Collector"] Collector --> Tempo["Tempo"] Tempo --> Grafana["Grafana"]
The authorization server owns login, consent, client registration and token issuance. This repository owns the protected resource: transport admission, metadata publication, access-token verification, request-scoped principal construction, tool authorization and dispatch.
For layer boundaries and the detailed authorization sequence, see Architecture.
The companion client owns the executable cross-repository reference flow. With both repositories cloned as siblings, verify this server directly from source:
cd ../mcp-client-auth-template
./scripts/run_reference_demo.sh \ --server-root ../mcp-server-auth-template
The flow starts the real server from this checkout plus a deterministic local OIDC provider and proves CIMD-first Authorization Code + PKCE, authenticated whoami, bounded scope step-up, wrong-audience rejection and stateless MCP behavior.
For the observable published-image proof:
cd ../mcp-client-auth-template
./scripts/run_observability_demo.sh --keep
The observable flow verifies one distributed trace across client and server, positive Collector receipt, Tempo retrieval, Grafana provisioning and telemetry privacy assertions.
See Verification guide for the exact evidence boundary.
The terminal proof below is captured from the source-level paired reference flow:
The trace screenshots are captured from a successful observable run and focus on mcp-server-auth-template spans:
| Profile | Intended use | Key behavior |
|---|---|---|
| Entra delegated | Interactive enterprise users | Validates scp, tenant/application identifiers, issuer, audience and subject |
| Entra application | Provider-specific app-only deployments | Requires explicit idtyp=app; keeps roles separate from delegated scopes |
| Generic OIDC delegated | Standards-based interactive clients | Validates issuer/audience/signature/expiry and OAuth scopes |
| Generic OIDC client credentials | Unattended services in the deterministic pair profile | Accepts pre-registered machine tokens and progressive OAuth scopes |
Set MCP_SERVER_AUTH_PROVIDER=entra or generic to switch adapters. The example whoami tool returns the verified caller identity; health requires the additional mcp:tools:health scope and demonstrates a pre-dispatch 403 insufficient_scope challenge.
Prerequisites: Python 3.13 or 3.14 and uv.
git clone https://github.com/brunovicco/mcp-server-auth-template.git
cd mcp-server-auth-template cp .env.example .env uv sync --frozen --all-groups uv run uvicorn mcp_server_auth_template.entrypoints.mcp_server:create_app --factory --reload
Configure either the Entra or generic-OIDC block in .env, then point an MCP client at http://localhost:8000/mcp.
| Endpoint | Purpose | Authentication |
|---|---|---|
/mcp | MCP Streamable HTTP | Bearer token |
/.well-known/oauth-protected-resource | Authorization-server discovery metadata | Public |
/livez | Process liveness | Public, minimal response |
/readyz | MCP lifespan readiness | Public, minimal response |
For production-style execution:
uv run python -m mcp_server_auth_template.entrypoints.serve
See Production operations before exposing the service outside loopback.
The server is published in the Official MCP Registry as:
io.github.brunovicco/mcp-server-auth-template@0.7.0
server.json describes the public GHCR image as an OCI package using the real streamable-http transport; it does not claim a hosted remotes endpoint. Publication is gated by the secure release pipeline and a dedicated Registry workflow that validates the immutable image, ownership metadata, and persisted Registry responses before publication.
See Official MCP Registry and the Authorization Implementer Report.
The implementation is deliberately fail closed:
validate_token_resource=False policy: provider audiences (Entra API client ID, api:// identifiers) are enforced by the token verifier, never by SDK URL string equality (ADR-0027);This is a transparent reference implementation, not a security certification. Read Privacy and data handling and the architecture decisions under docs/adr/ before adapting the boundary.
2026-07-28Baseline: MCP specification 2026-07-28 and MCP Python SDK >=2.2,<3.
The paired templates exercise the modern stateless profile as executable behavior:
server/discover and per-request _meta carry protocol version, client identity and capabilities without the legacy initialize / initialized handshake;MCP-Protocol-Version, Mcp-Method and Mcp-Name;Mcp-Session-Id;resource binds the access token audience exactly;server/discover and tools/list carry SEP-2549 cache hints (ttlMs=30000, cacheScope=private);403 insufficient_scope preserves prior grants and permits only one bounded replay of the undispatched operation;io.modelcontextprotocol/oauth-client-credentials.See Compatibility and the companion client's cross-repository E2E evidence.
a2a-otel-kit continues W3C trace context at the MCP ASGI boundary. Export remains network-silent unless A2A_OTEL_ENABLED=true and a complete OTLP traces endpoint are configured. Spans are metadata-only and sit inside hardened HTTP admission but outside authentication and tool dispatch.
See LLM and application observability.
| Reference evidence | Production adoption |
|---|---|
| Synthetic local OIDC in companion demo | Enterprise authorization server with reviewed registration and consent |
| Loopback/local reference networking | TLS-protected servic
只显示了开头部分;其余内容请在仓库中阅读