본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

AI MCP OAuth2 플러그인 구성 레퍼런스

원문 보기 위키 갱신

AI MCP OAuth2 플러그인 구성 레퍼런스 (AI MCP OAuth2 Plugin Configuration Reference)

이 문서는 AI MCP OAuth2 플러그인의 구성 옵션을 스키마 형태로 하나씩 정리한 레퍼런스예요. 인가 서버 지정, 인트로스펙션 응답 캐싱, 토큰 클레임을 업스트림 헤더로 매핑하는 방법, 클라이언트 인증 방식과 JWT 서명 알고리즘 같은 핵심 필드를 항목별로 확인할 수 있어요. MCP 인가를 활성화할 때는 설정된 metadata_endpoint가 같은 라우트로 커버되어야 인가가 올바르게 적용된다는 점도 꼭 기억해야 해요

출처: 문서

본문

{
  "properties": {
    "config": {
      "description": "The configuration for MCP authorization in OAuth2. If this is enabled, make sure the configured metadata_endpoint is also covered by the same route so the authorization can be applied correctly.",
      "properties": {
        "args": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Additional arguments to send in the POST body.",
          "type": "object"
        },
        "authorization_servers": {
          "items": {
            "description": "The authorization server identifier.",
            "type": "string"
          },
          "minLength": 1,
          "type": "array"
        },
        "cache_introspection": {
          "default": true,
          "description": "If enabled, the plugin will cache the introspection response for the access token. This can improve performance by reducing the number of introspection requests to the authorization server.",
          "type": "boolean"
        },
        "claim_to_header": {
          "description": "Map top-level token claims to upstream headers. Mutually exclusive with upstream_headers.",
          "items": {
            "properties": {
              "claim": {
                "description": "The claim name to be used in the access token.",
                "type": "string"
              },
              "header": {
                "description": "The HTTP header name to be used for forwarding the claim value to the upstream.",
                "type": "string"
              }
            },
            "required": [
              "claim",
              "header"
            ],
            "type": "object"
          },
          "minLength": 1,
          "type": "array"
        },
        "client_alg": {
          "description": "The client JWT signing algorithm.",
          "enum": [
            "ES256",
            "ES384",
            "ES512",
            "EdDSA",
            "HS256",
            "HS384",
            "HS512",
            "PS256",
            "PS384",
            "PS512",
            "RS256",
            "RS384",
            "RS512"
          ],
          "type": "string"
        },
        "client_auth": {
          "description": "The client authentication method.",
          "enum": [
            "client_secret_basic",
            "client_secret_jwt",
            "client_secret_post",
            "none",
            "private_key_jwt",
            "self_signed_tls_client_auth",
            "tls_client_auth"
          ],
          "type": "string"
        },
        "client_id": {
          "description": "The client ID for authentication. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).",
          "type": "string",
          "x-referenceable": true
        },
        "client_jwk": {
          "description": "The client JWK for private_key_jwt authentication. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
          "type": "string",
          "x-encrypted": true,
          "x-referenceable": true
        },
        "client_secret": {
          "description": "The client secret for authentication. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
          "type": "string",
          "x-encrypted": true,
          "x-referenceable": true
        },
        "consumer_by": {
          "default": [
            "custom_id",
            "username"
          ],
          "description": "Consumer fields used for mapping: - `id`: try to find the matching Consumer by `id` - `username`: try to find the matching Consumer by `username` - `custom_id`: try to find the matching Consumer by `custom_id`.",
          "items": {
            "enum": [
              "custom_id",
              "id",
              "username"
            ],
            "type": "string"
          },
          "minLength": 1,
          "type": "array"
        },
        "consumer_claim": {
          "description": "The claim used for consumer mapping. If multiple values are set, it means the claim is inside a nested object of the token payload.",
          "items": {
            "type": "string"
          },
          "minLength": 1,
          "type": "array"
        },
        "consumer_groups_claim": {
          "description": "The claim used for consumer groups mapping. If multiple values are set, it means the claim is inside a nested object of the token payload.",
          "items": {
            "type": "string"
          },
          "minLength": 1,
          "type": "array"
        },
        "consumer_groups_optional": {
          "default": false,
          "description": "Do not terminate the request if consumer groups mapping fails.",
          "type": "boolean"
        },
        "consumer_optional": {
          "default": false,
          "description": "Do not terminate the request if consumer mapping fails.",
          "type": "boolean"
        },
        "credential_claim": {
          "default": [
            "sub"
          ],
          "description": "The claim used to derive virtual credentials (e.g. to be consumed by the rate-limiting plugin), in case the consumer mapping is not used. If multiple values are set, it means the claim is inside a nested object of the token payload.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "headers": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Additional headers for the introspection request.",
          "type": "object"
        },
        "http_proxy": {
          "description": "HTTP proxy to use.",
          "type": "string"
        },
        "http_proxy_authorization": {
          "description": "HTTP proxy authorization header.",
          "type": "string"
        },
        "http_version": {
          "default": 1.1,
          "description": "The HTTP version used for requests.",
          "type": "number"
        },
        "https_proxy": {
          "description": "HTTPS proxy to use.",
          "type": "string"
        },
        "https_proxy_authorization": {
          "description": "HTTPS proxy authorization header.",
          "type": "string"
        },
        "insecure_relaxed_audience_validation": {
          "default": false,
          "description": "If enabled, the plugin will not validate the audience of the access token. Disable it if the authorization server does not correctly set the audience claim according to RFC 8707 and MCP specification.",
          "type": "boolean"
        },
        "introspection_endpoint": {
          "description": "The Token Introspection Endpoint. If not provided, the plugin will attempt to use JWKS to verify the token. If the token is opaque, this field must be provided.",
          "type": "string"
        },
        "introspection_format": {
          "description": "Controls introspection response format.",
          "enum": [
            "base64",
            "base64url",
            "string"
          ],
          "type": "string"
        },
        "jwks_cache_ttl": {
          "default": 3600,
          "description": "The cache TTL in seconds for JWKS.",
          "type": "integer"
        },
        "jwks_endpoint": {
          "description": "The JWKS endpoint URL for fetching the authorization server's public keys. If not provided, the plugin will attempt to discover it from the authorization server metadata.",
          "type": "string"
        },
        "jwt_claims_leeway": {
          "default": 0,
          "description": "The leeway in seconds for JWT claims validation (exp, nbf). This allows tokens that are slightly expired or not yet valid due to clock skew.",
          "type": "integer"
        },
        "keepalive": {
          "default": true,
          "description": "Enable HTTP keepalive for requests.",
          "type": "boolean"
        },
        "max_request_body_size": {
          "default": 1048576,
          "description": "max allowed body size allowed to be handled as MCP request. 0 means unlimited, but the size of this body will still be limited by Nginx's client_max_body_size.",
          "type": "integer"
        },
        "metadata_cache_ttl": {
          "default": 3600,
          "description": "The cache TTL in seconds for discovered authorization server metadata.",
          "type": "integer"
        },
        "metadata_discovery_endpoint": {
          "description": "Custom OAuth 2.0 authorization server metadata discovery URL. If provided, the plugin will use this URL directly instead of trying standard well-known discovery paths. The custom endpoint URL should end with either '/.well-known/openid-configuration' or '/.well-known/oauth-authorization-server'.",
          "type": "string"
        },
        "metadata_discovery_retry": {
          "default": 3,
          "description": "The number of retry attempts for metadata discovery requests per URL.",
          "type": "integer"
        },
        "metadata_endpoint": {
          "description": "The path for OAuth 2.0 Protected Resource Metadata. Default to $resource/.well-known/oauth-protected-resource. For example, if the configured resource is https://api.example.com/mcp, the metadata endpoint is /mcp/.well-known/oauth-protected-resource.",
          "type": "string"
        },
        "mtls_introspection_endpoint": {
          "description": "The mTLS alias for the introspection endpoint.",
          "type": "string"
        },
        "no_proxy": {
          "description": "Comma-separated list of hosts to exclude from proxy.",
          "type": "string"
        },
        "passthrough_credentials": {
          "default": false,
          "description": "Keep the credentials used for authentication in the request. If multiple credentials are sent with the same request, the plugin will keep those that were used for successful authentication.",
          "type": "boolean"
        },
        "resource": {
          "description": "The resource identifier.",
          "type": "string"
        },
        "scopes_supported": {
          "items": {
            "description": "Recommended scopes that are used in authorization requests to request access to this protected resource.",
            "type": "string"
          },
          "minLength": 1,
          "type": "array"
        },
        "ssl_verify": {
          "default": true,
          "description": "Verify the SSL certificate.",
          "type": "boolean"
        },
        "timeout": {
          "default": 10000,
          "description": "Network I/O timeout in milliseconds.",
          "type": "number"
        },
        "tls_client_auth_cert": {
          "description": "PEM-encoded client certificate for mTLS.",
          "type": "string"
        },
        "tls_client_auth_key": {
          "description": "PEM-encoded private key for mTLS.",
          "type": "string"
        },
        "tls_client_auth_ssl_verify": {
          "default": true,
          "description": "Verify server certificate in mTLS.",
          "type": "boolean"
        },
        "token_exchange": {
          "description": "Configuration details about token exchange that should happen before reaching upstream MCP server",
          "properties": {
            "cache": {
              "properties": {
                "enabled": {
                  "default": true,
                  "description": "Whether to cache exchanged token",
                  "type": "boolean"
                },
                "ttl": {
                  "default": 3600,
                  "description": "The default cache TTL to store exchanged token. If the exchange endpoint does not provide 'expires_in' data when token is exchanged this TTL value will be used to cache it.",
                  "type": "integer"
                }
              },
              "type": "object"
            },
            "client_auth": {
              "default": "client_secret_basic",
              "description": "The type of authentication method to use with the exchange endpoint. Use 'inherit' to use the same client_id, and secret as in introspection_endpoint.",
              "enum": [
                "client_secret_basic",
                "client_secret_post",
                "inherit",
                "none"
              ],
              "type": "string"
            },
            "client_id": {
              "description": "The client ID for authentication. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault).",
              "type": "string",
              "x-referenceable": true
            },
            "client_secret": {
              "description": "The client secret for authentication. \nThis field is [referenceable](/gateway/entities/vault/#how-do-i-reference-secrets-stored-in-a-vault). \nThis field is [encrypted](/gateway/keyring/).",
              "type": "string",
              "x-encrypted": true,
              "x-referenceable": true
            },
            "enabled": {
              "default": false,
              "description": "Whether Token Exchange should be enabled",
              "type": "boolean"
            },
            "request": {
              "properties": {
                "actor_token": {
                  "description": "Static actor token value (when source is config).",
                  "type": "string"
                },
                "actor_token_header": {
                  "description": "Header name containing actor token (when source is header).",
                  "type": "string"
                },
                "actor_token_source": {
                  "default": "none",
                  "description": "Where to obtain actor token.",
                  "enum": [
                    "config",
                    "header",
                    "none"
                  ],
                  "type": "string"
                },
                "actor_token_type": {
                  "default": "urn:ietf:params:oauth:token-type:access_token",
                  "description": "The token type identifier of actor token.",
                  "type": "string"
                },
                "audience": {
                  "description": "Audiences used in the token exchange request.",
                  "items": {
                    "type": "string"
                  },
                  "minLength": 1,
                  "type": "array"
                },
                "requested_token_type": {
                  "default": "urn:ietf:params:oauth:token-type:access_token",
                  "description": "The desired output token type.",
                  "type": "string"
                },
                "resource": {
                  "description": "The absolute URI of target MCP service where token will be used.",
                  "type": "string"
                },
                "scopes": {
                  "description": "Scopes used in the token exchange request.",
                  "items": {
                    "type": "string"
                  },
                  "minLength": 1,
                  "type": "array"
                },
                "subject_token_type": {
                  "default": "urn:ietf:params:oauth:token-type:access_token",
                  "description": "The type of token to be exchanged.",
                  "type": "string"
                }
              },
              "type": "object"
            },
            "token_endpoint": {
              "description": "The token exchange endopint.",
              "type": "string"
            }
          },
          "required": [
            "token_endpoint"
          ],
          "type": "object"
        },
        "upstream_headers": {
          "description": "Map token claims to upstream headers using path-based access. Each entry specifies a header name and a path (array of strings) to traverse the token claims. Mutually exclusive with claim_to_header.",
          "items": {
            "properties": {
              "header": {
                "description": "The name of the header.",
                "type": "string"
              },
              "path": {
                "description": "The path of the header value.",
                "items": {
                  "type": "string"
                },
                "minLength": 1,
                "type": "array"
              }
            },
            "required": [
              "header",
              "path"
            ],
            "type": "object"
          },
          "type": "array"
        }
      },
      "required": [
        "authorization_servers",
        "resource"
      ],
      "type": "object"
    },
    "expressions": {
      "additionalProperties": true,
      "type": "object"
    },
    "protocols": {
      "default": [
        "grpc",
        "grpcs",
        "http",
        "https"
      ],
      "description": "A set of strings representing HTTP protocols.",
      "items": {
        "enum": [
          "grpc",
          "grpcs",
          "http",
          "https"
        ],
        "type": "string"
      },
      "type": "array"
    },
    "route": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via the specified route. Leave unset for the plugin to activate regardless of the route being used.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "service": {
      "additionalProperties": false,
      "description": "If set, the plugin will only activate when receiving requests via one of the routes belonging to the specified Service. Leave unset for the plugin to activate regardless of the Service being matched.",
      "properties": {
        "id": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "required": [
    "config"
  ]
}

번역할 문서 내용이 아직 도착하지 않았어요. Kong 문서 조각(마크다운)을 붙여넣어 주시면, 규칙에 따라 해요체로 번역해 드릴게요.

관련 리소스

더 알아보기 (Learn more)

  • 구성 값에서 볼트에 저장된 시크릿을 참조하는 방법을 설명해요 — referenceable
  • 키링으로 민감한 구성 값을 암호화하는 방법을 소개해요 — encrypted
  • MCP 트래픽을 게이트웨이로 처리하는 전체 가이드를 확인해요 — MCP Traffic Gateway