Skip to content
VS Code

MCP Server Auth Template for VS Code

io.github.brunovicco/mcp-server-auth-template

OAuth 2.1/OIDC resource-server reference for secure MCP authorization

client:VS Code transport:stdio runtime:oci

Install MCP Server Auth Template in VS Code

.vscode/mcp.json

{
  "inputs": [
    {
      "type": "promptString",
      "id": "mcp-server-resource-server-url",
      "description": "MCP_SERVER_RESOURCE_SERVER_URL",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-auth-provider",
      "description": "MCP_SERVER_AUTH_PROVIDER",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-required-scopes",
      "description": "MCP_SERVER_REQUIRED_SCOPES",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-transport-allowed-hosts",
      "description": "MCP_SERVER_TRANSPORT_ALLOWED_HOSTS",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-entra-tenant-id",
      "description": "MCP_SERVER_ENTRA_TENANT_ID",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-entra-audience",
      "description": "MCP_SERVER_ENTRA_AUDIENCE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-entra-application-id-uri",
      "description": "MCP_SERVER_ENTRA_APPLICATION_ID_URI",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-generic-issuer-url",
      "description": "MCP_SERVER_GENERIC_ISSUER_URL",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-generic-audience",
      "description": "MCP_SERVER_GENERIC_AUDIENCE",
      "password": true
    },
    {
      "type": "promptString",
      "id": "mcp-server-generic-jwks-allowed-origins",
      "description": "MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS",
      "password": true
    }
  ],
  "servers": {
    "mcp-server-auth-template": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "ghcr.io/brunovicco/mcp-server-auth-template:v0.7.0"
      ],
      "env": {
        "MCP_SERVER_RESOURCE_SERVER_URL": "${input:mcp-server-resource-server-url}",
        "MCP_SERVER_AUTH_PROVIDER": "${input:mcp-server-auth-provider}",
        "MCP_SERVER_REQUIRED_SCOPES": "${input:mcp-server-required-scopes}",
        "MCP_SERVER_TRANSPORT_ALLOWED_HOSTS": "${input:mcp-server-transport-allowed-hosts}",
        "MCP_SERVER_ENTRA_TENANT_ID": "${input:mcp-server-entra-tenant-id}",
        "MCP_SERVER_ENTRA_AUDIENCE": "${input:mcp-server-entra-audience}",
        "MCP_SERVER_ENTRA_APPLICATION_ID_URI": "${input:mcp-server-entra-application-id-uri}",
        "MCP_SERVER_GENERIC_ISSUER_URL": "${input:mcp-server-generic-issuer-url}",
        "MCP_SERVER_GENERIC_AUDIENCE": "${input:mcp-server-generic-audience}",
        "MCP_SERVER_GENERIC_JWKS_ALLOWED_ORIGINS": "${input:mcp-server-generic-jwks-allowed-origins}"
      }
    }
  }
}

VS Code prompts for each input the first time the server starts, so no secret is written to the file. VS Code docs

MCP Server Auth Template in other clients