diff --git a/.github/workflows/content-generation.yml b/.github/workflows/content-generation.yml index 562a000..24768a7 100644 --- a/.github/workflows/content-generation.yml +++ b/.github/workflows/content-generation.yml @@ -4,9 +4,10 @@ env: CONTENT_GENERATION_BRANCH_NAME: bot-generate-doc-contents on: - push: - branches: - - master + workflow_dispatch: # Temporarily disabled automatic execution + # push: + # branches: + # - master concurrency: group: content-generation-${{ github.ref }} diff --git a/docs/README.mdx b/docs/README.mdx index 6382c0c..26f530e 100644 --- a/docs/README.mdx +++ b/docs/README.mdx @@ -10,19 +10,16 @@ import Tabs from '@theme/Tabs'; ## Choose a compatible OAuth 2.1 or OpenID Connect provider \{#choose-a-compatible-oauth-2-1-or-openid-connect-provider} -MCP specification has some [specific requirements](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#1-3-standards-compliance) for authorization: +MCP specification has [specific requirements](https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization#standards-compliance) for authorization. The authorization mechanism is based on established specifications, implementing a selected subset of their features to ensure security and interoperability while maintaining simplicity: -- [OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12) +- OAuth 2.1 IETF DRAFT ([draft-ietf-oauth-v2-1-13](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-13)) - OAuth 2.0 Authorization Server Metadata ([RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414)) - OAuth 2.0 Dynamic Client Registration Protocol ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)) +- OAuth 2.0 Protected Resource Metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)) -While the last two are not mandatory, the first one is necessary to ensure a secure and compliant implementation. +These specifications work together to provide a secure and standardized authorization framework for MCP implementations. -:::note -In the new MCP draft, RFC 8414 will be mandated for authorization servers (providers). We'll update the documentation once the new draft is finalized. -::: - -You can check the [MCP-compatible provider list](./provider-list.mdx) to see if your provider is supported. +You can check the [MCP-compatible provider list](/provider-list) to see if your provider is supported. ## Install MCP Auth SDK \{#install-mcp-auth-sdk} @@ -51,7 +48,9 @@ Or any other package manager you prefer, such as pnpm or yarn. ## Init MCP Auth \{#init-mcp-auth} -The first step is to initialize the MCP Auth instance with your provider's authorization server metadata. If your provider conforms one of: +The first step is to define your resource identifier and configure the authorization server that will be trusted for authentication. MCP Auth now operates in resource server mode, conforming to the updated MCP specification that requires OAuth 2.0 Protected Resource Metadata (RFC 9728). + +If your provider conforms to: - [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) - [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) @@ -63,13 +62,25 @@ You can use the built-in function to fetch the metadata and initialize the MCP A ```python from mcpauth import MCPAuth -from mcpauth.config import AuthServerType +from mcpauth.config import AuthServerType, ResourceServerConfig, ResourceServerMetadata from mcpauth.utils import fetch_server_config +# 1. Define your resource identifier and fetch the config for its trusted authorization server. +resource_id = "https://api.example.com/notes" +auth_server_config = fetch_server_config("https://auth.logto.io/oidc", AuthServerType.OIDC) + +# 2. Initialize MCPAuth in resource server mode. +# `protected_resources` can be a single object or a list for multiple resources. mcp_auth = MCPAuth( - server=fetch_server_config( - '', - type=AuthServerType.OIDC # or AuthServerType.OAUTH + protected_resources=ResourceServerConfig( + metadata=ResourceServerMetadata( + resource=resource_id, + authorization_servers=[auth_server_config], + scopes_supported=[ + "read:notes", + "write:notes", + ], + ) ) ) ``` @@ -80,19 +91,46 @@ mcp_auth = MCPAuth( ```ts import { MCPAuth, fetchServerConfig } from 'mcp-auth'; +// 1. Define your resource identifier and fetch the config for its trusted authorization server. +const resourceIdentifier = 'https://api.example.com/notes'; +const authServerConfig = await fetchServerConfig('https://auth.logto.io/oidc', { type: 'oidc' }); + +// 2. Initialize MCPAuth in resource server mode. +// `protectedResources` can be a single object or an array for multiple resources. const mcpAuth = new MCPAuth({ - server: await fetchServerConfig('', { type: 'oidc' }), // or 'oauth' + protectedResources: [ + { + metadata: { + resource: resourceIdentifier, + authorizationServers: [authServerConfig], + scopesSupported: ['read:notes', 'write:notes'], + }, + }, + ], }); ``` -If you need to manually specify the metadata URL or endpoints, check [Other ways to initialize MCP Auth](./configure-server/mcp-auth.mdx#other-ways). +For other ways to configure authorization server metadata including custom metadata URLs, data transpilation, or manual metadata specification, check [Other ways to configure MCP Auth](./configure-server/mcp-auth.mdx#other-ways). + +## Mount the protected resource metadata endpoint \{#mount-the-protected-resource-metadata-endpoint} + +To conform to the updated MCP specification, MCP Auth mounts the OAuth 2.0 Protected Resource Metadata endpoint (RFC 9728) to your MCP server. This endpoint allows clients to discover: + +- Which authorization servers can issue valid tokens for your protected resources +- What scopes are supported for each resource +- Other metadata required for proper token validation + +The endpoint path is automatically determined by the path component of your resource identifier: -## Mount the metadata endpoint \{#mount-the-metadata-endpoint} +- **No path**: `https://api.example.com` → `/.well-known/oauth-protected-resource` +- **With path**: `https://api.example.com/notes` → `/.well-known/oauth-protected-resource/notes` -To conform to the current MCP specification, MCP Auth mounts the OAuth 2.0 Authorization Server Metadata endpoint (`/.well-known/oauth-authorization-server`) to your MCP server: +The MCP server now **serves as a resource server** that validates tokens and provides metadata about its protected resources, while relying entirely on external authorization servers for authentication and authorization. + +You can use the SDK provided method to mount this endpoint: @@ -100,8 +138,11 @@ To conform to the current MCP specification, MCP Auth mounts the OAuth 2.0 Autho ```python from starlette.applications import Starlette +# Mount the router to serve the Protected Resource Metadata. +# For resource "https://api.example.com" → endpoint: /.well-known/oauth-protected-resource +# For resource "https://api.example.com/notes" → endpoint: /.well-known/oauth-protected-resource/notes app = Starlette(routes=[ - mcp_auth.metadata_route(), + *mcp_auth.resource_metadata_router().routes, ]) ``` @@ -112,29 +153,24 @@ app = Starlette(routes=[ import express from 'express'; const app = express(); -app.use(mcpAuth.delegatedRouter()); + +// Mount the router to serve the Protected Resource Metadata. +// For resource "https://api.example.com" → endpoint: /.well-known/oauth-protected-resource +// For resource "https://api.example.com/notes" → endpoint: /.well-known/oauth-protected-resource/notes +app.use(mcpAuth.protectedResourceMetadataRouter()); ``` -The URLs in the metadata are kept as-is, so the role of authorization server is fully delegated to the provider. You can test the metadata endpoint by visiting `/.well-known/oauth-authorization-server` in your MCP server. - -### Why only the metadata endpoint? \{#why-only-the-metadata-endpoint} - -You may see the official SDKs provide an auth router that mounts authorization endpoints like `/authorize`, `/token`, etc. Here is why we don't do that: +## Use the Bearer auth middleware \{#use-the-bearer-auth-middleware} -1. Mounting only the metadata endpoint allows you to leverage the full capabilities of your provider without "reinventing the wheel" and injecting unnecessary complexity into your MCP server. -2. There's also an ongoing effort to shift the [MCP server's role to a resource server](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/205) and requires OAuth 2.0 Protected Resource Metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)). Which means that the MCP server will **not handle any authorization logic anymore** (including the metadata endpoint), but only serve as a resource server that relies on the provider for authentication and authorization. +Once the MCP Auth instance is initialized, you can apply the Bearer auth middleware to protect your MCP routes. The middleware now requires specifying which resource the endpoint belongs to, enabling proper token validation: -:::note -We will update MCP Auth to support the new MCP specification when it is finalized. In the meantime, you can use the current version which is compatible with the current specification. +:::note Audience Validation +The `audience` parameter is **required** by the OAuth 2.0 specification for secure token validation. However, it is currently **optional** to maintain compatibility with authorization servers that do not yet support resource identifiers. For security reasons, **please always include the audience parameter** when possible. Future versions will enforce audience validation as mandatory to fully comply with the specification. ::: -## Use the Bearer auth middleware \{#use-the-bearer-auth-middleware} - -Once the MCP Auth instance is initialized, you can apply the Bearer auth middleware to protect your MCP routes: - @@ -142,25 +178,22 @@ Once the MCP Auth instance is initialized, you can apply the Bearer auth middlew from starlette.applications import Starlette from starlette.middleware import Middleware from starlette.routing import Mount -from mcpauth import MCPAuth -from mcp.server.fastmcp import FastMCP -mcp = FastMCP() -mcp_auth = MCPAuth( - # Initialize with your auth server config +# Create the middleware to protect your MCP server with the resource-specific policy. +bearer_auth = Middleware(mcp_auth.bearer_auth_middleware('jwt', + resource=resource_id, + audience=resource_id, # Enable audience validation for security + required_scopes=['read:notes'] +)) + +# Mount the router to serve the Protected Resource Metadata and protect the MCP server. +app = Starlette( + routes=[ + *mcp_auth.resource_metadata_router().routes, + # Protect the MCP server with the Bearer auth middleware. + Mount("/", app=mcp.sse_app(), middleware=[bearer_auth]), + ], ) -bearer_auth = mcp_auth.bearer_auth_middleware( - "jwt", required_scopes=["read", "write"] -) - -app = Starlette(routes=[ - mcp_auth.metadata_route(), - Mount( - "/", - app=mcp.sse_app(), - middleware=[Middleware(bearer_auth)], - ), -]) ``` @@ -168,21 +201,34 @@ app = Starlette(routes=[ ```ts import express from 'express'; -import { MCPAuth } from 'mcp-auth'; const app = express(); -const server = new McpServer(/* ... */); -const mcpAuth = new MCPAuth({ - /* ... */ -}); -app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +// Mount the router to serve the Protected Resource Metadata. +app.use(mcpAuth.protectedResourceMetadataRouter()); + +// Protect an API endpoint using the resource-specific policy. +app.get( + '/notes', + mcpAuth.bearerAuth('jwt', { + resource: resourceIdentifier, + audience: resourceIdentifier, // Enable audience validation for security + requiredScopes: ['read:notes'], + }), + (req, res) => { + // If the token is valid, `req.auth` is populated with its claims. + console.log('Auth info:', req.auth); + res.json({ notes: [] }); + }, +); + +app.listen(3000); ``` -In the example above, we specified the `jwt` token type and required the `read` and `write` scopes. It will automatically validate the JWT (JSON Web Token) and populate an object with the authenticated user's information. +In the examples above, we specify the `jwt` token type and the resource identifier. The middleware will automatically validate the JWT token against the trusted authorization servers configured for that specific resource and populate the authenticated user's information. :::info Didn't hear about JWT (JSON Web Token) before? Don't worry, you can keep reading the documentation and we'll explain it when needed. You can also check [Auth Wiki](https://auth.wiki/jwt) for a quick introduction. @@ -203,9 +249,9 @@ MCP Auth will store the authenticated user's information in a context variable a from mcp.server.fastmcp import FastMCP mcp = FastMCP() -mcp_auth = MCPAuth( - # Initialize with your auth server config -) + +# Initialize with MCP Auth as shown in previous examples +# ... @mcp.tool() def add(a: int, b: int): @@ -229,6 +275,10 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; import { z } from 'zod'; const server = new McpServer(/* ... */); + +// Initialize with MCP Auth as shown in previous examples +// ... + server.tool('add', { a: z.number(), b: z.number() }, async ({ a, b }, { authInfo }) => { // Now you can use the `authInfo` object to access the authenticated information }); diff --git a/docs/configure-server/bearer-auth.mdx b/docs/configure-server/bearer-auth.mdx index 3887228..7d6fa14 100644 --- a/docs/configure-server/bearer-auth.mdx +++ b/docs/configure-server/bearer-auth.mdx @@ -8,11 +8,13 @@ import Tabs from '@theme/Tabs'; # Configure Bearer auth in MCP server -MCP Auth provides various ways to configure Bearer authorization in your MCP server: +With the latest MCP specification, your MCP server acts as a **Resource Server** that validates access tokens for protected resources. MCP Auth provides various ways to configure Bearer authorization: - [JWT (JSON Web Token)](https://auth.wiki/jwt) mode: A built-in authorization method that verifies JWTs with claim assertions. - Custom mode: Allows you to implement your own authorization logic. +The Bearer auth middleware now requires specifying which resource the endpoint belongs to, enabling proper token validation against the configured authorization servers. + ## Configure Bearer auth with JWT mode \{#configure-bearer-auth-with-jwt-mode} If your OAuth / OIDC provider issues JWTs for authorization, you can use the built-in JWT mode in MCP Auth. It verifies the JWT signature, expiration, and other claims you specify; then it populates the authentication information in the request context for further processing in your MCP implementation. @@ -35,7 +37,11 @@ mcp = FastMCP("MyMCPServer") mcp_auth = MCPAuth( # Initialize with your auth server config ) -bearer_auth = mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) # [!code highlight] +bearer_auth = mcp_auth.bearer_auth_middleware("jwt", + resource="https://api.example.com", # Specify which resource this endpoint belongs to + audience="https://api.example.com", # Enable audience validation for security + required_scopes=["read", "write"] # [!code highlight] +) app = Starlette( routes=[Mount('/', app=mcp.sse_app(), middleware=[Middleware(bearer_auth)])] @@ -53,7 +59,11 @@ const app = express(); const mcpAuth = new MCPAuth({ /* ... */ }); -const bearerAuth = mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] }); // [!code highlight] +const bearerAuth = mcpAuth.bearerAuth('jwt', { + resource: 'https://api.example.com', // Specify which resource this endpoint belongs to + audience: 'https://api.example.com', // Enable audience validation for security + requiredScopes: ['read', 'write'] // [!code highlight] +}); app.use('/mcp', bearerAuth, (req, res) => { // Now `req.auth` contains the auth info @@ -66,13 +76,15 @@ app.use('/mcp', bearerAuth, (req, res) => { In the example above, we specified that the JWT requires the `read` and `write` scopes. If the JWT does not contain **any** of these scopes, the request will be rejected with a 403 Forbidden error. -### Resource indicator validation (RFC 8707) \{#resource-indicator-validation-rfc-8707} +### Audience validation (RFC 8707) \{#audience-validation-rfc-8707} -If your provider is based on OIDC, or supports the [Resource Indicator](https://datatracker.ietf.org/doc/html/rfc8707) extension, you may also specify the `audience` option to validate the `aud` (audience) claim in the JWT. This is useful to ensure that the JWT is intended for your MCP server. +For secure token validation, you should always include audience validation by specifying the `audience` parameter. This validates the `aud` (audience) claim in the JWT to ensure that the token was specifically issued for your MCP server resource. -Check your provider's documentation to see if it supports the Resource Indicator extension and how to configure it. Some providers may use other terms like "audience", "API resource", or "API indicator" to refer to the same concept. +:::note Audience Validation +The `audience` parameter is **required** by the OAuth 2.0 specification for secure token validation. However, it is currently **optional** to maintain compatibility with authorization servers that do not yet support resource identifiers. For security reasons, **please always include the audience parameter** when possible. Future versions will enforce audience validation as mandatory to fully comply with the specification. +::: -Once the resource indicator is configured, you can specify it in the `bearerAuth` middleware: +The audience value should typically match your resource identifier: @@ -80,7 +92,8 @@ Once the resource indicator is configured, you can specify it in the `bearerAuth ```python bearer_auth = mcp_auth.bearer_auth_middleware( "jwt", - audience="https://api.example.com/mcp", # The expected audience for the JWT [!code highlight] + resource="https://api.example.com", # Specify which resource this endpoint belongs to + audience="https://api.example.com", # Enable audience validation for security [!code highlight] required_scopes=["read", "write"] ) ``` @@ -90,7 +103,8 @@ bearer_auth = mcp_auth.bearer_auth_middleware( ```ts const bearerAuth = mcpAuth.bearerAuth('jwt', { - audience: 'https://api.example.com/mcp', // The expected audience for the JWT [!code highlight] + resource: 'https://api.example.com', // Specify which resource this endpoint belongs to + audience: 'https://api.example.com', // Enable audience validation for security [!code highlight] requiredScopes: ['read', 'write'], }); ``` @@ -114,8 +128,9 @@ In Python SDK, we use [PyJWT](https://pyjwt.readthedocs.io/en/stable/) for JWT v ```python bearer_auth = mcp_auth.bearer_auth_middleware( "jwt", - audience="https://api.example.com/mcp", - required_scopes=["read", "write"] + resource="https://api.example.com", + audience="https://api.example.com", + required_scopes=["read", "write"], leeway=10, # Reduce clock skew by allowing 10 seconds leeway [!code highlight] ) ``` @@ -128,9 +143,10 @@ In Node.js SDK, we use [jose](https://github.com/panva/jose) library for JWT ver - `jwtVerify`: Options for the JWT verification process (`jwtVerify` function from `jose`). - `remoteJwtSet`: Options for fetching the remote JWT set (`createRemoteJWKSet` function from `jose`). -```ts {4-9} +```ts {5-10} const bearerAuth = mcpAuth.bearerAuth('jwt', { - audience: 'https://api.example.com/mcp', + resource: 'https://api.example.com', + audience: 'https://api.example.com', requiredScopes: ['read', 'write'], jwtVerify: { clockTolerance: 60, // Allow a 60 seconds clock skew @@ -170,6 +186,8 @@ async def custom_verification(token: str) -> AuthInfo: bearer_auth = mcp_auth.bearer_auth_middleware( custom_verification, + resource="https://api.example.com", + audience="https://api.example.com", # Enable audience validation for security required_scopes=["read", "write"] ) ``` @@ -187,7 +205,11 @@ const bearerAuth = mcpAuth.bearerAuth( } return info; // Return the auth info object }, - { requiredScopes: ['read', 'write'] } + { + resource: 'https://api.example.com', + audience: 'https://api.example.com', // Enable audience validation for security + requiredScopes: ['read', 'write'] + } ); ``` @@ -202,7 +224,11 @@ To protect your MCP server with Bearer auth, you need to apply the Bearer auth m ```python -bearer_auth = mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) +bearer_auth = mcp_auth.bearer_auth_middleware("jwt", + resource="https://api.example.com", + audience="https://api.example.com", # Enable audience validation for security + required_scopes=["read", "write"] +) app = Starlette( routes=[Mount('/', app=mcp.sse_app(), middleware=[Middleware(bearer_auth)])] ) @@ -213,7 +239,11 @@ app = Starlette( ```js const app = express(); -app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +app.use(mcpAuth.bearerAuth('jwt', { + resource: 'https://api.example.com', + audience: 'https://api.example.com', // Enable audience validation for security + requiredScopes: ['read', 'write'] +})); ``` diff --git a/docs/configure-server/mcp-auth.mdx b/docs/configure-server/mcp-auth.mdx index cb5b4cd..def4083 100644 --- a/docs/configure-server/mcp-auth.mdx +++ b/docs/configure-server/mcp-auth.mdx @@ -8,13 +8,17 @@ import Tabs from '@theme/Tabs'; # Configure MCP Auth in MCP server -To connect your MCP server to an OAuth 2.1 or OpenID Connect provider, you need to configure the MCP Auth instance. This involves initializing the instance with your provider's authorization server metadata and setting up the necessary authorization flows. +With the latest [MCP Specification (2025-06-18)](https://modelcontextprotocol.io/specification/2025-06-18), your MCP server acts as a **Resource Server** that validates access tokens issued by external authorization servers. -## Init MCP Auth \{#init-mcp-auth} +To configure MCP Auth, you need two main steps: +1. **Configure Authorization Server Metadata** - Define which authorization servers can issue valid tokens for your MCP server and guide MCP clients on where to obtain access tokens +2. **Configure Protected Resource Metadata** - Define your MCP server as a protected resource with supported scopes + +## Step 1: Configure Authorization Server Metadata \{#configure-authorization-server-metadata} ### Automatic metadata fetching \{#automatic-metadata-fetching} -The easiest way to initialize the MCP Auth instance is by using the built-in functions that fetch the metadata from a well-known URL. If your provider conforms to one of the following standards: +The easiest way to configure authorization server metadata is by using the built-in functions that fetch the metadata from well-known URLs. If your provider conforms to one of the following standards: - [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) - [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) @@ -25,14 +29,13 @@ You can use the `fetchServerConfig` to automatically retrieve the metadata by pr ```python -from mcpauth import MCPAuth -from mcpauth.config import AuthServerType, fetch_server_config +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config -mcp_auth = MCPAuth( - server=fetch_server_config( - '', - type=AuthServerType.OIDC # or AuthServerType.OAUTH - ) +# Fetch authorization server metadata +auth_server_config = fetch_server_config( + "https://auth.logto.io/oidc", + AuthServerType.OIDC # or AuthServerType.OAUTH ) ``` @@ -40,10 +43,10 @@ mcp_auth = MCPAuth( ```ts -import { MCPAuth, fetchServerConfig } from 'mcp-auth'; -const mcpAuth = new MCPAuth({ - server: await fetchServerConfig('', { type: 'oidc' }), // or 'oauth' -}); +import { fetchServerConfig } from 'mcp-auth'; + +// Fetch authorization server metadata +const authServerConfig = await fetchServerConfig('https://auth.logto.io/oidc', { type: 'oidc' }); // or 'oauth' ``` @@ -54,7 +57,7 @@ If your issuer includes a path, the behavior differs slightly between OAuth 2.0 - **OAuth 2.0**: The well-known URL is appended to the **domain** of the issuer. For example, if your issuer is `https://my-project.logto.app/oauth`, the well-known URL will be `https://auth.logto.io/.well-known/oauth-authorization-server/oauth`. - **OpenID Connect**: The well-known URL is appended directly to the **issuer**. For example, if your issuer is `https://my-project.logto.app/oidc`, the well-known URL will be `https://auth.logto.io/oidc/.well-known/openid-configuration`. -### Other ways to initialize MCP Auth \{#other-ways} +### Other ways to configure authorization server metadata \{#other-ways} #### Custom data transpilation \{#custom-data-transpilation} @@ -64,16 +67,13 @@ In some cases, the metadata returned by the provider may not conform to the expe ```python -from mcpauth import MCPAuth from mcpauth.config import AuthServerType from mcpauth.utils import fetch_server_config -mcp_auth = MCPAuth( - server=fetch_server_config( - '', - type=AuthServerType.OIDC, - transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] - ) +auth_server_config = fetch_server_config( + '', + type=AuthServerType.OIDC, + transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] ) ``` @@ -81,12 +81,11 @@ mcp_auth = MCPAuth( ```ts -import { MCPAuth, fetchServerConfig } from 'mcp-auth'; -const mcpAuth = new MCPAuth({ - server: await fetchServerConfig('', { - type: 'oidc', - transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] - }), +import { fetchServerConfig } from 'mcp-auth'; + +const authServerConfig = await fetchServerConfig('', { + type: 'oidc', + transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] }); ``` @@ -103,15 +102,12 @@ If your provider has a specific metadata URL rather than the standard ones, you ```python -from mcpauth import MCPAuth from mcpauth.config import AuthServerType from mcpauth.utils import fetch_server_config_by_well_known_url -mcp_auth = MCPAuth( - server=fetch_server_config_by_well_known_url( - '', - type=AuthServerType.OIDC # or AuthServerType.OAUTH - ) +auth_server_config = fetch_server_config_by_well_known_url( + '', + type=AuthServerType.OIDC # or AuthServerType.OAUTH ) ``` @@ -119,11 +115,9 @@ mcp_auth = MCPAuth( ```ts -import { MCPAuth, fetchServerConfigByWellKnownUrl } from 'mcp-auth'; +import { fetchServerConfigByWellKnownUrl } from 'mcp-auth'; -const mcpAuth = new MCPAuth({ - server: await fetchServerConfigByWellKnownUrl('', { type: 'oidc' }), // or 'oauth' -}); +const authServerConfig = await fetchServerConfigByWellKnownUrl('', { type: 'oidc' }); // or 'oauth' ``` @@ -137,15 +131,12 @@ In some cases, the provider response may be malformed or not conforming to the e ```python -from mcpauth import MCPAuth from mcpauth.config import AuthServerType, fetch_server_config_by_well_known_url -mcp_auth = MCPAuth( - server=fetch_server_config_by_well_known_url( - '', - type=AuthServerType.OIDC, - transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] - ) +auth_server_config = fetch_server_config_by_well_known_url( + '', + type=AuthServerType.OIDC, + transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] ) ``` @@ -153,11 +144,9 @@ mcp_auth = MCPAuth( ```ts -const mcpAuth = new MCPAuth({ - server: await fetchServerConfigByWellKnownUrl('', { - type: 'oidc', - transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] - }), +const authServerConfig = await fetchServerConfigByWellKnownUrl('', { + type: 'oidc', + transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] }); ``` @@ -172,17 +161,63 @@ If your provider does not support metadata fetching, you can manually provide th ```python -from mcpauth import MCPAuth from mcpauth.config import AuthServerConfig, AuthServerType, AuthorizationServerMetadata +auth_server_config = AuthServerConfig( + type=AuthServerType.OIDC, # or AuthServerType.OAUTH + metadata=AuthorizationServerMetadata( + issuer='', + authorization_endpoint='', + # ... other metadata fields + ), +) +``` + + + + +```ts +const authServerConfig = { + metadata: { + issuer: '', + // Metadata fields should be camelCase + authorizationEndpoint: '', + // ... other metadata fields + }, + type: 'oidc', // or 'oauth' +}; +``` + + + + +## Step 2: Configure Protected Resource Metadata \{#configure-protected-resource-metadata} + +After configuring the authorization server metadata, you need to initialize MCPAuth as a Resource Server by defining your protected resources metadata. + +This step follows the [RFC 9728 (OAuth 2.0 Protected Resource Metadata)](https://datatracker.ietf.org/doc/html/rfc9728) specification to describe your MCP server as a protected resource: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import ResourceServerConfig, ResourceServerMetadata + +# Define your resource identifier +resource_id = "https://api.example.com/notes" + +# Initialize MCPAuth in resource server mode mcp_auth = MCPAuth( - server=AuthServerConfig( - type=AuthServerType.OIDC, # or AuthServerType.OAUTH - metadata=AuthorizationServerMetadata( - issuer='', - authorization_endpoint='', - # ... other metadata fields - ), + protected_resources=ResourceServerConfig( + metadata=ResourceServerMetadata( + resource=resource_id, + authorization_servers=[auth_server_config], # Using the config from Step 1 + scopes_supported=[ + "read:notes", + "write:notes", + ], + ) ) ) ``` @@ -191,18 +226,65 @@ mcp_auth = MCPAuth( ```ts +import { MCPAuth } from 'mcp-auth'; + +// Define your resource identifier +const resourceIdentifier = 'https://api.example.com/notes'; + +// Initialize MCPAuth in resource server mode const mcpAuth = new MCPAuth({ - server: { - metadata: { - issuer: '', - // Metadata fields should be camelCase - authorizationEndpoint: '', - // ... other metadata fields + protectedResources: [ + { + metadata: { + resource: resourceIdentifier, + authorizationServers: [authServerConfig], // Using the config from Step 1 + scopesSupported: ['read:notes', 'write:notes'], + }, }, - type: 'oidc', // or 'oauth' - }, + ], }); ``` + +For multiple resources, you can provide an array of protected resources, each with their own metadata configuration. + +The configuration shown above covers the basic setup. For more advanced metadata parameters, see [RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728#name-protected-resource-metadata). + +## Step 3: Mount the protected resource metadata endpoint \{#mount-the-protected-resource-metadata-endpoint} + +Mount the router to serve the protected resource metadata endpoint. The endpoint path is automatically determined by the path component of your resource identifier: + +- **No path**: `https://api.example.com` → `/.well-known/oauth-protected-resource` +- **With path**: `https://api.example.com/notes` → `/.well-known/oauth-protected-resource/notes` + + + + +```python +from starlette.applications import Starlette +from mcpauth import MCPAuth + +mcp_auth = MCPAuth({/* ... */}) + +app = Starlette(routes=[ + *mcp_auth.resource_metadata_router().routes, +]) +``` + + + + +```ts +import express from 'express'; + +const app = express(); + +const mcpAuth = new MCPAuth({/* ... */}); + +app.use(mcpAuth.protectedResourceMetadataRouter()); +``` + + + diff --git a/docs/references/js/README.md b/docs/references/js/README.md index f0875b7..da3e1a5 100644 --- a/docs/references/js/README.md +++ b/docs/references/js/README.md @@ -4,7 +4,7 @@ sidebar_label: Node.js SDK # MCP Auth Node.js SDK reference -## Classes {#classes} +## Classes - [MCPAuth](/references/js/classes/MCPAuth.md) - [MCPAuthAuthServerError](/references/js/classes/MCPAuthAuthServerError.md) @@ -13,7 +13,7 @@ sidebar_label: Node.js SDK - [MCPAuthError](/references/js/classes/MCPAuthError.md) - [MCPAuthTokenVerificationError](/references/js/classes/MCPAuthTokenVerificationError.md) -## Type Aliases {#type-aliases} +## Type Aliases - [AuthorizationServerMetadata](/references/js/type-aliases/AuthorizationServerMetadata.md) - [AuthServerConfig](/references/js/type-aliases/AuthServerConfig.md) @@ -22,29 +22,36 @@ sidebar_label: Node.js SDK - [AuthServerConfigWarning](/references/js/type-aliases/AuthServerConfigWarning.md) - [AuthServerConfigWarningCode](/references/js/type-aliases/AuthServerConfigWarningCode.md) - [AuthServerErrorCode](/references/js/type-aliases/AuthServerErrorCode.md) +- [~~AuthServerModeConfig~~](/references/js/type-aliases/AuthServerModeConfig.md) - [AuthServerSuccessCode](/references/js/type-aliases/AuthServerSuccessCode.md) - [AuthServerType](/references/js/type-aliases/AuthServerType.md) - [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) - [BearerAuthErrorCode](/references/js/type-aliases/BearerAuthErrorCode.md) -- [BearerAuthJwtConfig](/references/js/type-aliases/BearerAuthJwtConfig.md) - [CamelCaseAuthorizationServerMetadata](/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md) +- [CamelCaseProtectedResourceMetadata](/references/js/type-aliases/CamelCaseProtectedResourceMetadata.md) - [MCPAuthBearerAuthErrorDetails](/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md) - [MCPAuthConfig](/references/js/type-aliases/MCPAuthConfig.md) - [MCPAuthTokenVerificationErrorCode](/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md) +- [ProtectedResourceMetadata](/references/js/type-aliases/ProtectedResourceMetadata.md) +- [ResourceServerModeConfig](/references/js/type-aliases/ResourceServerModeConfig.md) +- [ValidateIssuerFunction](/references/js/type-aliases/ValidateIssuerFunction.md) - [VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) - [VerifyAccessTokenMode](/references/js/type-aliases/VerifyAccessTokenMode.md) -## Variables {#variables} +## Variables - [authorizationServerMetadataSchema](/references/js/variables/authorizationServerMetadataSchema.md) - [authServerErrorDescription](/references/js/variables/authServerErrorDescription.md) - [bearerAuthErrorDescription](/references/js/variables/bearerAuthErrorDescription.md) - [camelCaseAuthorizationServerMetadataSchema](/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md) +- [camelCaseProtectedResourceMetadataSchema](/references/js/variables/camelCaseProtectedResourceMetadataSchema.md) +- [defaultValues](/references/js/variables/defaultValues.md) +- [protectedResourceMetadataSchema](/references/js/variables/protectedResourceMetadataSchema.md) - [serverMetadataPaths](/references/js/variables/serverMetadataPaths.md) - [tokenVerificationErrorDescription](/references/js/variables/tokenVerificationErrorDescription.md) - [validateServerConfig](/references/js/variables/validateServerConfig.md) -## Functions {#functions} +## Functions - [createVerifyJwt](/references/js/functions/createVerifyJwt.md) - [fetchServerConfig](/references/js/functions/fetchServerConfig.md) diff --git a/docs/references/js/classes/MCPAuth.md b/docs/references/js/classes/MCPAuth.md index d6f82db..fd84c38 100644 --- a/docs/references/js/classes/MCPAuth.md +++ b/docs/references/js/classes/MCPAuth.md @@ -4,17 +4,61 @@ sidebar_label: MCPAuth # Class: MCPAuth -The main class for the mcp-auth library, which provides methods to create routers and useful -handlers for authentication and authorization in MCP servers. +The main class for the mcp-auth library. It acts as a factory and registry for creating +authentication policies for your protected resources. -## See {#see} +It is initialized with your server configurations and provides a `bearerAuth` method +to generate Express middleware for token-based authentication. -[MCP Auth](https://mcp-auth.dev) for more information about the library and its -usage. +## Example -## Example {#example} +### Usage in `resource server` mode -An example integrating with a remote OIDC provider: +This is the recommended approach for new applications. + +```ts +import express from 'express'; +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const app = express(); + +const resourceIdentifier = 'https://api.example.com/notes'; +const authServerConfig = await fetchServerConfig('https://auth.logto.io/oidc', { type: 'oidc' }); + +const mcpAuth = new MCPAuth({ + // `protectedResources` can be a single configuration object or an array of them. + protectedResources: [ + { + metadata: { + resource: resourceIdentifier, + authorizationServers: [authServerConfig], + scopesSupported: ['read:notes', 'write:notes'], + }, + }, + ], +}); + +// Mount the router to handle Protected Resource Metadata +app.use(mcpAuth.protectedResourceMetadataRouter()); + +// Protect an API endpoint for the configured resource +app.get( + '/notes', + mcpAuth.bearerAuth('jwt', { + resource: resourceIdentifier, // Specify which resource this endpoint belongs to + audience: resourceIdentifier, // Optionally, validate the 'aud' claim + requiredScopes: ['read:notes'], + }), + (req, res) => { + console.log('Auth info:', req.auth); + res.json({ notes: [] }); + }, +); +``` + +### Legacy Usage in `authorization server` mode (Deprecated) + +This approach is supported for backward compatibility. ```ts import express from 'express'; @@ -28,10 +72,10 @@ const mcpAuth = new MCPAuth({ ), }); -// Mount the router to handle OAuth 2.0 Authorization Server Metadata +// Mount the router to handle legacy Authorization Server Metadata app.use(mcpAuth.delegatedRouter()); -// Use the Bearer auth handler the MCP route +// Protect an endpoint using the default policy app.get( '/mcp', mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] }), @@ -40,60 +84,57 @@ app.get( // Handle the MCP request here }, ); - -// Use the auth info in the MCP callback -server.tool( - 'add', - { a: z.number(), b: z.number() }, - async ({ a, b }, { authInfo }) => { - console.log('Auth Info:', authInfo); - // ... - }, -); ``` -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuth(config: MCPAuthConfig): MCPAuth; ``` -#### Parameters {#parameters} +Creates an instance of MCPAuth. +It validates the entire configuration upfront to fail fast on errors. + +#### Parameters -##### config {#config} +##### config [`MCPAuthConfig`](/references/js/type-aliases/MCPAuthConfig.md) -#### Returns {#returns} +The authentication configuration. + +#### Returns `MCPAuth` -## Properties {#properties} +## Properties -### config {#config} +### config ```ts readonly config: MCPAuthConfig; ``` -## Methods {#methods} +The authentication configuration. + +## Methods -### bearerAuth() {#bearerauth} +### bearerAuth() -#### Call Signature {#call-signature} +#### Call Signature ```ts -bearerAuth(verifyAccessToken: VerifyAccessTokenFunction, config?: Omit): RequestHandler; +bearerAuth(verifyAccessToken: VerifyAccessTokenFunction, config?: Omit): RequestHandler; ``` Creates a Bearer auth handler (Express middleware) that verifies the access token in the `Authorization` header of the request. -##### Parameters {#parameters} +##### Parameters -###### verifyAccessToken {#verifyaccesstoken} +###### verifyAccessToken [`VerifyAccessTokenFunction`](/references/js/type-aliases/VerifyAccessTokenFunction.md) @@ -106,9 +147,9 @@ verification result. [VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for the type definition of the `verifyAccessToken` function. -###### config? {#config} +###### config? -`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"verifyAccessToken"` \| `"issuer"`\> +`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"issuer"` \| `"verifyAccessToken"`\> Optional configuration for the Bearer auth handler. @@ -117,22 +158,22 @@ Optional configuration for the Bearer auth handler. [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the available configuration options (excluding `verifyAccessToken` and `issuer`). -##### Returns {#returns} +##### Returns `RequestHandler` An Express middleware function that verifies the access token and adds the verification result to the request object (`req.auth`). -##### See {#see} +##### See [handleBearerAuth](/references/js/functions/handleBearerAuth.md) for the implementation details and the extended types of the `req.auth` (`AuthInfo`) object. -#### Call Signature {#call-signature} +#### Call Signature ```ts -bearerAuth(mode: "jwt", config?: Omit & BearerAuthJwtConfig): RequestHandler; +bearerAuth(mode: "jwt", config?: Omit & VerifyJwtConfig): RequestHandler; ``` Creates a Bearer auth handler (Express middleware) that verifies the access token in the @@ -141,9 +182,9 @@ Creates a Bearer auth handler (Express middleware) that verifies the access toke In the `'jwt'` mode, the handler will create a JWT verification function using the JWK Set from the authorization server's JWKS URI. -##### Parameters {#parameters} +##### Parameters -###### mode {#mode} +###### mode `"jwt"` @@ -153,56 +194,60 @@ The mode of verification for the access token. Currently, only 'jwt' is supporte [VerifyAccessTokenMode](/references/js/type-aliases/VerifyAccessTokenMode.md) for the available modes. -###### config? {#config} +###### config? -`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"verifyAccessToken"` \| `"issuer"`\> & [`BearerAuthJwtConfig`](/references/js/type-aliases/BearerAuthJwtConfig.md) +`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"issuer"` \| `"verifyAccessToken"`\> & `VerifyJwtConfig` Optional configuration for the Bearer auth handler, including JWT verification options and remote JWK set options. **See** - - [BearerAuthJwtConfig](/references/js/type-aliases/BearerAuthJwtConfig.md) for the available configuration options for JWT + - VerifyJwtConfig for the available configuration options for JWT verification. - [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the available configuration options (excluding `verifyAccessToken` and `issuer`). -##### Returns {#returns} +##### Returns `RequestHandler` An Express middleware function that verifies the access token and adds the verification result to the request object (`req.auth`). -##### See {#see} +##### See [handleBearerAuth](/references/js/functions/handleBearerAuth.md) for the implementation details and the extended types of the `req.auth` (`AuthInfo`) object. -##### Throws {#throws} +##### Throws if the JWKS URI is not provided in the server metadata when using the `'jwt'` mode. *** -### delegatedRouter() {#delegatedrouter} +### ~~delegatedRouter()~~ ```ts delegatedRouter(): Router; ``` -Creates a delegated router that serves the OAuth 2.0 Authorization Server Metadata endpoint +Creates a delegated router for serving legacy OAuth 2.0 Authorization Server Metadata endpoint (`/.well-known/oauth-authorization-server`) with the metadata provided to the instance. -#### Returns {#returns} +#### Returns `Router` A router that serves the OAuth 2.0 Authorization Server Metadata endpoint with the metadata provided to the instance. -#### Example {#example} +#### Deprecated + +Use [protectedResourceMetadataRouter](/references/js/classes/MCPAuth.md#protectedresourcemetadatarouter) instead. + +#### Example ```ts import express from 'express'; @@ -212,3 +257,46 @@ const app = express(); const mcpAuth: MCPAuth; // Assume this is initialized app.use(mcpAuth.delegatedRouter()); ``` + +#### Throws + +If called in `resource server` mode. + +*** + +### protectedResourceMetadataRouter() + +```ts +protectedResourceMetadataRouter(): Router; +``` + +Creates a router that serves the OAuth 2.0 Protected Resource Metadata endpoint +for all configured resources. + +This router automatically creates the correct `.well-known` endpoints for each +resource identifier provided in your configuration. + +#### Returns + +`Router` + +A router that serves the OAuth 2.0 Protected Resource Metadata endpoint. + +#### Throws + +If called in `authorization server` mode. + +#### Example + +```ts +import express from 'express'; +import { MCPAuth } from 'mcp-auth'; + +// Assuming mcpAuth is initialized with one or more `protectedResources` configs +const mcpAuth: MCPAuth; +const app = express(); + +// This will serve metadata at `/.well-known/oauth-protected-resource/...` +// based on your resource identifiers. +app.use(mcpAuth.protectedResourceMetadataRouter()); +``` diff --git a/docs/references/js/classes/MCPAuthAuthServerError.md b/docs/references/js/classes/MCPAuthAuthServerError.md index 4b9c556..7ad8692 100644 --- a/docs/references/js/classes/MCPAuthAuthServerError.md +++ b/docs/references/js/classes/MCPAuthAuthServerError.md @@ -6,51 +6,51 @@ sidebar_label: MCPAuthAuthServerError Error thrown when there is an issue with the remote authorization server. -## Extends {#extends} +## Extends - [`MCPAuthError`](/references/js/classes/MCPAuthError.md) -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuthAuthServerError(code: AuthServerErrorCode, cause?: unknown): MCPAuthAuthServerError; ``` -#### Parameters {#parameters} +#### Parameters -##### code {#code} +##### code [`AuthServerErrorCode`](/references/js/type-aliases/AuthServerErrorCode.md) -##### cause? {#cause} +##### cause? `unknown` -#### Returns {#returns} +#### Returns `MCPAuthAuthServerError` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts readonly optional cause: unknown; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) *** -### code {#code} +### code ```ts readonly code: AuthServerErrorCode; @@ -58,141 +58,191 @@ readonly code: AuthServerErrorCode; The error code in snake_case format. -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) *** -### message {#message} +### message ```ts message: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) *** -### name {#name} +### name ```ts name: string = 'MCPAuthAuthServerError'; ``` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) *** -### stack? {#stack} +### stack? ```ts optional stack: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) *** -### prepareStackTrace()? {#preparestacktrace} +### stackTraceLimit ```ts -static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +static stackTraceLimit: number; ``` -Optional override for formatting stack traces +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). -#### Parameters {#parameters} +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. -##### err {#err} +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. -`Error` +#### Inherited from -##### stackTraces {#stacktraces} +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) -`CallSite`[] +## Methods -#### Returns {#returns} +### toJson() -`any` +```ts +toJson(showCause: boolean): Record; +``` -#### See {#see} +Converts the error to a HTTP response friendly JSON format. -https://v8.dev/docs/stack-trace-api#customizing-stack-traces +#### Parameters -#### Inherited from {#inherited-from} +##### showCause -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Inherited from + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) *** -### stackTraceLimit {#stacktracelimit} +### captureStackTrace() ```ts -static stackTraceLimit: number; +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` -#### Inherited from {#inherited-from} +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` -## Methods {#methods} +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. -### toJson() {#tojson} +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. -```ts -toJson(showCause: boolean): Record; +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); ``` -Converts the error to a HTTP response friendly JSON format. +#### Parameters -#### Parameters {#parameters} +##### targetObject -##### showCause {#showcause} +`object` -`boolean` = `false` +##### constructorOpt? -Whether to include the cause of the error in the JSON response. -Defaults to `false`. +`Function` -#### Returns {#returns} +#### Returns -`Record`\<`string`, `unknown`\> +`void` -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) *** -### captureStackTrace() {#capturestacktrace} +### prepareStackTrace() ```ts -static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` -Create .stack property on a target object +#### Parameters -#### Parameters {#parameters} +##### err -##### targetObject {#targetobject} +`Error` -`object` +##### stackTraces -##### constructorOpt? {#constructoropt} +`CallSite`[] -`Function` +#### Returns -#### Returns {#returns} +`any` -`void` +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) diff --git a/docs/references/js/classes/MCPAuthBearerAuthError.md b/docs/references/js/classes/MCPAuthBearerAuthError.md index 7990bdc..78c13de 100644 --- a/docs/references/js/classes/MCPAuthBearerAuthError.md +++ b/docs/references/js/classes/MCPAuthBearerAuthError.md @@ -6,51 +6,51 @@ sidebar_label: MCPAuthBearerAuthError Error thrown when there is an issue when authenticating with Bearer tokens. -## Extends {#extends} +## Extends - [`MCPAuthError`](/references/js/classes/MCPAuthError.md) -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuthBearerAuthError(code: BearerAuthErrorCode, cause?: MCPAuthBearerAuthErrorDetails): MCPAuthBearerAuthError; ``` -#### Parameters {#parameters} +#### Parameters -##### code {#code} +##### code [`BearerAuthErrorCode`](/references/js/type-aliases/BearerAuthErrorCode.md) -##### cause? {#cause} +##### cause? [`MCPAuthBearerAuthErrorDetails`](/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md) -#### Returns {#returns} +#### Returns `MCPAuthBearerAuthError` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts readonly optional cause: MCPAuthBearerAuthErrorDetails; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) *** -### code {#code} +### code ```ts readonly code: BearerAuthErrorCode; @@ -58,141 +58,191 @@ readonly code: BearerAuthErrorCode; The error code in snake_case format. -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) *** -### message {#message} +### message ```ts message: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) *** -### name {#name} +### name ```ts name: string = 'MCPAuthBearerAuthError'; ``` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) *** -### stack? {#stack} +### stack? ```ts optional stack: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) *** -### prepareStackTrace()? {#preparestacktrace} +### stackTraceLimit ```ts -static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +static stackTraceLimit: number; ``` -Optional override for formatting stack traces +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). -#### Parameters {#parameters} +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. -##### err {#err} +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. -`Error` +#### Inherited from -##### stackTraces {#stacktraces} +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) -`CallSite`[] +## Methods -#### Returns {#returns} +### toJson() -`any` +```ts +toJson(showCause: boolean): Record; +``` -#### See {#see} +Converts the error to a HTTP response friendly JSON format. -https://v8.dev/docs/stack-trace-api#customizing-stack-traces +#### Parameters -#### Inherited from {#inherited-from} +##### showCause -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Overrides + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) *** -### stackTraceLimit {#stacktracelimit} +### captureStackTrace() ```ts -static stackTraceLimit: number; +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` -#### Inherited from {#inherited-from} +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` -## Methods {#methods} +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. -### toJson() {#tojson} +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. -```ts -toJson(showCause: boolean): Record; +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); ``` -Converts the error to a HTTP response friendly JSON format. +#### Parameters -#### Parameters {#parameters} +##### targetObject -##### showCause {#showcause} +`object` -`boolean` = `false` +##### constructorOpt? -Whether to include the cause of the error in the JSON response. -Defaults to `false`. +`Function` -#### Returns {#returns} +#### Returns -`Record`\<`string`, `unknown`\> +`void` -#### Overrides {#overrides} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) *** -### captureStackTrace() {#capturestacktrace} +### prepareStackTrace() ```ts -static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` -Create .stack property on a target object +#### Parameters -#### Parameters {#parameters} +##### err -##### targetObject {#targetobject} +`Error` -`object` +##### stackTraces -##### constructorOpt? {#constructoropt} +`CallSite`[] -`Function` +#### Returns -#### Returns {#returns} +`any` -`void` +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) diff --git a/docs/references/js/classes/MCPAuthConfigError.md b/docs/references/js/classes/MCPAuthConfigError.md index 8047fdd..2740f34 100644 --- a/docs/references/js/classes/MCPAuthConfigError.md +++ b/docs/references/js/classes/MCPAuthConfigError.md @@ -6,55 +6,55 @@ sidebar_label: MCPAuthConfigError Error thrown when there is a configuration issue with mcp-auth. -## Extends {#extends} +## Extends - [`MCPAuthError`](/references/js/classes/MCPAuthError.md) -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuthConfigError(code: string, message: string): MCPAuthConfigError; ``` -#### Parameters {#parameters} +#### Parameters -##### code {#code} +##### code `string` The error code in snake_case format. -##### message {#message} +##### message `string` A human-readable description of the error. -#### Returns {#returns} +#### Returns `MCPAuthConfigError` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts optional cause: unknown; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) *** -### code {#code} +### code ```ts readonly code: string; @@ -62,141 +62,191 @@ readonly code: string; The error code in snake_case format. -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) *** -### message {#message} +### message ```ts message: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) *** -### name {#name} +### name ```ts name: string = 'MCPAuthConfigError'; ``` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) *** -### stack? {#stack} +### stack? ```ts optional stack: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) *** -### prepareStackTrace()? {#preparestacktrace} +### stackTraceLimit ```ts -static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +static stackTraceLimit: number; ``` -Optional override for formatting stack traces +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). -#### Parameters {#parameters} +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. -##### err {#err} +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. -`Error` +#### Inherited from -##### stackTraces {#stacktraces} +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) -`CallSite`[] +## Methods -#### Returns {#returns} +### toJson() -`any` +```ts +toJson(showCause: boolean): Record; +``` -#### See {#see} +Converts the error to a HTTP response friendly JSON format. -https://v8.dev/docs/stack-trace-api#customizing-stack-traces +#### Parameters -#### Inherited from {#inherited-from} +##### showCause -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Inherited from + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) *** -### stackTraceLimit {#stacktracelimit} +### captureStackTrace() ```ts -static stackTraceLimit: number; +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` -#### Inherited from {#inherited-from} +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` -## Methods {#methods} +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. -### toJson() {#tojson} +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. -```ts -toJson(showCause: boolean): Record; +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); ``` -Converts the error to a HTTP response friendly JSON format. +#### Parameters -#### Parameters {#parameters} +##### targetObject -##### showCause {#showcause} +`object` -`boolean` = `false` +##### constructorOpt? -Whether to include the cause of the error in the JSON response. -Defaults to `false`. +`Function` -#### Returns {#returns} +#### Returns -`Record`\<`string`, `unknown`\> +`void` -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) *** -### captureStackTrace() {#capturestacktrace} +### prepareStackTrace() ```ts -static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` -Create .stack property on a target object +#### Parameters -#### Parameters {#parameters} +##### err -##### targetObject {#targetobject} +`Error` -`object` +##### stackTraces -##### constructorOpt? {#constructoropt} +`CallSite`[] -`Function` +#### Returns -#### Returns {#returns} +`any` -`void` +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) diff --git a/docs/references/js/classes/MCPAuthError.md b/docs/references/js/classes/MCPAuthError.md index 6bffab7..80a58ff 100644 --- a/docs/references/js/classes/MCPAuthError.md +++ b/docs/references/js/classes/MCPAuthError.md @@ -8,58 +8,58 @@ Base class for all mcp-auth errors. It provides a standardized way to handle errors related to MCP authentication and authorization. -## Extends {#extends} +## Extends - `Error` -## Extended by {#extended-by} +## Extended by - [`MCPAuthConfigError`](/references/js/classes/MCPAuthConfigError.md) - [`MCPAuthAuthServerError`](/references/js/classes/MCPAuthAuthServerError.md) - [`MCPAuthBearerAuthError`](/references/js/classes/MCPAuthBearerAuthError.md) - [`MCPAuthTokenVerificationError`](/references/js/classes/MCPAuthTokenVerificationError.md) -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuthError(code: string, message: string): MCPAuthError; ``` -#### Parameters {#parameters} +#### Parameters -##### code {#code} +##### code `string` The error code in snake_case format. -##### message {#message} +##### message `string` A human-readable description of the error. -#### Returns {#returns} +#### Returns `MCPAuthError` -#### Overrides {#overrides} +#### Overrides ```ts Error.constructor ``` -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts optional cause: unknown; ``` -#### Inherited from {#inherited-from} +#### Inherited from ```ts Error.cause @@ -67,7 +67,7 @@ Error.cause *** -### code {#code} +### code ```ts readonly code: string; @@ -77,13 +77,13 @@ The error code in snake_case format. *** -### message {#message} +### message ```ts message: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from ```ts Error.message @@ -91,13 +91,13 @@ Error.message *** -### name {#name} +### name ```ts name: string = 'MCPAuthError'; ``` -#### Overrides {#overrides} +#### Overrides ```ts Error.name @@ -105,13 +105,13 @@ Error.name *** -### stack? {#stack} +### stack? ```ts optional stack: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from ```ts Error.stack @@ -119,101 +119,151 @@ Error.stack *** -### prepareStackTrace()? {#preparestacktrace} +### stackTraceLimit ```ts -static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +static stackTraceLimit: number; ``` -Optional override for formatting stack traces +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). -#### Parameters {#parameters} +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. -##### err {#err} +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. -`Error` +#### Inherited from -##### stackTraces {#stacktraces} +```ts +Error.stackTraceLimit +``` -`CallSite`[] +## Methods -#### Returns {#returns} +### toJson() -`any` +```ts +toJson(showCause: boolean): Record; +``` -#### See {#see} +Converts the error to a HTTP response friendly JSON format. -https://v8.dev/docs/stack-trace-api#customizing-stack-traces +#### Parameters -#### Inherited from {#inherited-from} +##### showCause -```ts -Error.prepareStackTrace -``` +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns + +`Record`\<`string`, `unknown`\> *** -### stackTraceLimit {#stacktracelimit} +### captureStackTrace() ```ts -static stackTraceLimit: number; +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` -#### Inherited from {#inherited-from} +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. -```ts -Error.stackTraceLimit +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` ``` -## Methods {#methods} +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. -### toJson() {#tojson} +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. -```ts -toJson(showCause: boolean): Record; +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); ``` -Converts the error to a HTTP response friendly JSON format. +#### Parameters -#### Parameters {#parameters} +##### targetObject -##### showCause {#showcause} +`object` -`boolean` = `false` +##### constructorOpt? -Whether to include the cause of the error in the JSON response. -Defaults to `false`. +`Function` -#### Returns {#returns} +#### Returns -`Record`\<`string`, `unknown`\> +`void` + +#### Inherited from + +```ts +Error.captureStackTrace +``` *** -### captureStackTrace() {#capturestacktrace} +### prepareStackTrace() ```ts -static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` -Create .stack property on a target object +#### Parameters -#### Parameters {#parameters} +##### err -##### targetObject {#targetobject} +`Error` -`object` +##### stackTraces + +`CallSite`[] -##### constructorOpt? {#constructoropt} +#### Returns -`Function` +`any` -#### Returns {#returns} +#### See -`void` +https://v8.dev/docs/stack-trace-api#customizing-stack-traces -#### Inherited from {#inherited-from} +#### Inherited from ```ts -Error.captureStackTrace +Error.prepareStackTrace ``` diff --git a/docs/references/js/classes/MCPAuthTokenVerificationError.md b/docs/references/js/classes/MCPAuthTokenVerificationError.md index 78be151..8fb2936 100644 --- a/docs/references/js/classes/MCPAuthTokenVerificationError.md +++ b/docs/references/js/classes/MCPAuthTokenVerificationError.md @@ -6,51 +6,51 @@ sidebar_label: MCPAuthTokenVerificationError Error thrown when there is an issue when verifying tokens. -## Extends {#extends} +## Extends - [`MCPAuthError`](/references/js/classes/MCPAuthError.md) -## Constructors {#constructors} +## Constructors -### Constructor {#constructor} +### Constructor ```ts new MCPAuthTokenVerificationError(code: MCPAuthTokenVerificationErrorCode, cause?: unknown): MCPAuthTokenVerificationError; ``` -#### Parameters {#parameters} +#### Parameters -##### code {#code} +##### code [`MCPAuthTokenVerificationErrorCode`](/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md) -##### cause? {#cause} +##### cause? `unknown` -#### Returns {#returns} +#### Returns `MCPAuthTokenVerificationError` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts readonly optional cause: unknown; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) *** -### code {#code} +### code ```ts readonly code: MCPAuthTokenVerificationErrorCode; @@ -58,141 +58,191 @@ readonly code: MCPAuthTokenVerificationErrorCode; The error code in snake_case format. -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) *** -### message {#message} +### message ```ts message: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) *** -### name {#name} +### name ```ts name: string = 'MCPAuthTokenVerificationError'; ``` -#### Overrides {#overrides} +#### Overrides [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) *** -### stack? {#stack} +### stack? ```ts optional stack: string; ``` -#### Inherited from {#inherited-from} +#### Inherited from [`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) *** -### prepareStackTrace()? {#preparestacktrace} +### stackTraceLimit ```ts -static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +static stackTraceLimit: number; ``` -Optional override for formatting stack traces +The `Error.stackTraceLimit` property specifies the number of stack frames +collected by a stack trace (whether generated by `new Error().stack` or +`Error.captureStackTrace(obj)`). -#### Parameters {#parameters} +The default value is `10` but may be set to any valid JavaScript number. Changes +will affect any stack trace captured _after_ the value has been changed. -##### err {#err} +If set to a non-number value, or set to a negative number, stack traces will +not capture any frames. -`Error` +#### Inherited from -##### stackTraces {#stacktraces} +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) -`CallSite`[] +## Methods -#### Returns {#returns} +### toJson() -`any` +```ts +toJson(showCause: boolean): Record; +``` -#### See {#see} +Converts the error to a HTTP response friendly JSON format. -https://v8.dev/docs/stack-trace-api#customizing-stack-traces +#### Parameters -#### Inherited from {#inherited-from} +##### showCause -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns + +`Record`\<`string`, `unknown`\> + +#### Inherited from + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) *** -### stackTraceLimit {#stacktracelimit} +### captureStackTrace() ```ts -static stackTraceLimit: number; +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; ``` -#### Inherited from {#inherited-from} +Creates a `.stack` property on `targetObject`, which when accessed returns +a string representing the location in the code at which +`Error.captureStackTrace()` was called. -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) +```js +const myObject = {}; +Error.captureStackTrace(myObject); +myObject.stack; // Similar to `new Error().stack` +``` -## Methods {#methods} +The first line of the trace will be prefixed with +`${myObject.name}: ${myObject.message}`. -### toJson() {#tojson} +The optional `constructorOpt` argument accepts a function. If given, all frames +above `constructorOpt`, including `constructorOpt`, will be omitted from the +generated stack trace. -```ts -toJson(showCause: boolean): Record; +The `constructorOpt` argument is useful for hiding implementation +details of error generation from the user. For instance: + +```js +function a() { + b(); +} + +function b() { + c(); +} + +function c() { + // Create an error without stack trace to avoid calculating the stack trace twice. + const { stackTraceLimit } = Error; + Error.stackTraceLimit = 0; + const error = new Error(); + Error.stackTraceLimit = stackTraceLimit; + + // Capture the stack trace above function b + Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace + throw error; +} + +a(); ``` -Converts the error to a HTTP response friendly JSON format. +#### Parameters -#### Parameters {#parameters} +##### targetObject -##### showCause {#showcause} +`object` -`boolean` = `false` +##### constructorOpt? -Whether to include the cause of the error in the JSON response. -Defaults to `false`. +`Function` -#### Returns {#returns} +#### Returns -`Record`\<`string`, `unknown`\> +`void` -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) *** -### captureStackTrace() {#capturestacktrace} +### prepareStackTrace() ```ts -static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +static prepareStackTrace(err: Error, stackTraces: CallSite[]): any; ``` -Create .stack property on a target object +#### Parameters -#### Parameters {#parameters} +##### err -##### targetObject {#targetobject} +`Error` -`object` +##### stackTraces -##### constructorOpt? {#constructoropt} +`CallSite`[] -`Function` +#### Returns -#### Returns {#returns} +`any` -`void` +#### See + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces -#### Inherited from {#inherited-from} +#### Inherited from -[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) diff --git a/docs/references/js/functions/createVerifyJwt.md b/docs/references/js/functions/createVerifyJwt.md index c7126e8..1746416 100644 --- a/docs/references/js/functions/createVerifyJwt.md +++ b/docs/references/js/functions/createVerifyJwt.md @@ -11,9 +11,9 @@ function createVerifyJwt(getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): V Creates a function to verify JWT access tokens using the provided key retrieval function and options. -## Parameters {#parameters} +## Parameters -### getKey {#getkey} +### getKey `JWTVerifyGetKey` @@ -23,7 +23,7 @@ The function to retrieve the key used to verify the JWT. JWTVerifyGetKey for the type definition of the key retrieval function. -### options? {#options} +### options? `JWTVerifyOptions` @@ -33,7 +33,7 @@ Optional JWT verification options. JWTVerifyOptions for the type definition of the options. -## Returns {#returns} +## Returns [`VerifyAccessTokenFunction`](/references/js/type-aliases/VerifyAccessTokenFunction.md) @@ -42,6 +42,6 @@ the token is valid. It requires the JWT to contain the fields `iss`, `client_id` its payload, and it can optionally contain `scope` or `scopes` fields. The function uses the `jose` library under the hood to perform the JWT verification. -## See {#see} +## See [VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for the type definition of the returned function. diff --git a/docs/references/js/functions/fetchServerConfig.md b/docs/references/js/functions/fetchServerConfig.md index 2c9f186..aeb7c25 100644 --- a/docs/references/js/functions/fetchServerConfig.md +++ b/docs/references/js/functions/fetchServerConfig.md @@ -13,27 +13,27 @@ Fetches the server configuration according to the issuer and authorization serve This function automatically determines the well-known URL based on the server type, as OAuth and OpenID Connect servers have different conventions for their metadata endpoints. -## Parameters {#parameters} +## Parameters -### issuer {#issuer} +### issuer `string` The issuer URL of the authorization server. -### config {#config} +### config `ServerMetadataConfig` The configuration object containing the server type and optional transpile function. -## Returns {#returns} +## Returns `Promise`\<[`AuthServerConfig`](/references/js/type-aliases/AuthServerConfig.md)\> A promise that resolves to the server configuration. -## See {#see} +## See - [fetchServerConfigByWellKnownUrl](/references/js/functions/fetchServerConfigByWellKnownUrl.md) for the underlying implementation. - [https://www.rfc-editor.org/rfc/rfc8414](https://www.rfc-editor.org/rfc/rfc8414) for the OAuth 2.0 Authorization Server Metadata @@ -41,7 +41,7 @@ specification. - [https://openid.net/specs/openid-connect-discovery-1\_0.html](https://openid.net/specs/openid-connect-discovery-1_0.html) for the OpenID Connect Discovery specification. -## Example {#example} +## Example ```ts import { fetchServerConfig } from 'mcp-auth'; @@ -54,11 +54,11 @@ const oauthConfig = await fetchServerConfig('https://auth.logto.io/oauth', { typ const oidcConfig = await fetchServerConfig('https://auth.logto.io/oidc', { type: 'oidc' }); ``` -## Throws {#throws} +## Throws if the fetch operation fails. -## Throws {#throws} +## Throws if the server metadata is invalid or does not match the MCP specification. diff --git a/docs/references/js/functions/fetchServerConfigByWellKnownUrl.md b/docs/references/js/functions/fetchServerConfigByWellKnownUrl.md index 7ab45db..92b6902 100644 --- a/docs/references/js/functions/fetchServerConfigByWellKnownUrl.md +++ b/docs/references/js/functions/fetchServerConfigByWellKnownUrl.md @@ -15,32 +15,32 @@ If the server metadata does not conform to the expected schema, but you are sure compatible, you can define a `transpileData` function to transform the metadata into the expected format. -## Parameters {#parameters} +## Parameters -### wellKnownUrl {#wellknownurl} +### wellKnownUrl The well-known URL to fetch the server configuration from. This can be a string or a URL object. `string` | `URL` -### config {#config} +### config `ServerMetadataConfig` The configuration object containing the server type and optional transpile function. -## Returns {#returns} +## Returns `Promise`\<[`AuthServerConfig`](/references/js/type-aliases/AuthServerConfig.md)\> A promise that resolves to the server configuration. -## Throws {#throws} +## Throws if the fetch operation fails. -## Throws {#throws} +## Throws if the server metadata is invalid or does not match the MCP specification. diff --git a/docs/references/js/functions/handleBearerAuth.md b/docs/references/js/functions/handleBearerAuth.md index ddb403e..1b1e42c 100644 --- a/docs/references/js/functions/handleBearerAuth.md +++ b/docs/references/js/functions/handleBearerAuth.md @@ -23,20 +23,20 @@ if not, it responds with an appropriate error message. AuthInfo interface defined in the `@modelcontextprotocol/sdk` module. See the extended interface in this file for details. -## Parameters {#parameters} +## Parameters -### param0 {#param0} +### param0 [`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md) Configuration for the Bearer auth handler. -## Returns {#returns} +## Returns `RequestHandler` A middleware function for Express that handles Bearer auth. -## See {#see} +## See [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the configuration options. diff --git a/docs/references/js/type-aliases/AuthServerConfig.md b/docs/references/js/type-aliases/AuthServerConfig.md index 8166bf3..8402def 100644 --- a/docs/references/js/type-aliases/AuthServerConfig.md +++ b/docs/references/js/type-aliases/AuthServerConfig.md @@ -13,9 +13,9 @@ type AuthServerConfig = { Configuration for the remote authorization server integrated with the MCP server. -## Properties {#properties} +## Properties -### metadata {#metadata} +### metadata ```ts metadata: CamelCaseAuthorizationServerMetadata; @@ -31,14 +31,14 @@ directly in the configuration if the server does not support such endpoints. **Note:** The metadata should be in camelCase format as per preferred by the mcp-auth library. -#### See {#see} +#### See - [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) - [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) *** -### type {#type} +### type ```ts type: AuthServerType; @@ -46,6 +46,6 @@ type: AuthServerType; The type of the authorization server. -#### See {#see} +#### See [AuthServerType](/references/js/type-aliases/AuthServerType.md) for the possible values. diff --git a/docs/references/js/type-aliases/AuthServerConfigError.md b/docs/references/js/type-aliases/AuthServerConfigError.md index 05371c1..926e985 100644 --- a/docs/references/js/type-aliases/AuthServerConfigError.md +++ b/docs/references/js/type-aliases/AuthServerConfigError.md @@ -14,9 +14,9 @@ type AuthServerConfigError = { Represents an error that occurs during the validation of the authorization server metadata. -## Properties {#properties} +## Properties -### cause? {#cause} +### cause? ```ts optional cause: Error; @@ -26,7 +26,7 @@ An optional cause of the error, typically an instance of `Error` that provides m *** -### code {#code} +### code ```ts code: AuthServerConfigErrorCode; @@ -36,7 +36,7 @@ The code representing the specific validation error. *** -### description {#description} +### description ```ts description: string; diff --git a/docs/references/js/type-aliases/AuthServerConfigWarning.md b/docs/references/js/type-aliases/AuthServerConfigWarning.md index f093e35..42a33f7 100644 --- a/docs/references/js/type-aliases/AuthServerConfigWarning.md +++ b/docs/references/js/type-aliases/AuthServerConfigWarning.md @@ -13,9 +13,9 @@ type AuthServerConfigWarning = { Represents a warning that occurs during the validation of the authorization server metadata. -## Properties {#properties} +## Properties -### code {#code} +### code ```ts code: AuthServerConfigWarningCode; @@ -25,7 +25,7 @@ The code representing the specific validation warning. *** -### description {#description} +### description ```ts description: string; diff --git a/docs/references/js/type-aliases/AuthServerModeConfig.md b/docs/references/js/type-aliases/AuthServerModeConfig.md new file mode 100644 index 0000000..6cb5594 --- /dev/null +++ b/docs/references/js/type-aliases/AuthServerModeConfig.md @@ -0,0 +1,31 @@ +--- +sidebar_label: AuthServerModeConfig +--- + +# Type Alias: ~~AuthServerModeConfig~~ + +```ts +type AuthServerModeConfig = { + server: AuthServerConfig; +}; +``` + +Configuration for the legacy, MCP server as authorization server mode. + +## Deprecated + +Use `ResourceServerModeConfig` config instead. + +## Properties + +### ~~server~~ + +```ts +server: AuthServerConfig; +``` + +The single authorization server configuration. + +#### Deprecated + +Use `protectedResources` config instead. diff --git a/docs/references/js/type-aliases/AuthorizationServerMetadata.md b/docs/references/js/type-aliases/AuthorizationServerMetadata.md index 5b7f0a7..1bbf982 100644 --- a/docs/references/js/type-aliases/AuthorizationServerMetadata.md +++ b/docs/references/js/type-aliases/AuthorizationServerMetadata.md @@ -22,7 +22,7 @@ type AuthorizationServerMetadata = { revocation_endpoint?: string; revocation_endpoint_auth_methods_supported?: string[]; revocation_endpoint_auth_signing_alg_values_supported?: string[]; - scope_supported?: string[]; + scopes_supported?: string[]; service_documentation?: string; token_endpoint: string; token_endpoint_auth_methods_supported?: string[]; @@ -34,9 +34,9 @@ type AuthorizationServerMetadata = { Schema for OAuth 2.0 Authorization Server Metadata as defined in RFC 8414. -## Type declaration {#type-declaration} +## Type declaration -### authorization\_endpoint {#authorization-endpoint} +### authorization\_endpoint ```ts authorization_endpoint: string; @@ -45,11 +45,11 @@ authorization_endpoint: string; URL of the authorization server's authorization endpoint [[RFC6749](https://rfc-editor.org/rfc/rfc6749)]. This is REQUIRED unless no grant types are supported that use the authorization endpoint. -#### See {#see} +#### See https://rfc-editor.org/rfc/rfc6749#section-3.1 -### code\_challenge\_methods\_supported? {#code-challenge-methods-supported} +### code\_challenge\_methods\_supported? ```ts optional code_challenge_methods_supported: string[]; @@ -59,7 +59,7 @@ JSON array containing a list of Proof Key for Code Exchange (PKCE) [[RFC7636](https://www.rfc-editor.org/rfc/rfc7636)] code challenge methods supported by this authorization server. -### grant\_types\_supported? {#grant-types-supported} +### grant\_types\_supported? ```ts optional grant_types_supported: string[]; @@ -70,7 +70,7 @@ supports. The array values used are the same as those used with the `grant_types defined by "OAuth 2.0 Dynamic Client Registration Protocol" [[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. If omitted, the default value is `["authorization_code", "implicit"]`. -### introspection\_endpoint? {#introspection-endpoint} +### introspection\_endpoint? ```ts optional introspection_endpoint: string; @@ -79,19 +79,19 @@ optional introspection_endpoint: string; URL of the authorization server's OAuth 2.0 introspection endpoint [[RFC7662](https://www.rfc-editor.org/rfc/rfc7662)]. -### introspection\_endpoint\_auth\_methods\_supported? {#introspection-endpoint-auth-methods-supported} +### introspection\_endpoint\_auth\_methods\_supported? ```ts optional introspection_endpoint_auth_methods_supported: string[]; ``` -### introspection\_endpoint\_auth\_signing\_alg\_values\_supported? {#introspection-endpoint-auth-signing-alg-values-supported} +### introspection\_endpoint\_auth\_signing\_alg\_values\_supported? ```ts optional introspection_endpoint_auth_signing_alg_values_supported: string[]; ``` -### issuer {#issuer} +### issuer ```ts issuer: string; @@ -100,7 +100,7 @@ issuer: string; The authorization server's issuer identifier, which is a URL that uses the `https` scheme and has no query or fragment components. -### jwks\_uri? {#jwks-uri} +### jwks\_uri? ```ts optional jwks_uri: string; @@ -110,19 +110,19 @@ URL of the authorization server's JWK Set [[JWK](https://www.rfc-editor.org/rfc/ document. The referenced document contains the signing key(s) the client uses to validate signatures from the authorization server. This URL MUST use the `https` scheme. -### op\_policy\_uri? {#op-policy-uri} +### op\_policy\_uri? ```ts optional op_policy_uri: string; ``` -### op\_tos\_uri? {#op-tos-uri} +### op\_tos\_uri? ```ts optional op_tos_uri: string; ``` -### registration\_endpoint? {#registration-endpoint} +### registration\_endpoint? ```ts optional registration_endpoint: string; @@ -131,7 +131,7 @@ optional registration_endpoint: string; URL of the authorization server's OAuth 2.0 Dynamic Client Registration endpoint [[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. -### response\_modes\_supported? {#response-modes-supported} +### response\_modes\_supported? ```ts optional response_modes_supported: string[]; @@ -146,7 +146,7 @@ If omitted, the default is `["query", "fragment"]`. The response mode value `"fo also defined in "OAuth 2.0 Form Post Response Mode" [[OAuth.FormPost](https://datatracker.ietf.org/doc/html/rfc8414#ref-OAuth.Post)]. -### response\_types\_supported {#response-types-supported} +### response\_types\_supported ```ts response_types_supported: string[]; @@ -157,7 +157,7 @@ server supports. The array values used are the same as those used with the `resp parameter defined by "OAuth 2.0 Dynamic Client Registration Protocol" [[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. -### revocation\_endpoint? {#revocation-endpoint} +### revocation\_endpoint? ```ts optional revocation_endpoint: string; @@ -166,31 +166,35 @@ optional revocation_endpoint: string; URL of the authorization server's OAuth 2.0 revocation endpoint [[RFC7009](https://www.rfc-editor.org/rfc/rfc7009)]. -### revocation\_endpoint\_auth\_methods\_supported? {#revocation-endpoint-auth-methods-supported} +### revocation\_endpoint\_auth\_methods\_supported? ```ts optional revocation_endpoint_auth_methods_supported: string[]; ``` -### revocation\_endpoint\_auth\_signing\_alg\_values\_supported? {#revocation-endpoint-auth-signing-alg-values-supported} +### revocation\_endpoint\_auth\_signing\_alg\_values\_supported? ```ts optional revocation_endpoint_auth_signing_alg_values_supported: string[]; ``` -### scope\_supported? {#scope-supported} +### scopes\_supported? ```ts -optional scope_supported: string[]; +optional scopes_supported: string[]; ``` -### service\_documentation? {#service-documentation} +JSON array containing a list of the OAuth 2.0 `scope` values that this authorization server +supports. +[[RFC8414](https://datatracker.ietf.org/doc/html/rfc8414#section-2)] + +### service\_documentation? ```ts optional service_documentation: string; ``` -### token\_endpoint {#token-endpoint} +### token\_endpoint ```ts token_endpoint: string; @@ -199,29 +203,29 @@ token_endpoint: string; URL of the authorization server's token endpoint [[RFC6749](https://rfc-editor.org/rfc/rfc6749)]. This is REQUIRED unless only the implicit grant type is supported. -#### See {#see} +#### See https://rfc-editor.org/rfc/rfc6749#section-3.2 -### token\_endpoint\_auth\_methods\_supported? {#token-endpoint-auth-methods-supported} +### token\_endpoint\_auth\_methods\_supported? ```ts optional token_endpoint_auth_methods_supported: string[]; ``` -### token\_endpoint\_auth\_signing\_alg\_values\_supported? {#token-endpoint-auth-signing-alg-values-supported} +### token\_endpoint\_auth\_signing\_alg\_values\_supported? ```ts optional token_endpoint_auth_signing_alg_values_supported: string[]; ``` -### ui\_locales\_supported? {#ui-locales-supported} +### ui\_locales\_supported? ```ts optional ui_locales_supported: string[]; ``` -### userinfo\_endpoint? {#userinfo-endpoint} +### userinfo\_endpoint? ```ts optional userinfo_endpoint: string; @@ -230,6 +234,6 @@ optional userinfo_endpoint: string; URL of the OpenID Connect [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). This endpoint is used to retrieve information about the authenticated user. -## See {#see} +## See https://datatracker.ietf.org/doc/html/rfc8414 diff --git a/docs/references/js/type-aliases/BearerAuthConfig.md b/docs/references/js/type-aliases/BearerAuthConfig.md index 50652be..82bb23e 100644 --- a/docs/references/js/type-aliases/BearerAuthConfig.md +++ b/docs/references/js/type-aliases/BearerAuthConfig.md @@ -7,16 +7,18 @@ sidebar_label: BearerAuthConfig ```ts type BearerAuthConfig = { audience?: string; - issuer: string; + issuer: | string + | ValidateIssuerFunction; requiredScopes?: string[]; + resource?: string; showErrorDetails?: boolean; verifyAccessToken: VerifyAccessTokenFunction; }; ``` -## Properties {#properties} +## Properties -### audience? {#audience} +### audience? ```ts optional audience: string; @@ -28,24 +30,34 @@ The expected audience of the access token (`aud` claim). This is typically the r **Note:** If your authorization server does not support Resource Indicators (RFC 8707), you can omit this field since the audience may not be relevant. -#### See {#see} +#### See https://datatracker.ietf.org/doc/html/rfc8707 *** -### issuer {#issuer} +### issuer ```ts -issuer: string; +issuer: + | string + | ValidateIssuerFunction; ``` -The expected issuer of the access token (`iss` claim). This should be the URL of the -authorization server that issued the token. +A string representing a valid issuer, or a function for validating the issuer of the access token. + +If a string is provided, it will be used as the expected issuer value for direct comparison. + +If a function is provided, it should validate the issuer according to the rules in +[ValidateIssuerFunction](/references/js/type-aliases/ValidateIssuerFunction.md). + +#### See + +[ValidateIssuerFunction](/references/js/type-aliases/ValidateIssuerFunction.md) for more details about the validation function. *** -### requiredScopes? {#requiredscopes} +### requiredScopes? ```ts optional requiredScopes: string[]; @@ -61,7 +73,19 @@ if available. *** -### showErrorDetails? {#showerrordetails} +### resource? + +```ts +optional resource: string; +``` + +The identifier of the protected resource. When provided, the handler will use the +authorization servers configured for this resource to validate the received token. +It's required when using the handler with a `protectedResources` configuration. + +*** + +### showErrorDetails? ```ts optional showErrorDetails: boolean; @@ -71,7 +95,7 @@ Whether to show detailed error information in the response. This is useful for d during development, but should be disabled in production to avoid leaking sensitive information. -#### Default {#default} +#### Default ```ts false @@ -79,7 +103,7 @@ false *** -### verifyAccessToken {#verifyaccesstoken} +### verifyAccessToken ```ts verifyAccessToken: VerifyAccessTokenFunction; @@ -90,6 +114,6 @@ Function type for verifying an access token. This function should throw an [MCPAuthTokenVerificationError](/references/js/classes/MCPAuthTokenVerificationError.md) if the token is invalid, or return an AuthInfo object if the token is valid. -#### See {#see} +#### See [VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for more details. diff --git a/docs/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/docs/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md index 637138a..630f7dd 100644 --- a/docs/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md +++ b/docs/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md @@ -22,7 +22,7 @@ type CamelCaseAuthorizationServerMetadata = { revocationEndpoint?: string; revocationEndpointAuthMethodsSupported?: string[]; revocationEndpointAuthSigningAlgValuesSupported?: string[]; - scopeSupported?: string[]; + scopesSupported?: string[]; serviceDocumentation?: string; tokenEndpoint: string; tokenEndpointAuthMethodsSupported?: string[]; @@ -34,146 +34,146 @@ type CamelCaseAuthorizationServerMetadata = { The camelCase version of the OAuth 2.0 Authorization Server Metadata type. -## Type declaration {#type-declaration} +## Type declaration -### authorizationEndpoint {#authorizationendpoint} +### authorizationEndpoint ```ts authorizationEndpoint: string; ``` -### codeChallengeMethodsSupported? {#codechallengemethodssupported} +### codeChallengeMethodsSupported? ```ts optional codeChallengeMethodsSupported: string[]; ``` -### grantTypesSupported? {#granttypessupported} +### grantTypesSupported? ```ts optional grantTypesSupported: string[]; ``` -### introspectionEndpoint? {#introspectionendpoint} +### introspectionEndpoint? ```ts optional introspectionEndpoint: string; ``` -### introspectionEndpointAuthMethodsSupported? {#introspectionendpointauthmethodssupported} +### introspectionEndpointAuthMethodsSupported? ```ts optional introspectionEndpointAuthMethodsSupported: string[]; ``` -### introspectionEndpointAuthSigningAlgValuesSupported? {#introspectionendpointauthsigningalgvaluessupported} +### introspectionEndpointAuthSigningAlgValuesSupported? ```ts optional introspectionEndpointAuthSigningAlgValuesSupported: string[]; ``` -### issuer {#issuer} +### issuer ```ts issuer: string; ``` -### jwksUri? {#jwksuri} +### jwksUri? ```ts optional jwksUri: string; ``` -### opPolicyUri? {#oppolicyuri} +### opPolicyUri? ```ts optional opPolicyUri: string; ``` -### opTosUri? {#optosuri} +### opTosUri? ```ts optional opTosUri: string; ``` -### registrationEndpoint? {#registrationendpoint} +### registrationEndpoint? ```ts optional registrationEndpoint: string; ``` -### responseModesSupported? {#responsemodessupported} +### responseModesSupported? ```ts optional responseModesSupported: string[]; ``` -### responseTypesSupported {#responsetypessupported} +### responseTypesSupported ```ts responseTypesSupported: string[]; ``` -### revocationEndpoint? {#revocationendpoint} +### revocationEndpoint? ```ts optional revocationEndpoint: string; ``` -### revocationEndpointAuthMethodsSupported? {#revocationendpointauthmethodssupported} +### revocationEndpointAuthMethodsSupported? ```ts optional revocationEndpointAuthMethodsSupported: string[]; ``` -### revocationEndpointAuthSigningAlgValuesSupported? {#revocationendpointauthsigningalgvaluessupported} +### revocationEndpointAuthSigningAlgValuesSupported? ```ts optional revocationEndpointAuthSigningAlgValuesSupported: string[]; ``` -### scopeSupported? {#scopesupported} +### scopesSupported? ```ts -optional scopeSupported: string[]; +optional scopesSupported: string[]; ``` -### serviceDocumentation? {#servicedocumentation} +### serviceDocumentation? ```ts optional serviceDocumentation: string; ``` -### tokenEndpoint {#tokenendpoint} +### tokenEndpoint ```ts tokenEndpoint: string; ``` -### tokenEndpointAuthMethodsSupported? {#tokenendpointauthmethodssupported} +### tokenEndpointAuthMethodsSupported? ```ts optional tokenEndpointAuthMethodsSupported: string[]; ``` -### tokenEndpointAuthSigningAlgValuesSupported? {#tokenendpointauthsigningalgvaluessupported} +### tokenEndpointAuthSigningAlgValuesSupported? ```ts optional tokenEndpointAuthSigningAlgValuesSupported: string[]; ``` -### uiLocalesSupported? {#uilocalessupported} +### uiLocalesSupported? ```ts optional uiLocalesSupported: string[]; ``` -### userinfoEndpoint? {#userinfoendpoint} +### userinfoEndpoint? ```ts optional userinfoEndpoint: string; ``` -## See {#see} +## See [AuthorizationServerMetadata](/references/js/type-aliases/AuthorizationServerMetadata.md) for the original type and field information. diff --git a/docs/references/js/type-aliases/CamelCaseProtectedResourceMetadata.md b/docs/references/js/type-aliases/CamelCaseProtectedResourceMetadata.md new file mode 100644 index 0000000..f12fabb --- /dev/null +++ b/docs/references/js/type-aliases/CamelCaseProtectedResourceMetadata.md @@ -0,0 +1,123 @@ +--- +sidebar_label: CamelCaseProtectedResourceMetadata +--- + +# Type Alias: CamelCaseProtectedResourceMetadata + +```ts +type CamelCaseProtectedResourceMetadata = { + authorizationDetailsTypesSupported?: string[]; + authorizationServers?: string[]; + bearerMethodsSupported?: string[]; + dpopBoundAccessTokensRequired?: boolean; + dpopSigningAlgValuesSupported?: string[]; + jwksUri?: string; + resource: string; + resourceDocumentation?: string; + resourceName?: string; + resourcePolicyUri?: string; + resourceSigningAlgValuesSupported?: string[]; + resourceTosUri?: string; + scopesSupported?: string[]; + signedMetadata?: string; + tlsClientCertificateBoundAccessTokens?: boolean; +}; +``` + +The camelCase version of the OAuth 2.0 Protected Resource Metadata type. + +## Type declaration + +### authorizationDetailsTypesSupported? + +```ts +optional authorizationDetailsTypesSupported: string[]; +``` + +### authorizationServers? + +```ts +optional authorizationServers: string[]; +``` + +### bearerMethodsSupported? + +```ts +optional bearerMethodsSupported: string[]; +``` + +### dpopBoundAccessTokensRequired? + +```ts +optional dpopBoundAccessTokensRequired: boolean; +``` + +### dpopSigningAlgValuesSupported? + +```ts +optional dpopSigningAlgValuesSupported: string[]; +``` + +### jwksUri? + +```ts +optional jwksUri: string; +``` + +### resource + +```ts +resource: string; +``` + +### resourceDocumentation? + +```ts +optional resourceDocumentation: string; +``` + +### resourceName? + +```ts +optional resourceName: string; +``` + +### resourcePolicyUri? + +```ts +optional resourcePolicyUri: string; +``` + +### resourceSigningAlgValuesSupported? + +```ts +optional resourceSigningAlgValuesSupported: string[]; +``` + +### resourceTosUri? + +```ts +optional resourceTosUri: string; +``` + +### scopesSupported? + +```ts +optional scopesSupported: string[]; +``` + +### signedMetadata? + +```ts +optional signedMetadata: string; +``` + +### tlsClientCertificateBoundAccessTokens? + +```ts +optional tlsClientCertificateBoundAccessTokens: boolean; +``` + +## See + +[ProtectedResourceMetadata](/references/js/type-aliases/ProtectedResourceMetadata.md) for the original type and field information. diff --git a/docs/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/docs/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md index 9961d48..d3ae27f 100644 --- a/docs/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md +++ b/docs/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md @@ -14,9 +14,9 @@ type MCPAuthBearerAuthErrorDetails = { }; ``` -## Properties {#properties} +## Properties -### actual? {#actual} +### actual? ```ts optional actual: unknown; @@ -24,7 +24,7 @@ optional actual: unknown; *** -### cause? {#cause} +### cause? ```ts optional cause: unknown; @@ -32,7 +32,7 @@ optional cause: unknown; *** -### expected? {#expected} +### expected? ```ts optional expected: unknown; @@ -40,7 +40,7 @@ optional expected: unknown; *** -### missingScopes? {#missingscopes} +### missingScopes? ```ts optional missingScopes: string[]; @@ -48,7 +48,7 @@ optional missingScopes: string[]; *** -### uri? {#uri} +### uri? ```ts optional uri: URL; diff --git a/docs/references/js/type-aliases/MCPAuthConfig.md b/docs/references/js/type-aliases/MCPAuthConfig.md index 1d06689..52bed28 100644 --- a/docs/references/js/type-aliases/MCPAuthConfig.md +++ b/docs/references/js/type-aliases/MCPAuthConfig.md @@ -5,19 +5,10 @@ sidebar_label: MCPAuthConfig # Type Alias: MCPAuthConfig ```ts -type MCPAuthConfig = { - server: AuthServerConfig; -}; +type MCPAuthConfig = + | AuthServerModeConfig + | ResourceServerModeConfig; ``` -Config for the [MCPAuth](/references/js/classes/MCPAuth.md) class. - -## Properties {#properties} - -### server {#server} - -```ts -server: AuthServerConfig; -``` - -Config for the remote authorization server. +Config for the [MCPAuth](/references/js/classes/MCPAuth.md) class, supporting either a single legacy `authorization server` +or the `resource server` configuration. diff --git a/docs/references/js/type-aliases/ProtectedResourceMetadata.md b/docs/references/js/type-aliases/ProtectedResourceMetadata.md new file mode 100644 index 0000000..6e13cb4 --- /dev/null +++ b/docs/references/js/type-aliases/ProtectedResourceMetadata.md @@ -0,0 +1,157 @@ +--- +sidebar_label: ProtectedResourceMetadata +--- + +# Type Alias: ProtectedResourceMetadata + +```ts +type ProtectedResourceMetadata = { + authorization_details_types_supported?: string[]; + authorization_servers?: string[]; + bearer_methods_supported?: string[]; + dpop_bound_access_tokens_required?: boolean; + dpop_signing_alg_values_supported?: string[]; + jwks_uri?: string; + resource: string; + resource_documentation?: string; + resource_name?: string; + resource_policy_uri?: string; + resource_signing_alg_values_supported?: string[]; + resource_tos_uri?: string; + scopes_supported?: string[]; + signed_metadata?: string; + tls_client_certificate_bound_access_tokens?: boolean; +}; +``` + +Schema for OAuth 2.0 Protected Resource Metadata. + +## Type declaration + +### authorization\_details\_types\_supported? + +```ts +optional authorization_details_types_supported: string[]; +``` + +Authorization details type values supported when using the authorization_details request parameter. + +### authorization\_servers? + +```ts +optional authorization_servers: string[]; +``` + +List of OAuth authorization server issuer identifiers that can be used with this protected resource. + +### bearer\_methods\_supported? + +```ts +optional bearer_methods_supported: string[]; +``` + +Supported methods for sending OAuth 2.0 bearer tokens. Values: ["header", "body", "query"]. + +### dpop\_bound\_access\_tokens\_required? + +```ts +optional dpop_bound_access_tokens_required: boolean; +``` + +Whether the protected resource always requires DPoP-bound access tokens. + +### dpop\_signing\_alg\_values\_supported? + +```ts +optional dpop_signing_alg_values_supported: string[]; +``` + +JWS algorithms supported for validating DPoP proof JWTs. + +### jwks\_uri? + +```ts +optional jwks_uri: string; +``` + +URL of the protected resource's JSON Web Key (JWK) Set document. This document contains the public keys +that can be used to verify digital signatures of responses or data returned by this protected resource. +This differs from the authorization server's jwks_uri which is used for token validation. When the protected +resource signs its responses, clients can fetch these public keys to verify the authenticity and integrity +of the received data. + +### resource + +```ts +resource: string; +``` + +The protected resource's resource identifier. + +### resource\_documentation? + +```ts +optional resource_documentation: string; +``` + +URL containing developer documentation for using the protected resource. + +### resource\_name? + +```ts +optional resource_name: string; +``` + +Human-readable name of the protected resource for display to end users. + +### resource\_policy\_uri? + +```ts +optional resource_policy_uri: string; +``` + +URL containing information about the protected resource's data usage requirements. + +### resource\_signing\_alg\_values\_supported? + +```ts +optional resource_signing_alg_values_supported: string[]; +``` + +JWS signing algorithms supported by the protected resource for signing resource responses. + +### resource\_tos\_uri? + +```ts +optional resource_tos_uri: string; +``` + +URL containing the protected resource's terms of service. + +### scopes\_supported? + +```ts +optional scopes_supported: string[]; +``` + +List of scope values used in authorization requests to access this protected resource. + +### signed\_metadata? + +```ts +optional signed_metadata: string; +``` + +A signed JWT containing metadata parameters as claims. The JWT must be signed using JWS and include +an 'iss' claim. This field provides a way to cryptographically verify the authenticity of the metadata +itself. The signature can be verified using the public keys available at the `jwks_uri` endpoint. +When present, the values in this signed metadata take precedence over the corresponding plain +JSON values in this metadata document. This helps prevent tampering with the resource metadata. + +### tls\_client\_certificate\_bound\_access\_tokens? + +```ts +optional tls_client_certificate_bound_access_tokens: boolean; +``` + +Whether the protected resource supports mutual-TLS client certificate-bound access tokens. diff --git a/docs/references/js/type-aliases/ResourceServerModeConfig.md b/docs/references/js/type-aliases/ResourceServerModeConfig.md new file mode 100644 index 0000000..465d870 --- /dev/null +++ b/docs/references/js/type-aliases/ResourceServerModeConfig.md @@ -0,0 +1,23 @@ +--- +sidebar_label: ResourceServerModeConfig +--- + +# Type Alias: ResourceServerModeConfig + +```ts +type ResourceServerModeConfig = { + protectedResources: ResourceServerConfig | ResourceServerConfig[]; +}; +``` + +Configuration for the MCP server as resource server mode. + +## Properties + +### protectedResources + +```ts +protectedResources: ResourceServerConfig | ResourceServerConfig[]; +``` + +A single resource server configuration or an array of them. diff --git a/docs/references/js/type-aliases/ValidateIssuerFunction.md b/docs/references/js/type-aliases/ValidateIssuerFunction.md new file mode 100644 index 0000000..8f84991 --- /dev/null +++ b/docs/references/js/type-aliases/ValidateIssuerFunction.md @@ -0,0 +1,31 @@ +--- +sidebar_label: ValidateIssuerFunction +--- + +# Type Alias: ValidateIssuerFunction() + +```ts +type ValidateIssuerFunction = (tokenIssuer: string) => void; +``` + +Function type for validating the issuer of the access token. + +This function should throw an [MCPAuthBearerAuthError](/references/js/classes/MCPAuthBearerAuthError.md) with code 'invalid_issuer' if the issuer +is not valid. The issuer should be validated against: + +1. The authorization servers configured in MCP-Auth's auth server metadata +2. The authorization servers listed in the protected resource's metadata + +## Parameters + +### tokenIssuer + +`string` + +## Returns + +`void` + +## Throws + +When the issuer is not recognized or invalid. diff --git a/docs/references/js/type-aliases/VerifyAccessTokenFunction.md b/docs/references/js/type-aliases/VerifyAccessTokenFunction.md index 2bb7325..625cd96 100644 --- a/docs/references/js/type-aliases/VerifyAccessTokenFunction.md +++ b/docs/references/js/type-aliases/VerifyAccessTokenFunction.md @@ -24,15 +24,15 @@ by the handler: - `aud` (audience) - `scope` (scopes) -## Parameters {#parameters} +## Parameters -### token {#token} +### token `string` The access token string to verify. -## Returns {#returns} +## Returns `MaybePromise`\<`AuthInfo`\> diff --git a/docs/references/js/type-aliases/VerifyAccessTokenMode.md b/docs/references/js/type-aliases/VerifyAccessTokenMode.md index 74e60ac..479f65b 100644 --- a/docs/references/js/type-aliases/VerifyAccessTokenMode.md +++ b/docs/references/js/type-aliases/VerifyAccessTokenMode.md @@ -7,3 +7,5 @@ sidebar_label: VerifyAccessTokenMode ```ts type VerifyAccessTokenMode = "jwt"; ``` + +The built-in verification modes supported by `bearerAuth`. diff --git a/docs/references/js/variables/authorizationServerMetadataSchema.md b/docs/references/js/variables/authorizationServerMetadataSchema.md index 2b10818..5ce269a 100644 --- a/docs/references/js/variables/authorizationServerMetadataSchema.md +++ b/docs/references/js/variables/authorizationServerMetadataSchema.md @@ -10,6 +10,6 @@ const authorizationServerMetadataSchema: ZodObject; Zod schema for OAuth 2.0 Authorization Server Metadata as defined in RFC 8414. -## See {#see} +## See https://datatracker.ietf.org/doc/html/rfc8414 diff --git a/docs/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/docs/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md index daaa358..a96a929 100644 --- a/docs/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md +++ b/docs/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md @@ -10,6 +10,6 @@ const camelCaseAuthorizationServerMetadataSchema: ZodObject; +``` + +The camelCase version of the OAuth 2.0 Protected Resource Metadata Zod schema. + +## See + +[protectedResourceMetadataSchema](/references/js/variables/protectedResourceMetadataSchema.md) for the original schema and field information. diff --git a/docs/references/js/variables/defaultValues.md b/docs/references/js/variables/defaultValues.md new file mode 100644 index 0000000..c29ea72 --- /dev/null +++ b/docs/references/js/variables/defaultValues.md @@ -0,0 +1,9 @@ +--- +sidebar_label: defaultValues +--- + +# Variable: defaultValues + +```ts +const defaultValues: Readonly>; +``` diff --git a/docs/references/js/variables/protectedResourceMetadataSchema.md b/docs/references/js/variables/protectedResourceMetadataSchema.md new file mode 100644 index 0000000..c12270b --- /dev/null +++ b/docs/references/js/variables/protectedResourceMetadataSchema.md @@ -0,0 +1,11 @@ +--- +sidebar_label: protectedResourceMetadataSchema +--- + +# Variable: protectedResourceMetadataSchema + +```ts +const protectedResourceMetadataSchema: ZodObject; +``` + +Zod schema for OAuth 2.0 Protected Resource Metadata. diff --git a/docs/snippets/_get-started-code.mdx b/docs/snippets/_get-started-code.mdx index 249b02f..00f677a 100644 --- a/docs/snippets/_get-started-code.mdx +++ b/docs/snippets/_get-started-code.mdx @@ -7,17 +7,33 @@ import Tabs from '@theme/Tabs'; ```python mcp = FastMCP("MyMCPServer") -mcp_auth = MCPAuth(server=fetch_server_config('', type=AuthServerType.OIDC)) +resource_identifier = "https://api.example.com" + +mcp_auth = MCPAuth( + protected_resources=ResourceServerConfig( + metadata=ResourceServerMetadata( + resource=resource_identifier, + authorization_servers=[fetch_server_config('', AuthServerType.OIDC)], + scopes_supported=["read", "write"], + ) + ) +) + app = Starlette( - # ... your MCP server setup - middleware=[Middleware( - mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) - )] + routes=[ + *mcp_auth.resource_metadata_router().routes, + Mount('/', app=mcp.sse_app(), middleware=[Middleware( + mcp_auth.bearer_auth_middleware("jwt", + resource=resource_identifier, + audience=resource_identifier, + required_scopes=["read", "write"] + ) + )]) + ] ) -# Use `mcp_auth.auth_info` to access the auth information for the current request @mcp.tool() -def whoami() -> dict[str, Any]: +def whoami(): return mcp_auth.auth_info.claims ``` @@ -26,14 +42,30 @@ def whoami() -> dict[str, Any]: ```ts const server = new McpServer(/* ... */); +const resourceIdentifier = 'https://api.example.com'; + const mcpAuth = new MCPAuth({ - server: await fetchServerConfig('', { type: 'oidc' }), + protectedResources: { + metadata: { + resource: resourceIdentifier, + authorizationServers: [await fetchServerConfig('', { type: 'oidc' })], + scopesSupported: ['read', 'write'], + } + } }); + const app = express(); -app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +app.use(mcpAuth.protectedResourceMetadataRouter()); + +app.use(mcpAuth.bearerAuth('jwt', { + resource: resourceIdentifier, + audience: resourceIdentifier, + requiredScopes: ['read', 'write'] +})); + server.tool('whoami', ({ authInfo }) => { - // Use `authInfo` to access the auth information carried from `req.auth` + return authInfo.claims; }); ``` diff --git a/docs/tutorials/todo-manager/README.mdx b/docs/tutorials/todo-manager/README.mdx index ed9de7c..a65e3aa 100644 --- a/docs/tutorials/todo-manager/README.mdx +++ b/docs/tutorials/todo-manager/README.mdx @@ -18,10 +18,6 @@ After completing this tutorial, you will have: - ✅ A basic understanding of how to set up role-based access control (RBAC) in your MCP server. - ✅ A MCP server that can manage personal todo lists. -:::note -Before you start, we strongly recommend you to go through the [Who am I tutorial](./whoami) first if you are not familiar with MCP server and OAuth 2. -::: - ## Overview \{#overview} The tutorial will involve the following components: @@ -88,45 +84,6 @@ To implement [role-based access control (RBAC)](https://auth.wiki/rbac) in your The scopes will be included in the JWT access token's `scope` claim as a space-separated string. - - - [Asgardeo](https://wso2.com/asgardeo) supports Role-Based Access Control (RBAC) and fine-grained authorization using API resources and scopes. Here's how to configure it: - - 1. Sign in to the [Asgardeo Console](https://console.asgardeo.io) - - 2. Define your API resource and scopes: - - Go to **API Resources** - - Click **"New API Resource"** - - Set the **Identifier** to `https://todo.mcp-server.app` (or your desired URL) - - Let the **Display Name** be `Todo Manager` - - Add the following scopes: - - `create:todos` : "Create new todo items" - - `read:todos` : "Read all todo items" - - `delete:todos` : "Delete any todo item" - - Create the resource - - 3. Create roles: - - Use the **User Management > Roles** to create roles and assign scopes directly. - - Click **New Role** - - Provide the role name (e.g., `Admin` or `User`) in **Basic Details** section - - Let the role audience be `Application` and select the `MCP Inspector Application` as the **Assigned Application** - - In **Permission Selection** section, choose the API resource you created earlier (e.g., `Todo Manager`) - - Select the scopes you want to assign to this role (e.g., `create:todos`, `read:todos`, `delete:todos`) - - Click **Finish** to create the role - - If you have already created the application - - Navigate to **Application > MCP Inspector Application > Roles tab** - - Select **Application Role** as the audience type, then click **New Role** - - Create an `Admin` role and attach all three scopes - - Create a `User` role and attach only the `create:todos` scope - - 4. Assign roles to users: - - Go to **User Management > Roles** - - Select the role you created (e.g., `Admin` or `User`) and move to **Users** tab - - Select **Assign User** and choose the users you want to assign this role to and save. - - The scopes will be included in the JWT access token's `scope` claim as a space-separated string. - @@ -184,7 +141,7 @@ sequenceDiagram ### Dynamic Client Registration \{#dynamic-client-registration} -Dynamic Client Registration is not required for this tutorial, but it can be useful if you want to automate the MCP client registration process with your authorization server. Check [Is Dynamic Client Registration required?](../../provider-list.mdx#is-dcr-required) for more details. +Dynamic Client Registration is not required for this tutorial, but it can be useful if you want to automate the MCP client registration process with your authorization server. Check [Is Dynamic Client Registration required?](/provider-list#is-dcr-required) for more details. ## Understand RBAC in todo manager \{#understand-rbac-in-todo-manager} @@ -251,7 +208,8 @@ To implement the access control system we described earlier, you'll need to conf 2. Create API resource and scopes: - Go to "API Resources" - - Create a new API resource named "Todo Manager" and using `https://todo.mcp-server.app` (demo purpose) as the indicator. + - Create a new API resource named "Todo Manager" and using `http://localhost:3001` as the resource indicator. + - **Important**: The resource indicator must match your MCP server's URL. For this tutorial, we use `http://localhost:3001` since our MCP server runs on port 3001. In production, use your actual MCP server URL (e.g., `https://your-mcp-server.example.com`). - Create the following scopes: - `create:todos`: "Create new todo items" - `read:todos`: "Read all todo items" @@ -278,82 +236,6 @@ You can also use Logto's [Management API](https://docs.logto.io/integrate-logto/ When requesting an access token, Logto will include scopes in the token's `scope` claim based on the user's role permissions. - - - -In [Keycloak](https://www.keycloak.org), you can set up the required permissions using client scopes: - -1. Create client scopes: - - - In your realm, go to "Client scopes" - - Create three new client scopes: - - `create:todos` - - `read:todos` - - `delete:todos` - -2. Configure the client: - - - Go to your client settings - - In the "Client scopes" tab, add all the scopes you created - - Make sure the token mapper is configured to include scopes - -3. Optional: Use roles for easier management - - If you prefer role-based management: - - Create realm roles for different access levels - - Map scopes to roles - - Assign roles to users - - Otherwise, you can directly assign scopes to users or through client-level permissions - -Keycloak will include the granted scopes in the access token's `scope` claim. - - - - -[Asgardeo](https://wso2.com/asgardeo) supports Role-Based Access Control (RBAC) and fine-grained authorization using API resources and scopes. Here's how to configure it: - -1. Sign in to the [Asgardeo Console](https://console.asgardeo.io) - -2. Define your API resource and scopes: - - Go to **API Resources** - - Click **"New API Resource"** - - Set the **Identifier** to `https://todo.mcp-server.app` (or your desired URL) - - Let the **Display Name** be `Todo Manager` - - Add the following scopes: - - `create:todos` : "Create new todo items" - - `read:todos` : "Read all todo items" - - `delete:todos` : "Delete any todo item" - - Create the resource - -3. Create roles: - - Use the **User Management > Roles** to create roles and assign scopes directly. - - Click **New Role** - - Provide the role name (e.g., `Admin` or `User`) in **Basic Details** section - - Let the role audience be `Application` and select the `MCP Inspector Application` as the **Assigned Application** - - In **Permission Selection** section, choose the API resource you created earlier (e.g., `Todo Manager`) - - Select the scopes you want to assign to this role (e.g., `create:todos`, `read:todos`, `delete:todos`) - - Click **Finish** to create the role - - If you have already created the application - - Navigate to **Application > MCP Inspector Application > Roles tab** - - Select **Application Role** as the audience type, then click **New Role** - - Create an `Admin` role and attach all three scopes - - Create a `User` role and attach only the `create:todos` scope - -4. Assign roles to users: - - Go to **User Management > Roles** - - Select the role you created (e.g., `Admin` or `User`) and move to **Users** tab - - Select **Assign User** and choose the users you want to assign this role to and save. - -The scopes will be included in the JWT access token's `scope` claim as a space-separated string. -After configuring your authorization server, users will receive access tokens containing their granted scopes. The MCP server will use these scopes to determine: - -Whether a user can create new todos (`create:todos`) -Whether a user can view all todos (`read:todos`) or only their own -Whether a user can delete any todo (`delete:todos`) or only their own - -For more details on configuring Asgardeo, refer to the following resources: -- [API Resources Guide](https://wso2.com/asgardeo/docs/guides/authorization/api-authorization) -- [Role Management](https://wso2.com/asgardeo/docs/guides/users/manage-roles) @@ -396,15 +278,6 @@ We will use the [MCP official SDKs](https://github.com/modelcontextprotocol) to ### Create a new project \{#create-a-new-project} - - -```bash -mkdir mcp-server -cd mcp-server -uv init # Or use `pipenv` or `poetry` to create a new virtual environment -``` - - Set up a new Node.js project: @@ -428,19 +301,10 @@ We're using TypeScript in our examples as Node.js v22.6.0+ supports running Type ### Install the MCP SDK and dependencies \{#install-the-mcp-sdk-and-dependencies} - - -```bash -pip install "mcp[cli]" starlette uvicorn -``` - -Or any other package manager you prefer, such as `uv` or `poetry`. - - ```bash -npm install @modelcontextprotocol/sdk express zod +npm install @modelcontextprotocol/sdk express zod mcp-auth dotenv ``` Or any other package manager you prefer, such as `pnpm` or `yarn`. @@ -453,53 +317,8 @@ Or any other package manager you prefer, such as `pnpm` or `yarn`. First, let's create a basic MCP server with the tool definitions: - - -Create a file named `todo-manager.py` and add the following code: - -```python -from typing import Any -from mcp.server.fastmcp import FastMCP -from starlette.applications import Starlette -from starlette.routing import Mount - -mcp = FastMCP("Todo Manager") - -@mcp.tool() -def create_todo(content: str) -> dict[str, Any]: - """Create a new todo.""" - return {"error": "Not implemented"} - -@mcp.tool() -def get_todos() -> dict[str, Any]: - """List all todos.""" - return {"error": "Not implemented"} - -@mcp.tool() -def delete_todo(id: str) -> dict[str, Any]: - """Delete a todo by id.""" - return {"error": "Not implemented"} - -app = Starlette( - routes=[Mount('/', app=mcp.sse_app())] -) -``` - -Run the server with: - -```bash -uvicorn todo_manager:app --host 0.0.0.0 --port 3001 -``` - - -:::note -Since the current MCP inspector implementation does not handle authorization flows, we will use the SSE approach to set up the MCP server. We'll update the code here once the MCP inspector supports authorization flows. -::: - -You can also use `pnpm` or `yarn` if you prefer. - Create a file named `todo-manager.ts` and add the following code: ```ts @@ -507,8 +326,8 @@ Create a file named `todo-manager.ts` and add the following code: import { z } from 'zod'; import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; -import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'; -import express from 'express'; +import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; +import express, { type Request, type Response } from 'express'; // Create an MCP server const server = new McpServer({ @@ -538,27 +357,65 @@ server.tool('delete-todo', 'Delete a todo by id', { id: z.string() }, async ({ i const PORT = 3001; const app = express(); -const transports = {}; - -app.get('/sse', async (_req, res) => { - const transport = new SSEServerTransport('/messages', res); - transports[transport.sessionId] = transport; - - res.on('close', () => { - delete transports[transport.sessionId]; - }); +app.post('/', async (request: Request, response: Response) => { + // In stateless mode, create a new instance of transport and server for each request + // to ensure complete isolation. A single instance would cause request ID collisions + // when multiple clients connect concurrently. + + try { + const transport: StreamableHTTPServerTransport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + response.on('close', async () => { + console.log('Request closed'); + await transport.close(); + await server.close(); + }); + await server.connect(transport); + await transport.handleRequest(request, response, request.body); + } catch (error) { + console.error('Error handling MCP request:', error); + if (!response.headersSent) { + response.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32_603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); - await server.connect(transport); +// SSE notifications not supported in stateless mode +app.get('/', async (request: Request, response: Response) => { + console.log('Received GET MCP request'); + response.writeHead(405).end( + JSON.stringify({ + jsonrpc: '2.0', + error: { + code: -32_000, + message: 'Method not allowed.', + }, + id: null, + }) + ); }); -app.post('/messages', async (req, res) => { - const sessionId = String(req.query.sessionId); - const transport = transports[sessionId]; - if (transport) { - await transport.handlePostMessage(req, res, req.body); - } else { - res.status(400).send('No transport found for sessionId'); - } +// Session termination not needed in stateless mode +app.delete('/', async (request: Request, response: Response) => { + console.log('Received DELETE MCP request'); + response.writeHead(405).end( + JSON.stringify({ + jsonrpc: '2.0', + error: { + code: -32_000, + message: 'Method not allowed.', + }, + id: null, + }) + ); }); app.listen(PORT); @@ -577,14 +434,14 @@ npm start ### Clone and run MCP inspector \{#clone-and-run-mcp-inspector} -Now that we have the MCP server running, we can use the MCP inspector to see if the `whoami` tool is available. +Now that we have the MCP server running, we can use the MCP inspector to see if tools are available. -Due to the limit of the current implementation, we've forked the [MCP inspector](https://github.com/mcp-auth/inspector) to make it more flexible and scalable for authentication and authorization. We've also submitted a pull request to the original repository to include our changes. +The official MCP inspector v0.16.2 has some bugs that affect authentication functionality. To address these issues, we've created a [patched version of the MCP inspector](https://github.com/mcp-auth/inspector/tree/patch/0.16.2-fixes) that includes necessary fixes for OAuth/OIDC authentication flows. We've also submitted pull requests to the official repository to contribute these fixes upstream. To run the MCP inspector, you can use the following command (Node.js is required): ```bash -git clone https://github.com/mcp-auth/inspector.git +git clone https://github.com/mcp-auth/inspector.git -b patch/0.16.2-fixes cd inspector npm install npm run dev @@ -596,8 +453,8 @@ Then, open your browser and navigate to `http://localhost:6274/` (or other URL s Before we proceed, check the following configuration in MCP inspector: -- **Transport Type**: Set to `SSE`. -- **URL**: Set to the URL of your MCP server. In our case, it should be `http://localhost:3001/sse`. +- **Transport Type**: Set to `Streamable HTTP`. +- **URL**: Set to the URL of your MCP server. In our case, it should be `http://localhost:3001`. Now you can click the "Connect" button to see if the MCP inspector can connect to the MCP server. If everything is okay, you should see the "Connected" status in the MCP inspector. @@ -650,7 +507,7 @@ When requesting access tokens from different authorization servers, you'll encou - Example request: ```json { - "resource": "https://todo.mcp-server.app", + "resource": "http://localhost:3001", "scope": "create:todos read:todos" } ``` @@ -697,55 +554,21 @@ While each provider may have its own specific requirements, the following steps -Integrating the todo manager with [Logto](https://logto.io) is straightforward as it's an OpenID Connect provider that supports resource indicators and scopes, allowing you to secure your todo API with `https://todo.mcp-server.app` as the resource indicator. +Integrating the todo manager with [Logto](https://logto.io) is straightforward as it's an OpenID Connect provider that supports resource indicators and scopes, allowing you to secure your todo API with `http://localhost:3001` as the resource indicator. Since Logto does not support Dynamic Client Registration yet, you will need to manually register the MCP inspector as a client in your Logto tenant: -1. Open your MCP inspector, click on the "OAuth Configuration" button. Copy the **Redirect URL (auto-populated)** value, which should be something like `http://localhost:6274/oauth/callback`. +1. Open your MCP inspector, go to the Authentication configuration and click on the "OAuth2.0 Flow" configuration. Copy the **Redirect URI** value, which should be something like `http://localhost:6274/oauth/callback`. 2. Sign in to [Logto Console](https://cloud.logto.io) (or your self-hosted Logto Console). 3. Navigate to the "Applications" tab, click on "Create application". In the bottom of the page, click on "Create app without framework". 4. Fill in the application details, then click on "Create application": - **Select an application type**: Choose "Single-page application". - **Application name**: Enter a name for your application, e.g., "MCP Inspector". -5. In the "Settings / Redirect URIs" section, paste the **Redirect URL (auto-populated)** value you copied from the MCP inspector. Then click on "Save changes" in the bottom bar. +5. In the "Settings / Redirect URIs" section, paste the **Redirect URI** value you copied from the MCP inspector. Then click on "Save changes" in the bottom bar. 6. In the top card, you will see the "App ID" value. Copy it. -7. Go back to the MCP inspector and paste the "App ID" value in the "OAuth Configuration" section under "Client ID". -8. Enter the value `{"scope": "create:todos read:todos delete:todos", "resource": "https://todo.mcp-server.app"}` in the "Auth Params" field. This will ensure that the access token returned by Logto contains the necessary scopes to access the todo manager. +7. Go back to the MCP inspector and paste the "App ID" value in the Authentication configuration under "OAuth2.0 Flow" in the "Client ID" field. +8. In the "Scope" field, enter: `create:todos read:todos delete:todos`. This will ensure that the access token returned by Logto contains the necessary scopes to access the todo manager. - - - - While Asgardeo supports dynamic client registration via a standard API, the endpoint is protected and requires an access token with the necessary permissions. In this tutorial, we’ll register the client manually through the Asgardeo Console. - - :::note - If you don’t have an Asgardeo account, you can [sign up for free](https://asgardeo.io). - ::: - - Follow these steps to configure Asgardeo for MCP Inspector: - - 1. Log in to the [Asgardeo Console](https://console.asgardeo.io) and select your organization. - - 2. Create a new application: - - Go to **Applications** → **New Application** - - Choose **Single-Page Application** - - Enter an application name like `MCP Inspector` - - In the **Authorized Redirect URLs** field, paste the **Redirect URL** copied from MCP Inspector client application (e.g.: `http://localhost:6274/oauth/callback`) - - Click **Create** - - 3. Configure the protocol settings: - - Under the **Protocol** tab: - - Copy the **Client ID** that was auto generated. - - Ensure switching to `JWT` for the `Token Type` in **Access Token** section - - Click **Update** - - 4. In MCP Inspector client application: - - Open the **OAuth Configuration** section - - Paste the copied **Client ID** - - Enter the following in the **Auth Params** field to request the necessary scopes: - - ```json - { "scope": "openid profile email" } - ``` @@ -755,7 +578,7 @@ This is a generic OAuth 2.0 / OpenID Connect provider integration guide. Both OA If your provider supports Dynamic Client Registration, you can directly go to step 8 below to configure the MCP inspector; otherwise, you will need to manually register the MCP inspector as a client: -1. Open your MCP inspector, click on the "OAuth Configuration" button. Copy the **Redirect URL (auto-populated)** value, which should be something like `http://localhost:6274/oauth/callback`. +1. Open your MCP inspector, go to the Authentication configuration and click on the "OAuth2.0 Flow" configuration. Copy the **Redirect URI** value, which should be something like `http://localhost:6274/oauth/callback`. 2. Sign in to your provider's console. @@ -763,16 +586,16 @@ If your provider supports Dynamic Client Registration, you can directly go to st 4. If your provider requires a client type, select "Single-page application" or "Public client". -5. After creating the application, you will need to configure the redirect URI. Paste the **Redirect URL (auto-populated)** value you copied from the MCP inspector. +5. After creating the application, you will need to configure the redirect URI. Paste the **Redirect URI** value you copied from the MCP inspector. 6. Find the "Client ID" or "Application ID" of the newly created application and copy it. -7. Go back to the MCP inspector and paste the "Client ID" value in the "OAuth Configuration" section under "Client ID". +7. Go back to the MCP inspector and paste the "Client ID" value in the Authentication configuration under "OAuth2.0 Flow" in the "Client ID" field. -8. Enter the following value in the "Auth Params" field to request the necessary scopes for todo operations: +8. In the "Scope" field, enter the following scopes to request the necessary permissions for todo operations: -```json -{ "scope": "create:todos read:todos delete:todos" } +```text +create:todos read:todos delete:todos ``` @@ -782,28 +605,6 @@ If your provider supports Dynamic Client Registration, you can directly go to st In your MCP server project, you need to install the MCP Auth SDK and configure it to use your authorization server metadata. - - - -First, install the `mcpauth` package: - -```bash -pip install mcpauth -``` - -Or any other package manager you prefer, such as `uv` or `poetry`. - - - - -First, install the `mcp-auth` package: - -```bash -npm install mcp-auth -``` - - - MCP Auth requires the authorization server metadata to be able to initialize. Depending on your provider: @@ -817,14 +618,6 @@ The issuer URL can be found in your application details page in Logto Console, i - - - You can find the issuer URL in the Asgardeo Console. Navigate to the created application, and open the **Info** tab. The **Issuer** field will be displayed there and should look like: - `https://api.asgardeo.io/t//oauth2/token` - - - - @@ -842,213 +635,247 @@ For OAuth 2.0 providers, you'll need to: - - -Update the `todo-manager.py` to include the MCP Auth configuration: + -```python -from mcpauth import MCPAuth -from mcpauth.config import AuthServerType -from mcpauth.utils import fetch_server_config +Create a `.env` file in your project root to store the authorization server configuration: -auth_issuer = '' # Replace with your issuer endpoint -auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OIDC) -mcp_auth = MCPAuth(server=auth_server_config) +```bash +MCP_AUTH_ISSUER= ``` +Replace `` with your actual issuer endpoint (e.g., `https://my-project.logto.app/oidc`). + + + +### Update MCP server \{#update-mcp-server} + +We are almost done! It's time to update the MCP server to apply the MCP Auth route and middleware function, then implement the permission-based access control for the todo manager tools based on the user's scopes. + + -Update the `todo-manager.ts` to include the MCP Auth configuration: +Now update the complete `todo-manager.ts` file with the authentication and authorization logic: ```ts -// todo-manager.ts +import assert from 'node:assert'; -import { MCPAuth, fetchServerConfig } from 'mcp-auth'; +import { type AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js'; +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js'; +import { configDotenv } from 'dotenv'; +import express, { type Request, type Response } from 'express'; +import { fetchServerConfig, MCPAuth, MCPAuthBearerAuthError } from 'mcp-auth'; +import { z } from 'zod'; -const authIssuer = ''; // Replace with your issuer endpoint -const mcpAuth = new MCPAuth({ - server: await fetchServerConfig(authIssuer, { type: 'oidc' }), -}); -``` +import { TodoService } from './todo-service.js'; - - +configDotenv(); -### Update MCP server \{#update-mcp-server} +const todoService = new TodoService(); -We are almost done! It's time to update the MCP server to apply the MCP Auth route and middleware function, then implement the permission-based access control for the todo manager tools based on the user's scopes. +const assertUserId = (authInfo?: AuthInfo) => { + const { subject } = authInfo ?? {}; + assert(subject, 'Invalid auth info'); + return subject; +}; - - - -```python -@mcp.tool() -def create_todo(content: str) -> dict[str, Any]: - """Create a new todo.""" - return ( - mcp_auth.auth_info.scopes - if mcp_auth.auth_info # This will be populated by the Bearer auth middleware - else {"error": "Not authenticated"} - ) - -# ... - -bearer_auth = Middleware(mcp_auth.bearer_auth_middleware("jwt")) -app = Starlette( - routes=[ - # Add the metadata route (`/.well-known/oauth-authorization-server`) - mcp_auth.metadata_route(), - # Protect the MCP server with the Bearer auth middleware - Mount('/', app=mcp.sse_app(), middleware=[bearer_auth]), - ], -) -``` +const hasRequiredScopes = (userScopes: string[], requiredScopes: string[]): boolean => { + return requiredScopes.every((scope) => userScopes.includes(scope)); +}; - - +// Create an MCP server +const server = new McpServer({ + name: 'Todo Manager', + version: '0.0.0', +}); -```js server.tool( 'create-todo', 'Create a new todo', { content: z.string() }, - async ({ content, authInfo }) => { + ({ content }: { content: string }, { authInfo }) => { + const userId = assertUserId(authInfo); + + /** + * Only users with 'create:todos' scope can create todos + */ + if (!hasRequiredScopes(authInfo?.scopes ?? [], ['create:todos'])) { + throw new MCPAuthBearerAuthError('missing_required_scopes'); + } + + const createdTodo = todoService.createTodo({ content, ownerId: userId }); + + return { + content: [{ type: 'text', text: JSON.stringify(createdTodo) }], + }; + } +); + +server.tool('get-todos', 'List all todos', ({ authInfo }) => { + const userId = assertUserId(authInfo); + + /** + * If user has 'read:todos' scope, they can access all todos (todoOwnerId = undefined) + * If user doesn't have 'read:todos' scope, they can only access their own todos (todoOwnerId = userId) + */ + const todoOwnerId = hasRequiredScopes(authInfo?.scopes ?? [], ['read:todos']) + ? undefined + : userId; + + const todos = todoService.getAllTodos(todoOwnerId); + + return { + content: [{ type: 'text', text: JSON.stringify(todos) }], + }; +}); + +server.tool( + 'delete-todo', + 'Delete a todo by id', + { id: z.string() }, + ({ id }: { id: string }, { authInfo }) => { + const userId = assertUserId(authInfo); + + const todo = todoService.getTodoById(id); + + if (!todo) { + return { + content: [{ type: 'text', text: JSON.stringify({ error: 'Failed to delete todo' }) }], + }; + } + + /** + * Users can only delete their own todos + * Users with 'delete:todos' scope can delete any todo + */ + if (todo.ownerId !== userId && !hasRequiredScopes(authInfo?.scopes ?? [], ['delete:todos'])) { + return { + content: [ + { + type: 'text', + text: JSON.stringify({ error: 'Failed to delete todo' }), + }, + ], + }; + } + + const deletedTodo = todoService.deleteTodo(id); + return { content: [ - { type: 'text', text: JSON.stringify(authInfo?.scopes ?? { error: 'Not authenticated' }) }, + { + type: 'text', + text: JSON.stringify({ + message: `Todo ${id} deleted`, + details: deletedTodo, + }), + }, ], }; } ); -// ... +const { MCP_AUTH_ISSUER } = process.env; -app.use(mcpAuth.delegatedRouter()); -app.use(mcpAuth.bearerAuth('jwt')); -``` +if (!MCP_AUTH_ISSUER) { + throw new Error('MCP_AUTH_ISSUER environment variable is required'); +} - - +const resourceIdentifier = 'http://localhost:3001'; -Next, let's implement the specific tools. +const authServerConfig = await fetchServerConfig(MCP_AUTH_ISSUER, { type: 'oidc' }); -First, let's create a simple todo service to provide basic CRUD operations for managing todo items in memory. +const mcpAuth = new MCPAuth({ + protectedResources: { + metadata: { + resource: resourceIdentifier, + authorizationServers: [authServerConfig], + scopesSupported: ['create:todos', 'read:todos', 'delete:todos'], + }, + }, +}); - - -```python -# service.py - -""" -A simple Todo service for demonstration purposes. -Uses an in-memory list to store todos. -""" - -from datetime import datetime -from typing import List, Optional, Dict, Any -import random -import string - -class Todo: -"""Represents a todo item.""" - - def __init__(self, id: str, content: str, owner_id: str, created_at: str): - self.id = id - self.content = content - self.owner_id = owner_id - self.created_at = created_at - - def to_dict(self) -> Dict[str, Any]: - """Convert todo to dictionary for JSON serialization.""" - return { - "id": self.id, - "content": self.content, - "ownerId": self.owner_id, - "createdAt": self.created_at - } - -class TodoService: -"""A simple Todo service for demonstration purposes.""" - - def __init__(self): - self._todos: List[Todo] = [] - - def get_all_todos(self, owner_id: Optional[str] = None) -> List[Dict[str, Any]]: - """ - Get all todos, optionally filtered by owner_id. - - Args: - owner_id: If provided, only return todos owned by this user - - Returns: - List of todo dictionaries - """ - if owner_id: - filtered_todos = [todo for todo in self._todos if todo.owner_id == owner_id] - return [todo.to_dict() for todo in filtered_todos] - return [todo.to_dict() for todo in self._todos] - - def get_todo_by_id(self, todo_id: str) -> Optional[Todo]: - """ - Get a todo by its ID. - - Args: - todo_id: The ID of the todo to retrieve - - Returns: - Todo object if found, None otherwise - """ - for todo in self._todos: - if todo.id == todo_id: - return todo - return None - - def create_todo(self, content: str, owner_id: str) -> Dict[str, Any]: - """ - Create a new todo. - - Args: - content: The content of the todo - owner_id: The ID of the user who owns this todo - - Returns: - Dictionary representation of the created todo - """ - todo = Todo( - id=self._generate_id(), - content=content, - owner_id=owner_id, - created_at=datetime.now().isoformat() - ) - self._todos.append(todo) - return todo.to_dict() - - def delete_todo(self, todo_id: str) -> Optional[Dict[str, Any]]: - """ - Delete a todo by its ID. - - Args: - todo_id: The ID of the todo to delete - - Returns: - Dictionary representation of the deleted todo if found, None otherwise - """ - for i, todo in enumerate(self._todos): - if todo.id == todo_id: - deleted_todo = self._todos.pop(i) - return deleted_todo.to_dict() - return None - - def _generate_id(self) -> str: - """Generate a random ID for a todo.""" - return ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) - -```` +const PORT = 3001; +const app = express(); + +app.use(mcpAuth.protectedResourceMetadataRouter()); +app.use( + mcpAuth.bearerAuth('jwt', { + resource: resourceIdentifier, + audience: resourceIdentifier, + }) +); + +// Below is the boilerplate code from MCP SDK documentation +app.post('/', async (request: Request, response: Response) => { + // In stateless mode, create a new instance of transport and server for each request + // to ensure complete isolation. A single instance would cause request ID collisions + // when multiple clients connect concurrently. + + try { + const transport: StreamableHTTPServerTransport = new StreamableHTTPServerTransport({ + sessionIdGenerator: undefined, + }); + response.on('close', async () => { + console.log('Request closed'); + await transport.close(); + await server.close(); + }); + await server.connect(transport); + await transport.handleRequest(request, response, request.body); + } catch (error) { + console.error('Error handling MCP request:', error); + if (!response.headersSent) { + response.status(500).json({ + jsonrpc: '2.0', + error: { + code: -32_603, + message: 'Internal server error', + }, + id: null, + }); + } + } +}); +// SSE notifications not supported in stateless mode +app.get('/', async (request: Request, response: Response) => { + console.log('Received GET MCP request'); + response.writeHead(405).end( + JSON.stringify({ + jsonrpc: '2.0', + error: { + code: -32_000, + message: 'Method not allowed.', + }, + id: null, + }) + ); +}); + +// Session termination not needed in stateless mode +app.delete('/', async (request: Request, response: Response) => { + console.log('Received DELETE MCP request'); + response.writeHead(405).end( + JSON.stringify({ + jsonrpc: '2.0', + error: { + code: -32_000, + message: 'Method not allowed.', + }, + id: null, + }) + ); +}); + +app.listen(PORT); +``` - + + +Create the `todo-service.ts` file with the Todo service implementation: ```ts // todo-service.ts @@ -1107,121 +934,9 @@ export class TodoService { return Math.random().toString(36).slice(2, 10); } } -```` - - - - -then in the tools layer, we'll determine whether operations are allowed based on the user's scopes: - - - - -```python -# todo-manager.py - -from typing import Any, Optional -from mcpauth.errors import MCPAuthBearerAuthError - -def assert_user_id(auth_info: Optional[dict]) -> str: - """Extract and validate user ID from auth info.""" - subject = auth_info.get('subject') if auth_info else None - if not subject: - raise ValueError('Invalid auth info') - return subject - -def has_required_scopes(user_scopes: list[str], required_scopes: list[str]) -> bool: - """Check if user has all required scopes.""" - return all(scope in user_scopes for scope in required_scopes) - -# Create an instance of TodoService -todo_service = TodoService() - -@mcp.tool() -def create_todo(content: str) -> dict[str, Any]: - """Create a new todo. - - Only users with 'create:todos' scope can create todos. - """ - # Get authentication info - auth_info = mcp_auth.auth_info - - # Validate user ID - try: - user_id = assert_user_id(auth_info) - except ValueError as e: - return {"error": str(e)} - - # Check if user has the required permissions - if not has_required_scopes(auth_info.scopes if auth_info else [], ['create:todos']): - raise MCPAuthBearerAuthError('missing_required_scopes') - - # Create new todo - created_todo = todo_service.create_todo(content=content, owner_id=user_id) - - # Return the created todo - return created_todo.__dict__ - -# ... ``` -You can check our [sample code](https://github.com/mcp-auth/python/tree/master/samples/server) for all other detailed implementations. - - - - -```ts -// todo-manager.ts - -// ... other imports -import assert from 'node:assert'; -import { type AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js'; -import { TodoService } from './todo-service.js'; - -const todoService = new TodoService(); - -const assertUserId = (authInfo?: AuthInfo) => { - const { subject } = authInfo ?? {}; - assert(subject, 'Invalid auth info'); - return subject; -}; - -/** - * Check if user has all the required scopes for an operation - */ -const hasRequiredScopes = (userScopes: string[], requiredScopes: string[]): boolean => { - return requiredScopes.every((scope) => userScopes.includes(scope)); -}; - -server.tool( - 'create-todo', - 'Create a new todo', - { content: z.string() }, - ({ content }: { content: string }, { authInfo }) => { - const userId = assertUserId(authInfo); - - /** - * Only users with 'create:todos' scope can create todos - */ - if (!hasRequiredScopes(authInfo?.scopes ?? [], ['create:todos'])) { - throw new MCPAuthBearerAuthError('missing_required_scopes'); - } - - const createdTodo = todoService.createTodo({ content, ownerId: userId }); - - return { - content: [{ type: 'text', text: JSON.stringify(createdTodo) }], - }; - } -); - -// ... -``` - -You can check our [sample code](https://github.com/mcp-auth/js/tree/master/packages/sample-servers/src/todo-manager) for all other detailed implementations. - - - +The complete implementation above includes all the authentication and authorization logic. You can also check our [sample code](https://github.com/mcp-auth/js/tree/master/packages/sample-servers/src/todo-manager) for reference. ## Checkpoint: Run the `todo-manager` tools \{#checkpoint-run-the-todo-manager-tools} @@ -1251,13 +966,6 @@ This demonstrates how role-based access control (RBAC) works in practice, where ![MCP inspector todo manager tool result](/docs-assets/images/tutorials/todo-manager/result.png) - - -:::info -Check out the [MCP Auth Python SDK repository](https://github.com/mcp-auth/python/blob/master/samples/server/todo-manager/server.py) for the complete code of the MCP server (OIDC version). -::: - - :::info diff --git a/docs/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/docs/tutorials/todo-manager/_setup-oauth-or-oidc.mdx index a648043..a9a7dab 100644 --- a/docs/tutorials/todo-manager/_setup-oauth-or-oidc.mdx +++ b/docs/tutorials/todo-manager/_setup-oauth-or-oidc.mdx @@ -6,21 +6,6 @@ import MalformedMetadataTranspilation from './_transpile-metadata.mdx'; - - -Update the `todo-manager.py` to include the MCP Auth configuration: - -```python -from mcpauth import MCPAuth -from mcpauth.config import AuthServerType -from mcpauth.utils import fetch_server_config - -auth_issuer = '' # Replace with your issuer endpoint -auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OAUTH) # or AuthServerType.OIDC -mcp_auth = MCPAuth(server=auth_server_config) -``` - - Update the `todo-manager.ts` to include the MCP Auth configuration: diff --git a/docs/tutorials/todo-manager/_setup-oidc.mdx b/docs/tutorials/todo-manager/_setup-oidc.mdx index f0ccb7d..e7af372 100644 --- a/docs/tutorials/todo-manager/_setup-oidc.mdx +++ b/docs/tutorials/todo-manager/_setup-oidc.mdx @@ -6,21 +6,6 @@ import MalformedMetadataTranspilation from './_transpile-metadata.mdx'; - - -Update the `todo-manager.py` to include the MCP Auth configuration: - -```python -from mcpauth import MCPAuth -from mcpauth.config import AuthServerType -from mcpauth.utils import fetch_server_config - -auth_issuer = '' # Replace with your issuer endpoint -auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OIDC) -mcp_auth = MCPAuth(server=auth_server_config) -``` - - Update the `todo-manager.ts` to include the MCP Auth configuration: diff --git a/docs/tutorials/todo-manager/_transpile-metadata.mdx b/docs/tutorials/todo-manager/_transpile-metadata.mdx index d13ff01..a2a2a38 100644 --- a/docs/tutorials/todo-manager/_transpile-metadata.mdx +++ b/docs/tutorials/todo-manager/_transpile-metadata.mdx @@ -4,18 +4,7 @@ import Tabs from '@theme/Tabs'; In some cases, the provider response may be malformed or not conforming to the expected metadata format. If you are confident that the provider is compliant, you can transpile the metadata via the config option: - -```python -mcp_auth = MCPAuth( - server=fetch_server_config( - # ...other options - transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] - ) -) -``` - - ```ts diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 693fc4f..fd4a0b1 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -58,6 +58,21 @@ const config: Config = { // Please change this to your repo. // Remove this to remove the "edit this page" links. editUrl: 'https://github.com/mcp-auth/docs/tree/master/', + includeCurrentVersion: true, + lastVersion: 'current', + versions: { + current: { + label: 'Next', + path: '', + banner: 'none', + }, + '0.1.1': { + label: '0.1.1', + path: '0.1.1', + banner: 'none', + }, + }, + onlyIncludeVersions: ['current', '0.1.1'], beforeDefaultRehypePlugins: [ // https://lachieh.github.io/docusaurus-with-shiki-rehype/docs/intro/ [ @@ -103,16 +118,19 @@ const config: Config = { }, { type: 'doc', - docId: '/category/tutorials', + docId: 'tutorials/todo-manager/README', label: 'Tutorials', position: 'right', }, { - type: 'doc', - docId: 'provider-list', + to: '/provider-list', label: 'Provider list', position: 'right', }, + { + type: 'docsVersionDropdown', + position: 'right', + }, { type: 'localeDropdown', position: 'right', diff --git a/i18n/de/docusaurus-plugin-content-docs/current.json b/i18n/de/docusaurus-plugin-content-docs/current.json index 766a391..56d138a 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current.json +++ b/i18n/de/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "Nächste", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "Tutorials", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/de/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..56d138a --- /dev/null +++ b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "Tutorials", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "Tutorials", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "MCP-Server konfigurieren", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "MCP-Server konfigurieren", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "SDK-Referenzen", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "MCP Auth SDK-Referenzen", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "Informationen über Klassen, Methoden und Eigenschaften aus den MCP Auth SDKs.\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "Klassen", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "Funktionen", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "Typ-Aliase", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "Variablen", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/README.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/de/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index 1bdd73c..f180d11 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ Während die letzten beiden nicht zwingend erforderlich sind, ist die erste notw Im neuen MCP-Entwurf wird RFC 8414 für Autorisierungsserver (Anbieter) verpflichtend sein. Wir werden die Dokumentation aktualisieren, sobald der neue Entwurf finalisiert ist. ::: -Du kannst die [Liste der MCP-kompatiblen Anbieter](./provider-list.mdx) prüfen, um zu sehen, ob dein Anbieter unterstützt wird. +Du kannst die [Liste der MCP-kompatiblen Anbieter](/provider-list) prüfen, um zu sehen, ob dein Anbieter unterstützt wird. ## Installiere MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/de/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index a99b061..25a255d 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### Dynamische Client-Registrierung \{#dynamic-client-registration} -Die dynamische Client-Registrierung ist für dieses Tutorial nicht erforderlich, kann aber nützlich sein, wenn du die MCP-Client-Registrierung mit deinem Autorisierungsserver automatisieren möchtest. Siehe [Ist Dynamic Client Registration erforderlich?](../../provider-list.mdx#is-dcr-required) für weitere Details. +Die dynamische Client-Registrierung ist für dieses Tutorial nicht erforderlich, kann aber nützlich sein, wenn du die MCP-Client-Registrierung mit deinem Autorisierungsserver automatisieren möchtest. Siehe [Ist Dynamic Client Registration erforderlich?](/provider-list#is-dcr-required) für weitere Details. ## Verstehe RBAC im Todo-Manager \{#understand-rbac-in-todo-manager} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 992917c..1450110 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ Während OAuth 2.0 keine standardisierte Methode zum Abrufen von Benutzeridentit ### Dynamische Client-Registrierung \{#dynamic-client-registration} -Die dynamische Client-Registrierung ist für dieses Tutorial nicht erforderlich, kann aber nützlich sein, wenn du den MCP-Client-Registrierungsprozess mit deinem Autorisierungsserver automatisieren möchtest. Siehe [Ist Dynamic Client Registration erforderlich?](../../provider-list.mdx#is-dcr-required) für weitere Details. +Die dynamische Client-Registrierung ist für dieses Tutorial nicht erforderlich, kann aber nützlich sein, wenn du den MCP-Client-Registrierungsprozess mit deinem Autorisierungsserver automatisieren möchtest. Siehe [Ist Dynamic Client Registration erforderlich?](/provider-list#is-dcr-required) für weitere Details. ## MCP-Server einrichten \{#set-up-the-mcp-server} diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/de/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/de/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/de/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/de/docusaurus-plugin-content-pages/provider-list.mdx similarity index 95% rename from i18n/de/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/de/docusaurus-plugin-content-pages/provider-list.mdx index 24906f8..2a2f827 100644 --- a/i18n/de/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/de/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,6 +1,5 @@ --- -sidebar_position: 100 -sidebar_label: Provider-Liste +title: MCP-kompatible Provider-Liste --- import TestProvider from '@site/src/components/TestProvider'; @@ -28,7 +27,7 @@ Wenn du MCP Auth mit einem anderen Provider getestet hast, kannst du gerne einen [^4]: Auth0 und Descope unterstützen Multi-Resource Refresh Tokens (MRRT), aber nicht das vollständige RFC 8707. Die Unterstützung für Ressourcenindikatoren ist begrenzt und nicht standardbasiert. -## Ist die dynamische Client-Registrierung erforderlich? \{#is-dcr-required} +## Ist die dynamische Client-Registrierung erforderlich? {#is-dcr-required} [Dynamic Client Registration](https://datatracker.ietf.org/doc/html/rfc7591) ist für MCP-Server und MCP Auth nicht erforderlich. Tatsächlich kannst du den Ansatz wählen, der am besten zu deinen Anforderungen passt: @@ -38,7 +37,7 @@ Wenn du MCP Auth mit einem anderen Provider getestet hast, kannst du gerne einen 2. Alternativ kannst du einen eigenen Registrierungsprozess entwickeln, der es deinen MCP-Clients ermöglicht, sich über einen sicheren und kontrollierten Prozess beim Provider zu registrieren, z. B. über eine Weboberfläche oder einen API-Endpunkt, den du kontrollierst, ohne auf die dynamische Client-Registrierung angewiesen zu sein. Solange dein Provider Management API oder ähnliche Funktionalität unterstützt, kannst du diese in deinen eigenen Endpunkten verwenden, um die MCP-Clients zu registrieren. -## Teste deinen Provider \{#test-your-provider} +## Teste deinen Provider {#test-your-provider} Gib unten die URL des `issuer`- oder Metadaten-Endpunkts deines Autorisierungsservers ein, um zu prüfen, ob er mit MCP kompatibel ist. diff --git a/i18n/es/docusaurus-plugin-content-docs/current.json b/i18n/es/docusaurus-plugin-content-docs/current.json index d83d159..c2f1e10 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current.json +++ b/i18n/es/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "Siguiente", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "Tutoriales", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/es/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..c2f1e10 --- /dev/null +++ b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "Tutoriales", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "Tutoriales", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "Configurar servidor MCP", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "Configurar servidor MCP", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "Referencias de SDK", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "Referencias de SDK de MCP Auth", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "Información sobre clases, métodos y propiedades extraídas de los SDKs de MCP Auth.\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "SDK de Node.js", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "clases", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "funciones", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "alias de tipos", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "variables", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/es/docusaurus-plugin-content-docs/current/README.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/es/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index b503f1d..2a196cf 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ Aunque los dos últimos no son obligatorios, el primero es necesario para garant En el nuevo borrador de MCP, RFC 8414 será obligatorio para los servidores de autorización (proveedores). Actualizaremos la documentación una vez que el nuevo borrador esté finalizado. ::: -Puedes consultar la [lista de proveedores compatibles con MCP](./provider-list.mdx) para ver si tu proveedor es compatible. +Puedes consultar la [lista de proveedores compatibles con MCP](/provider-list) para ver si tu proveedor es compatible. ## Instala MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/es/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/es/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index 0fa2ed3..40d806d 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### Registro dinámico de clientes \{#dynamic-client-registration} -El registro dinámico de clientes no es necesario para este tutorial, pero puede ser útil si deseas automatizar el proceso de registro del cliente MCP con tu servidor de autorización. Consulta [¿Es necesario el registro dinámico de clientes?](../../provider-list.mdx#is-dcr-required) para más detalles. +El registro dinámico de clientes no es necesario para este tutorial, pero puede ser útil si deseas automatizar el proceso de registro del cliente MCP con tu servidor de autorización. Consulta [¿Es necesario el registro dinámico de clientes?](/provider-list#is-dcr-required) para más detalles. ## Comprende RBAC en el gestor de tareas \{#understand-rbac-in-todo-manager} diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 152faa9..9ab7990 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ Aunque OAuth 2.0 no define una forma estándar de obtener información de identi ### Registro dinámico de clientes \{#dynamic-client-registration} -El registro dinámico de clientes no es necesario para este tutorial, pero puede ser útil si deseas automatizar el proceso de registro del cliente MCP con tu servidor de autorización. Consulta [¿Es necesario el registro dinámico de clientes?](../../provider-list.mdx#is-dcr-required) para más detalles. +El registro dinámico de clientes no es necesario para este tutorial, pero puede ser útil si deseas automatizar el proceso de registro del cliente MCP con tu servidor de autorización. Consulta [¿Es necesario el registro dinámico de clientes?](/provider-list#is-dcr-required) para más detalles. ## Configura el servidor MCP \{#set-up-the-mcp-server} diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/es/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/es/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/es/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/es/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/es/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/es/docusaurus-plugin-content-pages/provider-list.mdx index 2ffaeeb..2e95940 100644 --- a/i18n/es/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/es/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: Lista de proveedores +title: Lista de proveedores compatibles con MCP --- + import TestProvider from '@site/src/components/TestProvider'; # Lista de proveedores compatibles con MCP diff --git a/i18n/fr/docusaurus-plugin-content-docs/current.json b/i18n/fr/docusaurus-plugin-content-docs/current.json index 303456c..71c3f74 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current.json +++ b/i18n/fr/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "Suivant", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "Tutoriels", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..71c3f74 --- /dev/null +++ b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "Tutoriels", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "Tutoriels", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "Configurer le serveur MCP", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "Configurer le serveur MCP", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "Références SDK", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "Références SDK de MCP Auth", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "Informations sur les classes, méthodes et propriétés extraites des SDK MCP Auth.\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "SDK Node.js", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "classes", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "fonctions", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "alias de types", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "variables", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/README.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 99% rename from i18n/fr/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index 3c30cbc..967af08 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ Bien que les deux derniers ne soient pas obligatoires, le premier est nécessair Dans le nouveau projet de spécification MCP, la RFC 8414 sera obligatoire pour les serveurs d'autorisation (fournisseurs). Nous mettrons à jour la documentation une fois le nouveau projet finalisé. ::: -Vous pouvez consulter la [liste des fournisseurs compatibles MCP](./provider-list.mdx) pour vérifier si votre fournisseur est pris en charge. +Vous pouvez consulter la [liste des fournisseurs compatibles MCP](/provider-list) pour vérifier si votre fournisseur est pris en charge. ## Installer MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index a628aa1..1efa1ab 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### Enregistrement dynamique de client \{#dynamic-client-registration} -L’enregistrement dynamique de client n’est pas requis pour ce tutoriel, mais il peut être utile si vous souhaitez automatiser le processus d’enregistrement du client MCP auprès de votre serveur d’autorisation. Consultez [L’enregistrement dynamique de client est-il requis ?](../../provider-list.mdx#is-dcr-required) pour plus de détails. +L’enregistrement dynamique de client n’est pas requis pour ce tutoriel, mais il peut être utile si vous souhaitez automatiser le processus d’enregistrement du client MCP auprès de votre serveur d’autorisation. Consultez [L’enregistrement dynamique de client est-il requis ?](/provider-list#is-dcr-required) pour plus de détails. ## Comprendre le RBAC dans le gestionnaire de tâches \{#understand-rbac-in-todo-manager} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 4d6c15a..23ce33a 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ Bien que OAuth 2.0 ne définisse pas de méthode standard pour récupérer les i ### Enregistrement dynamique du client \{#dynamic-client-registration} -L’enregistrement dynamique du client n’est pas requis pour ce tutoriel, mais il peut être utile si vous souhaitez automatiser le processus d’enregistrement du client MCP auprès de votre serveur d’autorisation. Consultez [L’enregistrement dynamique du client est-il requis ?](../../provider-list.mdx#is-dcr-required) pour plus de détails. +L’enregistrement dynamique du client n’est pas requis pour ce tutoriel, mais il peut être utile si vous souhaitez automatiser le processus d’enregistrement du client MCP auprès de votre serveur d’autorisation. Consultez [L’enregistrement dynamique du client est-il requis ?](/provider-list#is-dcr-required) pour plus de détails. ## Configurer le serveur MCP \{#set-up-the-mcp-server} diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/fr/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/fr/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/fr/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/fr/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/fr/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/fr/docusaurus-plugin-content-pages/provider-list.mdx index 28a3644..824d4b7 100644 --- a/i18n/fr/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/fr/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: Liste des fournisseurs +title: Liste des fournisseurs compatibles MCP --- + import TestProvider from '@site/src/components/TestProvider'; # Liste des fournisseurs compatibles MCP diff --git a/i18n/ja/docusaurus-plugin-content-docs/current.json b/i18n/ja/docusaurus-plugin-content-docs/current.json index a641c46..cb8187e 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current.json +++ b/i18n/ja/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "次へ", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "チュートリアル", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..cb8187e --- /dev/null +++ b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "チュートリアル", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "チュートリアル", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "MCPサーバーの設定", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "MCPサーバーの設定", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "SDKリファレンス", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "MCP Auth SDKリファレンス", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "MCP Auth SDKから抽出されたクラス、メソッド、プロパティに関する情報。\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "クラス", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "関数", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "型エイリアス", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "変数", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/README.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/ja/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index fdcb584..c8a5ba0 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ MCP 仕様では、認可 (Authorization) に関していくつかの [特定の 新しい MCP ドラフトでは、RFC 8414 が認可サーバー(プロバイダー)に必須となります。新しいドラフトが確定次第、ドキュメントを更新します。 ::: -[互換性のある MCP プロバイダーリスト](./provider-list.mdx) で、プロバイダーがサポートされているか確認できます。 +[互換性のある MCP プロバイダーリスト](/provider-list) で、プロバイダーがサポートされているか確認できます。 ## MCP Auth SDK をインストールする \{#install-mcp-auth-sdk} diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index 666cc29..976dadf 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -141,7 +141,7 @@ sequenceDiagram ### Dynamic Client Registration \{#dynamic-client-registration} -このチュートリアルでは Dynamic Client Registration は必須ではありませんが、認可サーバーへの MCP クライアント登録を自動化したい場合に便利です。詳細は [Dynamic Client Registration は必要ですか?](../../provider-list.mdx#is-dcr-required) をご覧ください。 +このチュートリアルでは Dynamic Client Registration は必須ではありませんが、認可サーバーへの MCP クライアント登録を自動化したい場合に便利です。詳細は [Dynamic Client Registration は必要ですか?](/provider-list#is-dcr-required) をご覧ください。 ## Todo マネージャーにおける RBAC を理解する \{#understand-rbac-in-todo-manager} diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 9322c77..2745ae6 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ OAuth 2.0 ではユーザーのアイデンティティ情報を取得する標 ### Dynamic Client Registration \{#dynamic-client-registration} -Dynamic Client Registration はこのチュートリアルでは必須ではありませんが、MCP クライアントの登録プロセスを認可 (Authorization) サーバーと自動化したい場合に便利です。詳細は [Dynamic Client Registration は必要ですか?](../../provider-list.mdx#is-dcr-required) をご覧ください。 +Dynamic Client Registration はこのチュートリアルでは必須ではありませんが、MCP クライアントの登録プロセスを認可 (Authorization) サーバーと自動化したい場合に便利です。詳細は [Dynamic Client Registration は必要ですか?](/provider-list#is-dcr-required) をご覧ください。 ## MCP サーバーのセットアップ \{#set-up-the-mcp-server} diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/ja/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/ja/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/ja/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/ja/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/ja/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/ja/docusaurus-plugin-content-pages/provider-list.mdx index 6007124..ae7663c 100644 --- a/i18n/ja/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/ja/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: プロバイダーリスト +title: MCP 互換プロバイダーリスト --- + import TestProvider from '@site/src/components/TestProvider'; # MCP 互換プロバイダーリスト diff --git a/i18n/ko/docusaurus-plugin-content-docs/current.json b/i18n/ko/docusaurus-plugin-content-docs/current.json index 8ebc609..47cfa53 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current.json +++ b/i18n/ko/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "다음", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "튜토리얼", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..47cfa53 --- /dev/null +++ b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "튜토리얼", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "튜토리얼", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "MCP 서버 구성", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "MCP 서버 구성", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "SDK 참조", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "MCP Auth SDK 참조", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "MCP Auth SDK에서 추출된 클래스, 메서드, 속성에 대한 정보.\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "클래스", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "함수", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "타입 별칭", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "변수", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/README.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/ko/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index b79822c..a10c9b4 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ MCP 명세는 인가 (Authorization)에 대해 몇 가지 [특정 요구사항]( 새로운 MCP 초안에서는 RFC 8414가 인가 서버(공급자)에서 필수로 요구됩니다. 새로운 초안이 확정되면 문서를 업데이트하겠습니다. ::: -[호환되는 MCP 공급자 목록](./provider-list.mdx)을 확인하여 사용 중인 공급자가 지원되는지 확인하세요. +[호환되는 MCP 공급자 목록](/provider-list)을 확인하여 사용 중인 공급자가 지원되는지 확인하세요. ## MCP Auth SDK 설치하기 \{#install-mcp-auth-sdk} diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index a0e9d21..bc8b779 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -140,7 +140,7 @@ sequenceDiagram ### 동적 클라이언트 등록 (Dynamic Client Registration) \{#dynamic-client-registration} -이 튜토리얼에서는 동적 클라이언트 등록이 필수는 아니지만, 인가 서버에 MCP 클라이언트 등록을 자동화하고 싶다면 유용할 수 있습니다. 자세한 내용은 [동적 클라이언트 등록이 필요한가요?](../../provider-list.mdx#is-dcr-required)를 참고하세요. +이 튜토리얼에서는 동적 클라이언트 등록이 필수는 아니지만, 인가 서버에 MCP 클라이언트 등록을 자동화하고 싶다면 유용할 수 있습니다. 자세한 내용은 [동적 클라이언트 등록이 필요한가요?](/provider-list#is-dcr-required)를 참고하세요. ## 할 일 관리 앱에서 RBAC 이해하기 (Understand RBAC in todo manager) \{#understand-rbac-in-todo-manager} diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 325551e..e0fb4d8 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ OAuth 2.0은 사용자 아이덴티티 정보를 조회하는 표준 방법을 ### 동적 클라이언트 등록 (Dynamic Client Registration) \{#dynamic-client-registration} -이 튜토리얼에서는 동적 클라이언트 등록이 필수는 아니지만, MCP 클라이언트 등록 과정을 자동화하고 싶다면 유용할 수 있습니다. 자세한 내용은 [동적 클라이언트 등록이 필요한가요?](../../provider-list.mdx#is-dcr-required) 를 참고하세요. +이 튜토리얼에서는 동적 클라이언트 등록이 필수는 아니지만, MCP 클라이언트 등록 과정을 자동화하고 싶다면 유용할 수 있습니다. 자세한 내용은 [동적 클라이언트 등록이 필요한가요?](/provider-list#is-dcr-required) 를 참고하세요. ## MCP 서버 설정하기 \{#set-up-the-mcp-server} diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/ko/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/ko/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/ko/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/ko/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/ko/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/ko/docusaurus-plugin-content-pages/provider-list.mdx index 3567295..328552b 100644 --- a/i18n/ko/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/ko/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: Provider list +title: MCP 호환 프로바이더 목록 --- + import TestProvider from '@site/src/components/TestProvider'; # MCP 호환 프로바이더 목록 diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current.json b/i18n/pt-BR/docusaurus-plugin-content-docs/current.json index d5b5c72..0f1b3eb 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current.json +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "Próximo", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "Tutoriais", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..0f1b3eb --- /dev/null +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "Tutoriais", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "Tutoriais", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "Configurar servidor MCP", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "Configurar servidor MCP", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "Referências do SDK", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "Referências do SDK MCP Auth", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "Informações sobre classes, métodos e propriedades extraídas do SDK MCP Auth.\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "Classes", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "Funções", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "Aliases de Tipo", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "Variáveis", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/README.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 99% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index b8ceb9e..39836ed 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ Embora os dois últimos não sejam obrigatórios, o primeiro é necessário para No novo draft do MCP, o RFC 8414 será obrigatório para servidores de autorização (provedores). Atualizaremos a documentação assim que o novo draft for finalizado. ::: -Você pode conferir a [lista de provedores compatíveis com MCP](./provider-list.mdx) para ver se seu provedor é suportado. +Você pode conferir a [lista de provedores compatíveis com MCP](/provider-list) para ver se seu provedor é suportado. ## Instale o MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index 1edf49a..e307cf5 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### Registro Dinâmico de Cliente \{#dynamic-client-registration} -O Registro Dinâmico de Cliente não é necessário para este tutorial, mas pode ser útil se você quiser automatizar o processo de registro do cliente MCP com seu servidor de autorização. Veja [Registro Dinâmico de Cliente é necessário?](../../provider-list.mdx#is-dcr-required) para mais detalhes. +O Registro Dinâmico de Cliente não é necessário para este tutorial, mas pode ser útil se você quiser automatizar o processo de registro do cliente MCP com seu servidor de autorização. Veja [Registro Dinâmico de Cliente é necessário?](/provider-list#is-dcr-required) para mais detalhes. ## Entenda RBAC no gerenciador de tarefas \{#understand-rbac-in-todo-manager} diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 2c5c65d..988ee4d 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ Embora o OAuth 2.0 não defina uma maneira padrão de recuperar informações de ### Registro dinâmico de cliente (Dynamic Client Registration) \{#dynamic-client-registration} -O registro dinâmico de cliente não é necessário para este tutorial, mas pode ser útil se você quiser automatizar o processo de registro do cliente MCP com seu servidor de autorização. Consulte [O registro dinâmico de cliente é necessário?](../../provider-list.mdx#is-dcr-required) para mais detalhes. +O registro dinâmico de cliente não é necessário para este tutorial, mas pode ser útil se você quiser automatizar o processo de registro do cliente MCP com seu servidor de autorização. Consulte [O registro dinâmico de cliente é necessário?](/provider-list#is-dcr-required) para mais detalhes. ## Configure o servidor MCP (Set up the MCP server) \{#set-up-the-mcp-server} diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/pt-BR/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/pt-BR/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/pt-BR/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/pt-BR/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/pt-BR/docusaurus-plugin-content-pages/provider-list.mdx index 3606945..294430a 100644 --- a/i18n/pt-BR/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/pt-BR/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: Lista de provedores +title: Lista de provedores compatíveis com MCP --- + import TestProvider from '@site/src/components/TestProvider'; # Lista de provedores compatíveis com MCP diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json index e34fb65..f4b7bf1 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "下一个", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "教程", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..f4b7bf1 --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "教程", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "教程", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "配置 MCP 服务器", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "配置 MCP 服务器", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "SDK 参考", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "MCP Auth SDK 参考", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "从 MCP Auth SDK 中提取的类、方法和属性信息。\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "类", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "函数", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "类型别名", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "变量", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/README.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index 3483a40..eb8ca61 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ MCP 规范对授权 (Authorization) 有一些[特定要求](https://modelcontext 在新的 MCP 草案中,RFC 8414 将对授权服务器(提供商)强制要求。我们会在新草案最终确定后更新文档。 ::: -你可以查看 [MCP 兼容提供商列表](./provider-list.mdx) 来确认你的提供商是否受支持。 +你可以查看 [MCP 兼容提供商列表](/provider-list) 来确认你的提供商是否受支持。 ## 安装 MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index 8b44e2d..16097e7 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### 动态客户端注册 (Dynamic Client Registration) \{#dynamic-client-registration} -本教程不要求动态客户端注册 (Dynamic Client Registration),但如果你想自动化 MCP 客户端在授权 (Authorization) 服务器的注册流程,可以参考 [是否需要动态客户端注册?](../../provider-list.mdx#is-dcr-required)。 +本教程不要求动态客户端注册 (Dynamic Client Registration),但如果你想自动化 MCP 客户端在授权 (Authorization) 服务器的注册流程,可以参考 [是否需要动态客户端注册?](/provider-list#is-dcr-required)。 ## 了解待办事项管理器中的 RBAC \{#understand-rbac-in-todo-manager} diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 809d92a..b46cb90 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ sequenceDiagram ### 动态客户端注册 (Dynamic Client Registration) \{#dynamic-client-registration} -本教程不要求动态客户端注册,但如果你希望自动化 MCP 客户端在授权 (Authorization) 服务器的注册流程,它会很有用。详见 [是否需要动态客户端注册?](../../provider-list.mdx#is-dcr-required)。 +本教程不要求动态客户端注册,但如果你希望自动化 MCP 客户端在授权 (Authorization) 服务器的注册流程,它会很有用。详见 [是否需要动态客户端注册?](/provider-list#is-dcr-required)。 ## 搭建 MCP 服务器 \{#set-up-the-mcp-server} diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/zh-CN/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/zh-CN/docusaurus-plugin-content-pages/provider-list.mdx similarity index 95% rename from i18n/zh-CN/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/zh-CN/docusaurus-plugin-content-pages/provider-list.mdx index cc0effc..7a902d6 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/zh-CN/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,6 +1,5 @@ --- -sidebar_position: 100 -sidebar_label: Provider list +title: 支持 MCP 的连接器 (Connector) 列表 --- import TestProvider from '@site/src/components/TestProvider'; @@ -28,7 +27,7 @@ import TestProvider from '@site/src/components/TestProvider'; [^4]: Auth0 和 Descope 支持多资源刷新令牌 (MRRT),但不完全支持 RFC 8707。资源指示器 (Resource Indicator) 支持有限,且不符合标准。 -## 动态客户端注册是必须的吗?\{#is-dcr-required} +## 动态客户端注册是必须的吗?{#is-dcr-required} [动态客户端注册](https://datatracker.ietf.org/doc/html/rfc7591) 并不是 MCP 服务器和 MCP Auth 的必需项。实际上,你可以选择最适合你需求的方式: @@ -38,7 +37,7 @@ import TestProvider from '@site/src/components/TestProvider'; 2. 或者,你可以开发自定义注册流程,让你的 MCP 客户端通过你控制的安全流程(如 Web 界面或 API 端点)在连接器 (Connector) 处注册,而无需依赖动态客户端注册。 只要你的连接器 (Connector) 支持 Management API 或类似功能,你就可以在自定义端点中使用它来注册 MCP 客户端。 -## 测试你的连接器 (Connector) \{#test-your-provider} +## 测试你的连接器 (Connector) {#test-your-provider} 在下方输入你的授权服务器的 `issuer` 或元数据端点 URL,检查其是否兼容 MCP。 diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current.json b/i18n/zh-TW/docusaurus-plugin-content-docs/current.json index 3ae3c41..17dfa6e 100644 --- a/i18n/zh-TW/docusaurus-plugin-content-docs/current.json +++ b/i18n/zh-TW/docusaurus-plugin-content-docs/current.json @@ -1,8 +1,4 @@ { - "version.label": { - "message": "下一個", - "description": "The label for version current" - }, "sidebar.docsSidebar.category.Tutorials": { "message": "教學", "description": "The label for category Tutorials in sidebar docsSidebar" diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1.json b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1.json new file mode 100644 index 0000000..17dfa6e --- /dev/null +++ b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1.json @@ -0,0 +1,50 @@ +{ + "sidebar.docsSidebar.category.Tutorials": { + "message": "教學", + "description": "The label for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Tutorials.link.generated-index.title": { + "message": "教學", + "description": "The generated-index page title for category Tutorials in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server": { + "message": "設定 MCP 伺服器", + "description": "The label for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Configure MCP server.link.generated-index.title": { + "message": "設定 MCP 伺服器", + "description": "The generated-index page title for category Configure MCP server in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references": { + "message": "SDK 參考", + "description": "The label for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.title": { + "message": "MCP Auth SDK 參考", + "description": "The generated-index page title for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.SDK references.link.generated-index.description": { + "message": "從 MCP Auth SDK 中擷取的類別、方法和屬性資訊。\n", + "description": "The generated-index page description for category SDK references in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.Node.js SDK": { + "message": "Node.js SDK", + "description": "The label for category Node.js SDK in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.classes": { + "message": "類別", + "description": "The label for category classes in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.functions": { + "message": "函式", + "description": "The label for category functions in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.type-aliases": { + "message": "型別別名", + "description": "The label for category type-aliases in sidebar docsSidebar" + }, + "sidebar.docsSidebar.category.variables": { + "message": "變數", + "description": "The label for category variables in sidebar docsSidebar" + } +} diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/README.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/README.mdx similarity index 98% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/README.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/README.mdx index 67f5554..fb42c69 100644 --- a/i18n/zh-TW/docusaurus-plugin-content-docs/current/README.mdx +++ b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/README.mdx @@ -22,7 +22,7 @@ MCP 規範對授權 (Authorization) 有一些[特定要求](https://modelcontext 在新的 MCP 草案中,RFC 8414 將成為授權伺服器(提供者)的強制要求。待新草案定稿後,我們會更新文件。 ::: -你可以查看 [MCP 相容提供者清單](./provider-list.mdx)來確認你的提供者是否受支援。 +你可以查看 [MCP 相容提供者清單](/provider-list)來確認你的提供者是否受支援。 ## 安裝 MCP Auth SDK \{#install-mcp-auth-sdk} diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/comparison.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/comparison.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/comparison.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/configure-server/bearer-auth.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/configure-server/bearer-auth.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/configure-server/mcp-auth.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/configure-server/mcp-auth.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/README.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/README.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/README.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuth.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuth.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthAuthServerError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthBearerAuthError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthConfigError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/classes/MCPAuthTokenVerificationError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/createVerifyJwt.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/createVerifyJwt.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/fetchServerConfigByWellKnownUrl.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/functions/handleBearerAuth.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/functions/handleBearerAuth.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigError.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigErrorCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarning.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerConfigWarningCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerErrorCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerSuccessCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthServerType.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthServerType.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/AuthorizationServerMetadata.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthErrorCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/BearerAuthJwtConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenFunction.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/type-aliases/VerifyAccessTokenMode.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/authServerErrorDescription.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authServerErrorDescription.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/authorizationServerMetadataSchema.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/bearerAuthErrorDescription.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/serverMetadataPaths.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/serverMetadataPaths.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/tokenVerificationErrorDescription.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/references/js/variables/validateServerConfig.md rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/references/js/variables/validateServerConfig.md diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/snippets/_get-started-code.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/snippets/_get-started-code.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx similarity index 99% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx index 2d60908..ba22af5 100644 --- a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/README.mdx +++ b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -145,7 +145,7 @@ sequenceDiagram ### 動態用戶端註冊 (Dynamic Client Registration) \{#dynamic-client-registration} -本教學不強制需要動態用戶端註冊,但若你想自動化 MCP 用戶端註冊流程,可參考 [是否需要 Dynamic Client Registration?](../../provider-list.mdx#is-dcr-required)。 +本教學不強制需要動態用戶端註冊,但若你想自動化 MCP 用戶端註冊流程,可參考 [是否需要 Dynamic Client Registration?](/provider-list#is-dcr-required)。 ## 瞭解 todo manager 的 RBAC (Understand RBAC in todo manager) \{#understand-rbac-in-todo-manager} diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_manual-metadata-fetching.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oauth-or-oidc.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_setup-oidc.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/todo-manager/_transpile-metadata.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx index 87b8d4f..5efdbf6 100644 --- a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/README.mdx +++ b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/README.mdx @@ -86,7 +86,7 @@ sequenceDiagram ### 動態用戶端註冊 (Dynamic Client Registration) \{#dynamic-client-registration} -本教學不強制需要動態用戶端註冊,但如果你想自動化 MCP 用戶端在授權伺服器的註冊流程,這會很有幫助。詳情請參閱 [是否需要動態用戶端註冊?](../../provider-list.mdx#is-dcr-required)。 +本教學不強制需要動態用戶端註冊,但如果你想自動化 MCP 用戶端在授權伺服器的註冊流程,這會很有幫助。詳情請參閱 [是否需要動態用戶端註冊?](/provider-list#is-dcr-required)。 ## 設定 MCP 伺服器 (Set up the MCP server) \{#set-up-the-mcp-server} diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_manual-metadata-fetching.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oauth.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_setup-oidc.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx b/i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx similarity index 100% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/tutorials/whoami/_transpile-metadata.mdx rename to i18n/zh-TW/docusaurus-plugin-content-docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx diff --git a/i18n/zh-TW/docusaurus-plugin-content-docs/current/provider-list.mdx b/i18n/zh-TW/docusaurus-plugin-content-pages/provider-list.mdx similarity index 98% rename from i18n/zh-TW/docusaurus-plugin-content-docs/current/provider-list.mdx rename to i18n/zh-TW/docusaurus-plugin-content-pages/provider-list.mdx index cb6ac0f..301eff0 100644 --- a/i18n/zh-TW/docusaurus-plugin-content-docs/current/provider-list.mdx +++ b/i18n/zh-TW/docusaurus-plugin-content-pages/provider-list.mdx @@ -1,8 +1,8 @@ --- -sidebar_position: 100 -sidebar_label: 提供者清單 +title: 支援 MCP 的提供者清單 --- + import TestProvider from '@site/src/components/TestProvider'; # 支援 MCP 的提供者清單 diff --git a/sidebars.ts b/sidebars.ts index 6c5c097..667d6c2 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -14,20 +14,29 @@ import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; */ const sidebars: SidebarsConfig = { // By default, Docusaurus generates a sidebar from the docs folder structure - docsSidebar: [{ type: 'autogenerated', dirName: '.' }], - - // But you can create a sidebar manually - /* - tutorialSidebar: [ - 'intro', - 'hello', + docsSidebar: [ + 'README', + { + type: 'category', + label: 'Configure Server', + items: ['configure-server/mcp-auth', 'configure-server/bearer-auth'], + }, + { + type: 'category', + label: 'Tutorials', + items: ['tutorials/todo-manager/README'], + }, { type: 'category', - label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], + label: 'References', + items: [ + { + type: 'autogenerated', + dirName: 'references', + }, + ], }, ], - */ }; export default sidebars; diff --git a/docs/provider-list.mdx b/src/pages/provider-list.mdx similarity index 95% rename from docs/provider-list.mdx rename to src/pages/provider-list.mdx index 27e864d..248e1a0 100644 --- a/docs/provider-list.mdx +++ b/src/pages/provider-list.mdx @@ -1,6 +1,5 @@ --- -sidebar_position: 100 -sidebar_label: Provider list +title: MCP-compatible provider list --- import TestProvider from '@site/src/components/TestProvider'; @@ -28,7 +27,7 @@ If you have tested MCP Auth with another provider, please feel free to submit a [^4]: Auth0 and Descope support multi-resource refresh tokens (MRRT) but not full RFC 8707. Resource indicator support is limited and not standards-based. -## Is Dynamic Client Registration required? \{#is-dcr-required} +## Is Dynamic Client Registration required? {#is-dcr-required} [Dynamic Client Registration](https://datatracker.ietf.org/doc/html/rfc7591) is not required for MCP servers and MCP Auth. In fact, you can choose the approach that best suits your needs: @@ -38,8 +37,8 @@ If you have tested MCP Auth with another provider, please feel free to submit a 2. Alternatively, you can develop a custom registration flow that allows your MCP clients to register with the provider using a secure and controlled process, such as a web interface or an API endpoint that you control, without relying on Dynamic Client Registration. As long as your provider supports Management API or similar functionality, you can use it in your custom endpoints to register the MCP clients. -## Test your provider \{#test-your-provider} +## Test your provider {#test-your-provider} Enter the URL of your authorization server's `issuer` or metadata endpoint below to check if it's compatible with MCP. - + \ No newline at end of file diff --git a/static/docs-assets/images/tutorials/todo-manager/inspector-first-run.png b/static/docs-assets/images/tutorials/todo-manager/inspector-first-run.png index 4a72d83..900ff04 100644 Binary files a/static/docs-assets/images/tutorials/todo-manager/inspector-first-run.png and b/static/docs-assets/images/tutorials/todo-manager/inspector-first-run.png differ diff --git a/static/docs-assets/images/tutorials/todo-manager/result.png b/static/docs-assets/images/tutorials/todo-manager/result.png index 5c29786..62bff16 100644 Binary files a/static/docs-assets/images/tutorials/todo-manager/result.png and b/static/docs-assets/images/tutorials/todo-manager/result.png differ diff --git a/versioned_docs/version-0.1.1/README.mdx b/versioned_docs/version-0.1.1/README.mdx new file mode 100644 index 0000000..a3d402e --- /dev/null +++ b/versioned_docs/version-0.1.1/README.mdx @@ -0,0 +1,242 @@ +--- +sidebar_position: 1 +sidebar_label: Get started +--- + +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +# Get started + +## Choose a compatible OAuth 2.1 or OpenID Connect provider \{#choose-a-compatible-oauth-2-1-or-openid-connect-provider} + +MCP specification has some [specific requirements](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#1-3-standards-compliance) for authorization: + +- [OAuth 2.1 IETF DRAFT](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-12) +- OAuth 2.0 Authorization Server Metadata ([RFC 8414](https://datatracker.ietf.org/doc/html/rfc8414)) +- OAuth 2.0 Dynamic Client Registration Protocol ([RFC 7591](https://datatracker.ietf.org/doc/html/rfc7591)) + +While the last two are not mandatory, the first one is necessary to ensure a secure and compliant implementation. + +:::note +In the new MCP draft, RFC 8414 will be mandated for authorization servers (providers). We'll update the documentation once the new draft is finalized. +::: + +You can check the [MCP-compatible provider list](/provider-list) to see if your provider is supported. + +## Install MCP Auth SDK \{#install-mcp-auth-sdk} + +MCP Auth is available for both Python and TypeScript. Let us know if you need support for another language or framework! + + + + +```bash +pip install mcpauth +``` + +Or any other package manager you prefer, such as pipenv or poetry. + + + + +```bash +npm install mcp-auth +``` + +Or any other package manager you prefer, such as pnpm or yarn. + + + + +## Init MCP Auth \{#init-mcp-auth} + +The first step is to initialize the MCP Auth instance with your provider's authorization server metadata. If your provider conforms one of: + +- [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) +- [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + +You can use the built-in function to fetch the metadata and initialize the MCP Auth instance: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config + +mcp_auth = MCPAuth( + server=fetch_server_config( + '', + type=AuthServerType.OIDC # or AuthServerType.OAUTH + ) +) +``` + + + + +```ts +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig('', { type: 'oidc' }), // or 'oauth' +}); +``` + + + + +If you need to manually specify the metadata URL or endpoints, check [Other ways to initialize MCP Auth](./configure-server/mcp-auth.mdx#other-ways). + +## Mount the metadata endpoint \{#mount-the-metadata-endpoint} + +To conform to the current MCP specification, MCP Auth mounts the OAuth 2.0 Authorization Server Metadata endpoint (`/.well-known/oauth-authorization-server`) to your MCP server: + + + + +```python +from starlette.applications import Starlette + +app = Starlette(routes=[ + mcp_auth.metadata_route(), +]) +``` + + + + +```ts +import express from 'express'; + +const app = express(); +app.use(mcpAuth.delegatedRouter()); +``` + + + + +The URLs in the metadata are kept as-is, so the role of authorization server is fully delegated to the provider. You can test the metadata endpoint by visiting `/.well-known/oauth-authorization-server` in your MCP server. + +### Why only the metadata endpoint? \{#why-only-the-metadata-endpoint} + +You may see the official SDKs provide an auth router that mounts authorization endpoints like `/authorize`, `/token`, etc. Here is why we don't do that: + +1. Mounting only the metadata endpoint allows you to leverage the full capabilities of your provider without "reinventing the wheel" and injecting unnecessary complexity into your MCP server. +2. There's also an ongoing effort to shift the [MCP server's role to a resource server](https://github.com/modelcontextprotocol/modelcontextprotocol/issues/205) and requires OAuth 2.0 Protected Resource Metadata ([RFC 9728](https://datatracker.ietf.org/doc/html/rfc9728)). Which means that the MCP server will **not handle any authorization logic anymore** (including the metadata endpoint), but only serve as a resource server that relies on the provider for authentication and authorization. + +:::note +We will update MCP Auth to support the new MCP specification when it is finalized. In the meantime, you can use the current version which is compatible with the current specification. +::: + +## Use the Bearer auth middleware \{#use-the-bearer-auth-middleware} + +Once the MCP Auth instance is initialized, you can apply the Bearer auth middleware to protect your MCP routes: + + + + +```python +from starlette.applications import Starlette +from starlette.middleware import Middleware +from starlette.routing import Mount +from mcpauth import MCPAuth +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP() +mcp_auth = MCPAuth( + # Initialize with your auth server config +) +bearer_auth = mcp_auth.bearer_auth_middleware( + "jwt", required_scopes=["read", "write"] +) + +app = Starlette(routes=[ + mcp_auth.metadata_route(), + Mount( + "/", + app=mcp.sse_app(), + middleware=[Middleware(bearer_auth)], + ), +]) +``` + + + + +```ts +import express from 'express'; +import { MCPAuth } from 'mcp-auth'; + +const app = express(); +const server = new McpServer(/* ... */); +const mcpAuth = new MCPAuth({ + /* ... */ +}); + +app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +``` + + + + +In the example above, we specified the `jwt` token type and required the `read` and `write` scopes. It will automatically validate the JWT (JSON Web Token) and populate an object with the authenticated user's information. + +:::info +Didn't hear about JWT (JSON Web Token) before? Don't worry, you can keep reading the documentation and we'll explain it when needed. You can also check [Auth Wiki](https://auth.wiki/jwt) for a quick introduction. +::: + +For more information on the Bearer auth configuration, check the [Configure Bearer auth](./configure-server/bearer-auth.mdx). + +## Retrieve the auth info in your MCP implementation \{#retrieve-the-auth-info-in-your-mcp-implementation} + +Once the Bearer auth middleware is applied, you can access the authenticated user's (or identity's) information in your MCP implementation: + + + + +MCP Auth will store the authenticated user's information in a context variable after successful authentication once the Bearer auth middleware is applied. You can access it in your MCP tool handlers like this: + +```python +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP() +mcp_auth = MCPAuth( + # Initialize with your auth server config +) + +@mcp.tool() +def add(a: int, b: int): + """ + A tool that adds two numbers. + The authenticated user's information will be available in the context. + """ + auth_info = mcp_auth.auth_info # Access the auth info in the current context + if auth_info: + print(f"Authenticated user: {auth_info.claims}") + return a + b +``` + + + + +The second argument of the tool handler will contain the `authInfo` object, which includes the authenticated user's information: + +```ts +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { z } from 'zod'; + +const server = new McpServer(/* ... */); +server.tool('add', { a: z.number(), b: z.number() }, async ({ a, b }, { authInfo }) => { + // Now you can use the `authInfo` object to access the authenticated information +}); +``` + + + + +## Next steps \{#next-steps} + +Continue reading to learn an end-to-end example of how to integrate MCP Auth with your MCP server, and how to handle the auth flow in MCP clients. diff --git a/docs/comparison.mdx b/versioned_docs/version-0.1.1/comparison.mdx similarity index 100% rename from docs/comparison.mdx rename to versioned_docs/version-0.1.1/comparison.mdx diff --git a/versioned_docs/version-0.1.1/configure-server/_category_.yml b/versioned_docs/version-0.1.1/configure-server/_category_.yml new file mode 100644 index 0000000..39830da --- /dev/null +++ b/versioned_docs/version-0.1.1/configure-server/_category_.yml @@ -0,0 +1,5 @@ +position: 3 +label: Configure MCP server +link: + type: generated-index + title: Configure MCP server diff --git a/versioned_docs/version-0.1.1/configure-server/bearer-auth.mdx b/versioned_docs/version-0.1.1/configure-server/bearer-auth.mdx new file mode 100644 index 0000000..3887228 --- /dev/null +++ b/versioned_docs/version-0.1.1/configure-server/bearer-auth.mdx @@ -0,0 +1,250 @@ +--- +sidebar_position: 2 +sidebar_label: Bearer auth +--- + +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +# Configure Bearer auth in MCP server + +MCP Auth provides various ways to configure Bearer authorization in your MCP server: + +- [JWT (JSON Web Token)](https://auth.wiki/jwt) mode: A built-in authorization method that verifies JWTs with claim assertions. +- Custom mode: Allows you to implement your own authorization logic. + +## Configure Bearer auth with JWT mode \{#configure-bearer-auth-with-jwt-mode} + +If your OAuth / OIDC provider issues JWTs for authorization, you can use the built-in JWT mode in MCP Auth. It verifies the JWT signature, expiration, and other claims you specify; then it populates the authentication information in the request context for further processing in your MCP implementation. + +### Scope validation \{#scope-validation} + +Here's an example of the basic scope validation: + + + + +```python +from mcpauth import MCPAuth +from starlette.applications import Starlette +from starlette.middleware import Middleware +from starlette.routing import Mount +from mcp.server.fastmcp import FastMCP + +mcp = FastMCP("MyMCPServer") +mcp_auth = MCPAuth( + # Initialize with your auth server config +) +bearer_auth = mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) # [!code highlight] + +app = Starlette( + routes=[Mount('/', app=mcp.sse_app(), middleware=[Middleware(bearer_auth)])] +) +``` + + + + +```ts +import express from 'express'; +import { MCPAuth } from 'mcp-auth'; + +const app = express(); +const mcpAuth = new MCPAuth({ + /* ... */ +}); +const bearerAuth = mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] }); // [!code highlight] + +app.use('/mcp', bearerAuth, (req, res) => { + // Now `req.auth` contains the auth info + console.log(req.auth); +}); +``` + + + + +In the example above, we specified that the JWT requires the `read` and `write` scopes. If the JWT does not contain **any** of these scopes, the request will be rejected with a 403 Forbidden error. + +### Resource indicator validation (RFC 8707) \{#resource-indicator-validation-rfc-8707} + +If your provider is based on OIDC, or supports the [Resource Indicator](https://datatracker.ietf.org/doc/html/rfc8707) extension, you may also specify the `audience` option to validate the `aud` (audience) claim in the JWT. This is useful to ensure that the JWT is intended for your MCP server. + +Check your provider's documentation to see if it supports the Resource Indicator extension and how to configure it. Some providers may use other terms like "audience", "API resource", or "API indicator" to refer to the same concept. + +Once the resource indicator is configured, you can specify it in the `bearerAuth` middleware: + + + + +```python +bearer_auth = mcp_auth.bearer_auth_middleware( + "jwt", + audience="https://api.example.com/mcp", # The expected audience for the JWT [!code highlight] + required_scopes=["read", "write"] +) +``` + + + + +```ts +const bearerAuth = mcpAuth.bearerAuth('jwt', { + audience: 'https://api.example.com/mcp', // The expected audience for the JWT [!code highlight] + requiredScopes: ['read', 'write'], +}); +``` + + + + +In the example above, MCP Auth will validate **both** the `aud` claim in the JWT and the required scopes. + +### Provide custom options to the JWT verification \{#provide-custom-options-to-the-jwt-verification} + +You can also provide custom options to the underlying JWT verification library: + + + + +In Python SDK, we use [PyJWT](https://pyjwt.readthedocs.io/en/stable/) for JWT verification. You can the following options: + +- `leeway`: Allow a certain amount of leeway when verifying the JWT expiration time (in seconds). Default is 60 seconds. + +```python +bearer_auth = mcp_auth.bearer_auth_middleware( + "jwt", + audience="https://api.example.com/mcp", + required_scopes=["read", "write"] + leeway=10, # Reduce clock skew by allowing 10 seconds leeway [!code highlight] +) +``` + + + + +In Node.js SDK, we use [jose](https://github.com/panva/jose) library for JWT verification. You can provide the following options: + +- `jwtVerify`: Options for the JWT verification process (`jwtVerify` function from `jose`). +- `remoteJwtSet`: Options for fetching the remote JWT set (`createRemoteJWKSet` function from `jose`). + +```ts {4-9} +const bearerAuth = mcpAuth.bearerAuth('jwt', { + audience: 'https://api.example.com/mcp', + requiredScopes: ['read', 'write'], + jwtVerify: { + clockTolerance: 60, // Allow a 60 seconds clock skew + }, + remoteJwtSet: { + timeoutDuration: 10 * 1000, // 10 seconds timeout for remote JWT set fetching + }, +}); +``` + + + + +## Configure Bearer auth with custom verification \{#configure-bearer-auth-with-custom-verification} + +If your OAuth / OIDC provider does not issue JWTs, or you want to implement your own authorization logic, MCP Auth allows you to create a custom verification function: + +:::info +Since the Bearer auth middleware will check against issuer (`iss`), audience (`aud`), and required scopes (`scope`) with the given verification result, there's no need to implement these checks in your custom verification function. You can focus on verifying the token validity (e.g., signature, expiration, etc.) and returning the auth info object. +::: + + + + +```python +from mcpauth.exceptions import MCPAuthJwtVerificationException, MCPAuthJwtVerificationExceptionCode +from mcpauth.types import AuthInfo + +async def custom_verification(token: str) -> AuthInfo: + # Implement your custom verification logic here + info = await verify_token(token) + if not info: + raise MCPAuthJwtVerificationException( + MCPAuthJwtVerificationExceptionCode.JWT_VERIFICATION_FAILED + ) + return info # Return the auth info object + +bearer_auth = mcp_auth.bearer_auth_middleware( + custom_verification, + required_scopes=["read", "write"] +) +``` + + + + +```ts +const bearerAuth = mcpAuth.bearerAuth( + async (token) => { + // Implement your custom verification logic here + const info = await verifyToken(token); + if (!info) { + throw new MCPAuthJwtVerificationError('jwt_verification_failed'); + } + return info; // Return the auth info object + }, + { requiredScopes: ['read', 'write'] } +); +``` + + + + +## Apply Bearer auth in your MCP server \{#apply-bearer-auth-in-your-mcp-server} + +To protect your MCP server with Bearer auth, you need to apply the Bearer auth middleware to your MCP server instance. + + + + +```python +bearer_auth = mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) +app = Starlette( + routes=[Mount('/', app=mcp.sse_app(), middleware=[Middleware(bearer_auth)])] +) +``` + + + + +```js +const app = express(); +app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +``` + + + + +This will ensure that all incoming requests are authenticated and authorized according to the configured Bearer auth settings, and the auth information will be available in the request context. + +You can then access the information in your MCP server implementation: + + + + +```python +@mcp.tool() +async def whoami() -> dict: + # `mcp_auth.auth_info` is the context object for the current request + auth_info = mcp_auth.auth_info + print(f"Authenticated user: {auth_info.subject}") + return {"subject": auth_info.subject} +``` + + + + +```js +// `authInfo` will be carried from the `req.auth` object +server.tool('whoami', ({ authInfo }) => { + console.log(`Authenticated user: ${authInfo.subject}`); + return { subject: authInfo.subject }; +}); +``` + + + diff --git a/versioned_docs/version-0.1.1/configure-server/mcp-auth.mdx b/versioned_docs/version-0.1.1/configure-server/mcp-auth.mdx new file mode 100644 index 0000000..cb5b4cd --- /dev/null +++ b/versioned_docs/version-0.1.1/configure-server/mcp-auth.mdx @@ -0,0 +1,208 @@ +--- +sidebar_position: 1 +sidebar_label: MCP Auth +--- + +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +# Configure MCP Auth in MCP server + +To connect your MCP server to an OAuth 2.1 or OpenID Connect provider, you need to configure the MCP Auth instance. This involves initializing the instance with your provider's authorization server metadata and setting up the necessary authorization flows. + +## Init MCP Auth \{#init-mcp-auth} + +### Automatic metadata fetching \{#automatic-metadata-fetching} + +The easiest way to initialize the MCP Auth instance is by using the built-in functions that fetch the metadata from a well-known URL. If your provider conforms to one of the following standards: + +- [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) +- [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + +You can use the `fetchServerConfig` to automatically retrieve the metadata by providing the `issuer` URL: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType, fetch_server_config + +mcp_auth = MCPAuth( + server=fetch_server_config( + '', + type=AuthServerType.OIDC # or AuthServerType.OAUTH + ) +) +``` + + + + +```ts +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig('', { type: 'oidc' }), // or 'oauth' +}); +``` + + + + +If your issuer includes a path, the behavior differs slightly between OAuth 2.0 and OpenID Connect: + +- **OAuth 2.0**: The well-known URL is appended to the **domain** of the issuer. For example, if your issuer is `https://my-project.logto.app/oauth`, the well-known URL will be `https://auth.logto.io/.well-known/oauth-authorization-server/oauth`. +- **OpenID Connect**: The well-known URL is appended directly to the **issuer**. For example, if your issuer is `https://my-project.logto.app/oidc`, the well-known URL will be `https://auth.logto.io/oidc/.well-known/openid-configuration`. + +### Other ways to initialize MCP Auth \{#other-ways} + +#### Custom data transpilation \{#custom-data-transpilation} + +In some cases, the metadata returned by the provider may not conform to the expected format. If you are confident that the provider is compliant, you can use the `transpile_data` option to modify the metadata before it is used: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config + +mcp_auth = MCPAuth( + server=fetch_server_config( + '', + type=AuthServerType.OIDC, + transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] + ) +) +``` + + + + +```ts +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig('', { + type: 'oidc', + transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] + }), +}); +``` + + + + +This allows you to modify the metadata object before it is used by MCP Auth. For example, you can add or remove fields, change their values, or convert them to a different format. + +#### Fetch metadata from a specific URL \{#fetch-metadata-from-a-specific-url} + +If your provider has a specific metadata URL rather than the standard ones, you can use it similarly: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config_by_well_known_url + +mcp_auth = MCPAuth( + server=fetch_server_config_by_well_known_url( + '', + type=AuthServerType.OIDC # or AuthServerType.OAUTH + ) +) +``` + + + + +```ts +import { MCPAuth, fetchServerConfigByWellKnownUrl } from 'mcp-auth'; + +const mcpAuth = new MCPAuth({ + server: await fetchServerConfigByWellKnownUrl('', { type: 'oidc' }), // or 'oauth' +}); +``` + + + + +#### Fetch metadata from a specific URL with custom data transpilation \{#fetch-metadata-from-a-specific-url-with-custom-data-transpilation} + +In some cases, the provider response may be malformed or not conforming to the expected metadata format. If you are confident that the provider is compliant, you can transpile the metadata via the config option: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType, fetch_server_config_by_well_known_url + +mcp_auth = MCPAuth( + server=fetch_server_config_by_well_known_url( + '', + type=AuthServerType.OIDC, + transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] + ) +) +``` + + + + +```ts +const mcpAuth = new MCPAuth({ + server: await fetchServerConfigByWellKnownUrl('', { + type: 'oidc', + transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] + }), +}); +``` + + + + +#### Manually provide metadata \{#manually-provide-metadata} + +If your provider does not support metadata fetching, you can manually provide the metadata object: + + + + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerConfig, AuthServerType, AuthorizationServerMetadata + +mcp_auth = MCPAuth( + server=AuthServerConfig( + type=AuthServerType.OIDC, # or AuthServerType.OAUTH + metadata=AuthorizationServerMetadata( + issuer='', + authorization_endpoint='', + # ... other metadata fields + ), + ) +) +``` + + + + +```ts +const mcpAuth = new MCPAuth({ + server: { + metadata: { + issuer: '', + // Metadata fields should be camelCase + authorizationEndpoint: '', + // ... other metadata fields + }, + type: 'oidc', // or 'oauth' + }, +}); +``` + + + diff --git a/versioned_docs/version-0.1.1/references/_category_.yml b/versioned_docs/version-0.1.1/references/_category_.yml new file mode 100644 index 0000000..bd1ab82 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/_category_.yml @@ -0,0 +1,7 @@ +position: 100 +label: SDK references +link: + type: generated-index + title: MCP Auth SDK references + description: > + Information about classes, methods, and properties extracted from the MCP Auth SDKs. diff --git a/versioned_docs/version-0.1.1/references/js/README.md b/versioned_docs/version-0.1.1/references/js/README.md new file mode 100644 index 0000000..f0875b7 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/README.md @@ -0,0 +1,52 @@ +--- +sidebar_label: Node.js SDK +--- + +# MCP Auth Node.js SDK reference + +## Classes {#classes} + +- [MCPAuth](/references/js/classes/MCPAuth.md) +- [MCPAuthAuthServerError](/references/js/classes/MCPAuthAuthServerError.md) +- [MCPAuthBearerAuthError](/references/js/classes/MCPAuthBearerAuthError.md) +- [MCPAuthConfigError](/references/js/classes/MCPAuthConfigError.md) +- [MCPAuthError](/references/js/classes/MCPAuthError.md) +- [MCPAuthTokenVerificationError](/references/js/classes/MCPAuthTokenVerificationError.md) + +## Type Aliases {#type-aliases} + +- [AuthorizationServerMetadata](/references/js/type-aliases/AuthorizationServerMetadata.md) +- [AuthServerConfig](/references/js/type-aliases/AuthServerConfig.md) +- [AuthServerConfigError](/references/js/type-aliases/AuthServerConfigError.md) +- [AuthServerConfigErrorCode](/references/js/type-aliases/AuthServerConfigErrorCode.md) +- [AuthServerConfigWarning](/references/js/type-aliases/AuthServerConfigWarning.md) +- [AuthServerConfigWarningCode](/references/js/type-aliases/AuthServerConfigWarningCode.md) +- [AuthServerErrorCode](/references/js/type-aliases/AuthServerErrorCode.md) +- [AuthServerSuccessCode](/references/js/type-aliases/AuthServerSuccessCode.md) +- [AuthServerType](/references/js/type-aliases/AuthServerType.md) +- [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) +- [BearerAuthErrorCode](/references/js/type-aliases/BearerAuthErrorCode.md) +- [BearerAuthJwtConfig](/references/js/type-aliases/BearerAuthJwtConfig.md) +- [CamelCaseAuthorizationServerMetadata](/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md) +- [MCPAuthBearerAuthErrorDetails](/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md) +- [MCPAuthConfig](/references/js/type-aliases/MCPAuthConfig.md) +- [MCPAuthTokenVerificationErrorCode](/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md) +- [VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) +- [VerifyAccessTokenMode](/references/js/type-aliases/VerifyAccessTokenMode.md) + +## Variables {#variables} + +- [authorizationServerMetadataSchema](/references/js/variables/authorizationServerMetadataSchema.md) +- [authServerErrorDescription](/references/js/variables/authServerErrorDescription.md) +- [bearerAuthErrorDescription](/references/js/variables/bearerAuthErrorDescription.md) +- [camelCaseAuthorizationServerMetadataSchema](/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md) +- [serverMetadataPaths](/references/js/variables/serverMetadataPaths.md) +- [tokenVerificationErrorDescription](/references/js/variables/tokenVerificationErrorDescription.md) +- [validateServerConfig](/references/js/variables/validateServerConfig.md) + +## Functions {#functions} + +- [createVerifyJwt](/references/js/functions/createVerifyJwt.md) +- [fetchServerConfig](/references/js/functions/fetchServerConfig.md) +- [fetchServerConfigByWellKnownUrl](/references/js/functions/fetchServerConfigByWellKnownUrl.md) +- [handleBearerAuth](/references/js/functions/handleBearerAuth.md) diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuth.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuth.md new file mode 100644 index 0000000..d6f82db --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuth.md @@ -0,0 +1,214 @@ +--- +sidebar_label: MCPAuth +--- + +# Class: MCPAuth + +The main class for the mcp-auth library, which provides methods to create routers and useful +handlers for authentication and authorization in MCP servers. + +## See {#see} + +[MCP Auth](https://mcp-auth.dev) for more information about the library and its +usage. + +## Example {#example} + +An example integrating with a remote OIDC provider: + +```ts +import express from 'express'; +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const app = express(); +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig( + 'https://auth.logto.io/oidc', + { type: 'oidc' } + ), +}); + +// Mount the router to handle OAuth 2.0 Authorization Server Metadata +app.use(mcpAuth.delegatedRouter()); + +// Use the Bearer auth handler the MCP route +app.get( + '/mcp', + mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] }), + (req, res) => { + console.log('Auth info:', req.auth); + // Handle the MCP request here + }, +); + +// Use the auth info in the MCP callback +server.tool( + 'add', + { a: z.number(), b: z.number() }, + async ({ a, b }, { authInfo }) => { + console.log('Auth Info:', authInfo); + // ... + }, +); +``` + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuth(config: MCPAuthConfig): MCPAuth; +``` + +#### Parameters {#parameters} + +##### config {#config} + +[`MCPAuthConfig`](/references/js/type-aliases/MCPAuthConfig.md) + +#### Returns {#returns} + +`MCPAuth` + +## Properties {#properties} + +### config {#config} + +```ts +readonly config: MCPAuthConfig; +``` + +## Methods {#methods} + +### bearerAuth() {#bearerauth} + +#### Call Signature {#call-signature} + +```ts +bearerAuth(verifyAccessToken: VerifyAccessTokenFunction, config?: Omit): RequestHandler; +``` + +Creates a Bearer auth handler (Express middleware) that verifies the access token in the +`Authorization` header of the request. + +##### Parameters {#parameters} + +###### verifyAccessToken {#verifyaccesstoken} + +[`VerifyAccessTokenFunction`](/references/js/type-aliases/VerifyAccessTokenFunction.md) + +A function that verifies the access token. It should accept the +access token as a string and return a promise (or a value) that resolves to the +verification result. + +**See** + +[VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for the type definition of the +`verifyAccessToken` function. + +###### config? {#config} + +`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"verifyAccessToken"` \| `"issuer"`\> + +Optional configuration for the Bearer auth handler. + +**See** + +[BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the available configuration options (excluding +`verifyAccessToken` and `issuer`). + +##### Returns {#returns} + +`RequestHandler` + +An Express middleware function that verifies the access token and adds the +verification result to the request object (`req.auth`). + +##### See {#see} + +[handleBearerAuth](/references/js/functions/handleBearerAuth.md) for the implementation details and the extended types of the +`req.auth` (`AuthInfo`) object. + +#### Call Signature {#call-signature} + +```ts +bearerAuth(mode: "jwt", config?: Omit & BearerAuthJwtConfig): RequestHandler; +``` + +Creates a Bearer auth handler (Express middleware) that verifies the access token in the +`Authorization` header of the request using a predefined mode of verification. + +In the `'jwt'` mode, the handler will create a JWT verification function using the JWK Set +from the authorization server's JWKS URI. + +##### Parameters {#parameters} + +###### mode {#mode} + +`"jwt"` + +The mode of verification for the access token. Currently, only 'jwt' is supported. + +**See** + +[VerifyAccessTokenMode](/references/js/type-aliases/VerifyAccessTokenMode.md) for the available modes. + +###### config? {#config} + +`Omit`\<[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md), `"verifyAccessToken"` \| `"issuer"`\> & [`BearerAuthJwtConfig`](/references/js/type-aliases/BearerAuthJwtConfig.md) + +Optional configuration for the Bearer auth handler, including JWT verification options and +remote JWK set options. + +**See** + + - [BearerAuthJwtConfig](/references/js/type-aliases/BearerAuthJwtConfig.md) for the available configuration options for JWT +verification. + - [BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the available configuration options (excluding +`verifyAccessToken` and `issuer`). + +##### Returns {#returns} + +`RequestHandler` + +An Express middleware function that verifies the access token and adds the +verification result to the request object (`req.auth`). + +##### See {#see} + +[handleBearerAuth](/references/js/functions/handleBearerAuth.md) for the implementation details and the extended types of the +`req.auth` (`AuthInfo`) object. + +##### Throws {#throws} + +if the JWKS URI is not provided in the server metadata when +using the `'jwt'` mode. + +*** + +### delegatedRouter() {#delegatedrouter} + +```ts +delegatedRouter(): Router; +``` + +Creates a delegated router that serves the OAuth 2.0 Authorization Server Metadata endpoint +(`/.well-known/oauth-authorization-server`) with the metadata provided to the instance. + +#### Returns {#returns} + +`Router` + +A router that serves the OAuth 2.0 Authorization Server Metadata endpoint with the +metadata provided to the instance. + +#### Example {#example} + +```ts +import express from 'express'; +import { MCPAuth } from 'mcp-auth'; + +const app = express(); +const mcpAuth: MCPAuth; // Assume this is initialized +app.use(mcpAuth.delegatedRouter()); +``` diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md new file mode 100644 index 0000000..4b9c556 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthAuthServerError.md @@ -0,0 +1,198 @@ +--- +sidebar_label: MCPAuthAuthServerError +--- + +# Class: MCPAuthAuthServerError + +Error thrown when there is an issue with the remote authorization server. + +## Extends {#extends} + +- [`MCPAuthError`](/references/js/classes/MCPAuthError.md) + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuthAuthServerError(code: AuthServerErrorCode, cause?: unknown): MCPAuthAuthServerError; +``` + +#### Parameters {#parameters} + +##### code {#code} + +[`AuthServerErrorCode`](/references/js/type-aliases/AuthServerErrorCode.md) + +##### cause? {#cause} + +`unknown` + +#### Returns {#returns} + +`MCPAuthAuthServerError` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) + +## Properties {#properties} + +### cause? {#cause} + +```ts +readonly optional cause: unknown; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) + +*** + +### code {#code} + +```ts +readonly code: AuthServerErrorCode; +``` + +The error code in snake_case format. + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) + +*** + +### message {#message} + +```ts +message: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) + +*** + +### name {#name} + +```ts +name: string = 'MCPAuthAuthServerError'; +``` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) + +*** + +### stack? {#stack} + +```ts +optional stack: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) + +*** + +### prepareStackTrace()? {#preparestacktrace} + +```ts +static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +``` + +Optional override for formatting stack traces + +#### Parameters {#parameters} + +##### err {#err} + +`Error` + +##### stackTraces {#stacktraces} + +`CallSite`[] + +#### Returns {#returns} + +`any` + +#### See {#see} + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) + +*** + +### stackTraceLimit {#stacktracelimit} + +```ts +static stackTraceLimit: number; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) + +## Methods {#methods} + +### toJson() {#tojson} + +```ts +toJson(showCause: boolean): Record; +``` + +Converts the error to a HTTP response friendly JSON format. + +#### Parameters {#parameters} + +##### showCause {#showcause} + +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns {#returns} + +`Record`\<`string`, `unknown`\> + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) + +*** + +### captureStackTrace() {#capturestacktrace} + +```ts +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +``` + +Create .stack property on a target object + +#### Parameters {#parameters} + +##### targetObject {#targetobject} + +`object` + +##### constructorOpt? {#constructoropt} + +`Function` + +#### Returns {#returns} + +`void` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md new file mode 100644 index 0000000..7990bdc --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthBearerAuthError.md @@ -0,0 +1,198 @@ +--- +sidebar_label: MCPAuthBearerAuthError +--- + +# Class: MCPAuthBearerAuthError + +Error thrown when there is an issue when authenticating with Bearer tokens. + +## Extends {#extends} + +- [`MCPAuthError`](/references/js/classes/MCPAuthError.md) + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuthBearerAuthError(code: BearerAuthErrorCode, cause?: MCPAuthBearerAuthErrorDetails): MCPAuthBearerAuthError; +``` + +#### Parameters {#parameters} + +##### code {#code} + +[`BearerAuthErrorCode`](/references/js/type-aliases/BearerAuthErrorCode.md) + +##### cause? {#cause} + +[`MCPAuthBearerAuthErrorDetails`](/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md) + +#### Returns {#returns} + +`MCPAuthBearerAuthError` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) + +## Properties {#properties} + +### cause? {#cause} + +```ts +readonly optional cause: MCPAuthBearerAuthErrorDetails; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) + +*** + +### code {#code} + +```ts +readonly code: BearerAuthErrorCode; +``` + +The error code in snake_case format. + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) + +*** + +### message {#message} + +```ts +message: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) + +*** + +### name {#name} + +```ts +name: string = 'MCPAuthBearerAuthError'; +``` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) + +*** + +### stack? {#stack} + +```ts +optional stack: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) + +*** + +### prepareStackTrace()? {#preparestacktrace} + +```ts +static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +``` + +Optional override for formatting stack traces + +#### Parameters {#parameters} + +##### err {#err} + +`Error` + +##### stackTraces {#stacktraces} + +`CallSite`[] + +#### Returns {#returns} + +`any` + +#### See {#see} + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) + +*** + +### stackTraceLimit {#stacktracelimit} + +```ts +static stackTraceLimit: number; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) + +## Methods {#methods} + +### toJson() {#tojson} + +```ts +toJson(showCause: boolean): Record; +``` + +Converts the error to a HTTP response friendly JSON format. + +#### Parameters {#parameters} + +##### showCause {#showcause} + +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns {#returns} + +`Record`\<`string`, `unknown`\> + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) + +*** + +### captureStackTrace() {#capturestacktrace} + +```ts +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +``` + +Create .stack property on a target object + +#### Parameters {#parameters} + +##### targetObject {#targetobject} + +`object` + +##### constructorOpt? {#constructoropt} + +`Function` + +#### Returns {#returns} + +`void` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md new file mode 100644 index 0000000..8047fdd --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthConfigError.md @@ -0,0 +1,202 @@ +--- +sidebar_label: MCPAuthConfigError +--- + +# Class: MCPAuthConfigError + +Error thrown when there is a configuration issue with mcp-auth. + +## Extends {#extends} + +- [`MCPAuthError`](/references/js/classes/MCPAuthError.md) + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuthConfigError(code: string, message: string): MCPAuthConfigError; +``` + +#### Parameters {#parameters} + +##### code {#code} + +`string` + +The error code in snake_case format. + +##### message {#message} + +`string` + +A human-readable description of the error. + +#### Returns {#returns} + +`MCPAuthConfigError` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) + +## Properties {#properties} + +### cause? {#cause} + +```ts +optional cause: unknown; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) + +*** + +### code {#code} + +```ts +readonly code: string; +``` + +The error code in snake_case format. + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) + +*** + +### message {#message} + +```ts +message: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) + +*** + +### name {#name} + +```ts +name: string = 'MCPAuthConfigError'; +``` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) + +*** + +### stack? {#stack} + +```ts +optional stack: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) + +*** + +### prepareStackTrace()? {#preparestacktrace} + +```ts +static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +``` + +Optional override for formatting stack traces + +#### Parameters {#parameters} + +##### err {#err} + +`Error` + +##### stackTraces {#stacktraces} + +`CallSite`[] + +#### Returns {#returns} + +`any` + +#### See {#see} + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) + +*** + +### stackTraceLimit {#stacktracelimit} + +```ts +static stackTraceLimit: number; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) + +## Methods {#methods} + +### toJson() {#tojson} + +```ts +toJson(showCause: boolean): Record; +``` + +Converts the error to a HTTP response friendly JSON format. + +#### Parameters {#parameters} + +##### showCause {#showcause} + +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns {#returns} + +`Record`\<`string`, `unknown`\> + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) + +*** + +### captureStackTrace() {#capturestacktrace} + +```ts +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +``` + +Create .stack property on a target object + +#### Parameters {#parameters} + +##### targetObject {#targetobject} + +`object` + +##### constructorOpt? {#constructoropt} + +`Function` + +#### Returns {#returns} + +`void` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuthError.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthError.md new file mode 100644 index 0000000..6bffab7 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthError.md @@ -0,0 +1,219 @@ +--- +sidebar_label: MCPAuthError +--- + +# Class: MCPAuthError + +Base class for all mcp-auth errors. + +It provides a standardized way to handle errors related to MCP authentication and authorization. + +## Extends {#extends} + +- `Error` + +## Extended by {#extended-by} + +- [`MCPAuthConfigError`](/references/js/classes/MCPAuthConfigError.md) +- [`MCPAuthAuthServerError`](/references/js/classes/MCPAuthAuthServerError.md) +- [`MCPAuthBearerAuthError`](/references/js/classes/MCPAuthBearerAuthError.md) +- [`MCPAuthTokenVerificationError`](/references/js/classes/MCPAuthTokenVerificationError.md) + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuthError(code: string, message: string): MCPAuthError; +``` + +#### Parameters {#parameters} + +##### code {#code} + +`string` + +The error code in snake_case format. + +##### message {#message} + +`string` + +A human-readable description of the error. + +#### Returns {#returns} + +`MCPAuthError` + +#### Overrides {#overrides} + +```ts +Error.constructor +``` + +## Properties {#properties} + +### cause? {#cause} + +```ts +optional cause: unknown; +``` + +#### Inherited from {#inherited-from} + +```ts +Error.cause +``` + +*** + +### code {#code} + +```ts +readonly code: string; +``` + +The error code in snake_case format. + +*** + +### message {#message} + +```ts +message: string; +``` + +#### Inherited from {#inherited-from} + +```ts +Error.message +``` + +*** + +### name {#name} + +```ts +name: string = 'MCPAuthError'; +``` + +#### Overrides {#overrides} + +```ts +Error.name +``` + +*** + +### stack? {#stack} + +```ts +optional stack: string; +``` + +#### Inherited from {#inherited-from} + +```ts +Error.stack +``` + +*** + +### prepareStackTrace()? {#preparestacktrace} + +```ts +static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +``` + +Optional override for formatting stack traces + +#### Parameters {#parameters} + +##### err {#err} + +`Error` + +##### stackTraces {#stacktraces} + +`CallSite`[] + +#### Returns {#returns} + +`any` + +#### See {#see} + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from {#inherited-from} + +```ts +Error.prepareStackTrace +``` + +*** + +### stackTraceLimit {#stacktracelimit} + +```ts +static stackTraceLimit: number; +``` + +#### Inherited from {#inherited-from} + +```ts +Error.stackTraceLimit +``` + +## Methods {#methods} + +### toJson() {#tojson} + +```ts +toJson(showCause: boolean): Record; +``` + +Converts the error to a HTTP response friendly JSON format. + +#### Parameters {#parameters} + +##### showCause {#showcause} + +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns {#returns} + +`Record`\<`string`, `unknown`\> + +*** + +### captureStackTrace() {#capturestacktrace} + +```ts +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +``` + +Create .stack property on a target object + +#### Parameters {#parameters} + +##### targetObject {#targetobject} + +`object` + +##### constructorOpt? {#constructoropt} + +`Function` + +#### Returns {#returns} + +`void` + +#### Inherited from {#inherited-from} + +```ts +Error.captureStackTrace +``` diff --git a/versioned_docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md new file mode 100644 index 0000000..78be151 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/classes/MCPAuthTokenVerificationError.md @@ -0,0 +1,198 @@ +--- +sidebar_label: MCPAuthTokenVerificationError +--- + +# Class: MCPAuthTokenVerificationError + +Error thrown when there is an issue when verifying tokens. + +## Extends {#extends} + +- [`MCPAuthError`](/references/js/classes/MCPAuthError.md) + +## Constructors {#constructors} + +### Constructor {#constructor} + +```ts +new MCPAuthTokenVerificationError(code: MCPAuthTokenVerificationErrorCode, cause?: unknown): MCPAuthTokenVerificationError; +``` + +#### Parameters {#parameters} + +##### code {#code} + +[`MCPAuthTokenVerificationErrorCode`](/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md) + +##### cause? {#cause} + +`unknown` + +#### Returns {#returns} + +`MCPAuthTokenVerificationError` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`constructor`](/references/js/classes/MCPAuthError.md#constructor) + +## Properties {#properties} + +### cause? {#cause} + +```ts +readonly optional cause: unknown; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`cause`](/references/js/classes/MCPAuthError.md#cause) + +*** + +### code {#code} + +```ts +readonly code: MCPAuthTokenVerificationErrorCode; +``` + +The error code in snake_case format. + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`code`](/references/js/classes/MCPAuthError.md#code) + +*** + +### message {#message} + +```ts +message: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`message`](/references/js/classes/MCPAuthError.md#message) + +*** + +### name {#name} + +```ts +name: string = 'MCPAuthTokenVerificationError'; +``` + +#### Overrides {#overrides} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`name`](/references/js/classes/MCPAuthError.md#name) + +*** + +### stack? {#stack} + +```ts +optional stack: string; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stack`](/references/js/classes/MCPAuthError.md#stack) + +*** + +### prepareStackTrace()? {#preparestacktrace} + +```ts +static optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any; +``` + +Optional override for formatting stack traces + +#### Parameters {#parameters} + +##### err {#err} + +`Error` + +##### stackTraces {#stacktraces} + +`CallSite`[] + +#### Returns {#returns} + +`any` + +#### See {#see} + +https://v8.dev/docs/stack-trace-api#customizing-stack-traces + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`prepareStackTrace`](/references/js/classes/MCPAuthError.md#preparestacktrace) + +*** + +### stackTraceLimit {#stacktracelimit} + +```ts +static stackTraceLimit: number; +``` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`stackTraceLimit`](/references/js/classes/MCPAuthError.md#stacktracelimit) + +## Methods {#methods} + +### toJson() {#tojson} + +```ts +toJson(showCause: boolean): Record; +``` + +Converts the error to a HTTP response friendly JSON format. + +#### Parameters {#parameters} + +##### showCause {#showcause} + +`boolean` = `false` + +Whether to include the cause of the error in the JSON response. +Defaults to `false`. + +#### Returns {#returns} + +`Record`\<`string`, `unknown`\> + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`toJson`](/references/js/classes/MCPAuthError.md#tojson) + +*** + +### captureStackTrace() {#capturestacktrace} + +```ts +static captureStackTrace(targetObject: object, constructorOpt?: Function): void; +``` + +Create .stack property on a target object + +#### Parameters {#parameters} + +##### targetObject {#targetobject} + +`object` + +##### constructorOpt? {#constructoropt} + +`Function` + +#### Returns {#returns} + +`void` + +#### Inherited from {#inherited-from} + +[`MCPAuthError`](/references/js/classes/MCPAuthError.md).[`captureStackTrace`](/references/js/classes/MCPAuthError.md#capturestacktrace) diff --git a/versioned_docs/version-0.1.1/references/js/functions/createVerifyJwt.md b/versioned_docs/version-0.1.1/references/js/functions/createVerifyJwt.md new file mode 100644 index 0000000..c7126e8 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/functions/createVerifyJwt.md @@ -0,0 +1,47 @@ +--- +sidebar_label: createVerifyJwt +--- + +# Function: createVerifyJwt() + +```ts +function createVerifyJwt(getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): VerifyAccessTokenFunction; +``` + +Creates a function to verify JWT access tokens using the provided key retrieval function +and options. + +## Parameters {#parameters} + +### getKey {#getkey} + +`JWTVerifyGetKey` + +The function to retrieve the key used to verify the JWT. + +**See** + +JWTVerifyGetKey for the type definition of the key retrieval function. + +### options? {#options} + +`JWTVerifyOptions` + +Optional JWT verification options. + +**See** + +JWTVerifyOptions for the type definition of the options. + +## Returns {#returns} + +[`VerifyAccessTokenFunction`](/references/js/type-aliases/VerifyAccessTokenFunction.md) + +A function that verifies JWT access tokens and returns an AuthInfo object if +the token is valid. It requires the JWT to contain the fields `iss`, `client_id`, and `sub` in +its payload, and it can optionally contain `scope` or `scopes` fields. The function uses the +`jose` library under the hood to perform the JWT verification. + +## See {#see} + +[VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for the type definition of the returned function. diff --git a/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfig.md b/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfig.md new file mode 100644 index 0000000..2c9f186 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfig.md @@ -0,0 +1,64 @@ +--- +sidebar_label: fetchServerConfig +--- + +# Function: fetchServerConfig() + +```ts +function fetchServerConfig(issuer: string, config: ServerMetadataConfig): Promise; +``` + +Fetches the server configuration according to the issuer and authorization server type. + +This function automatically determines the well-known URL based on the server type, as OAuth and +OpenID Connect servers have different conventions for their metadata endpoints. + +## Parameters {#parameters} + +### issuer {#issuer} + +`string` + +The issuer URL of the authorization server. + +### config {#config} + +`ServerMetadataConfig` + +The configuration object containing the server type and optional transpile function. + +## Returns {#returns} + +`Promise`\<[`AuthServerConfig`](/references/js/type-aliases/AuthServerConfig.md)\> + +A promise that resolves to the server configuration. + +## See {#see} + + - [fetchServerConfigByWellKnownUrl](/references/js/functions/fetchServerConfigByWellKnownUrl.md) for the underlying implementation. + - [https://www.rfc-editor.org/rfc/rfc8414](https://www.rfc-editor.org/rfc/rfc8414) for the OAuth 2.0 Authorization Server Metadata +specification. + - [https://openid.net/specs/openid-connect-discovery-1\_0.html](https://openid.net/specs/openid-connect-discovery-1_0.html) for the OpenID Connect +Discovery specification. + +## Example {#example} + +```ts +import { fetchServerConfig } from 'mcp-auth'; +// Fetching OAuth server configuration +// This will fetch the metadata from `https://auth.logto.io/.well-known/oauth-authorization-server/oauth` +const oauthConfig = await fetchServerConfig('https://auth.logto.io/oauth', { type: 'oauth' }); + +// Fetching OpenID Connect server configuration +// This will fetch the metadata from `https://auth.logto.io/oidc/.well-known/openid-configuration` +const oidcConfig = await fetchServerConfig('https://auth.logto.io/oidc', { type: 'oidc' }); +``` + +## Throws {#throws} + +if the fetch operation fails. + +## Throws {#throws} + +if the server metadata is invalid or does not match the +MCP specification. diff --git a/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md b/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md new file mode 100644 index 0000000..7ab45db --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/functions/fetchServerConfigByWellKnownUrl.md @@ -0,0 +1,46 @@ +--- +sidebar_label: fetchServerConfigByWellKnownUrl +--- + +# Function: fetchServerConfigByWellKnownUrl() + +```ts +function fetchServerConfigByWellKnownUrl(wellKnownUrl: string | URL, config: ServerMetadataConfig): Promise; +``` + +Fetches the server configuration from the provided well-known URL and validates it against the +MCP specification. + +If the server metadata does not conform to the expected schema, but you are sure that it is +compatible, you can define a `transpileData` function to transform the metadata into the +expected format. + +## Parameters {#parameters} + +### wellKnownUrl {#wellknownurl} + +The well-known URL to fetch the server configuration from. This can be a +string or a URL object. + +`string` | `URL` + +### config {#config} + +`ServerMetadataConfig` + +The configuration object containing the server type and optional transpile function. + +## Returns {#returns} + +`Promise`\<[`AuthServerConfig`](/references/js/type-aliases/AuthServerConfig.md)\> + +A promise that resolves to the server configuration. + +## Throws {#throws} + +if the fetch operation fails. + +## Throws {#throws} + +if the server metadata is invalid or does not match the +MCP specification. diff --git a/versioned_docs/version-0.1.1/references/js/functions/handleBearerAuth.md b/versioned_docs/version-0.1.1/references/js/functions/handleBearerAuth.md new file mode 100644 index 0000000..ddb403e --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/functions/handleBearerAuth.md @@ -0,0 +1,42 @@ +--- +sidebar_label: handleBearerAuth +--- + +# Function: handleBearerAuth() + +```ts +function handleBearerAuth(param0: BearerAuthConfig): RequestHandler; +``` + +Creates a middleware function for handling Bearer auth in an Express application. + +This middleware extracts the Bearer token from the `Authorization` header, verifies it using the +provided `verifyAccessToken` function, and checks the issuer, audience, and required scopes. + +- If the token is valid, it adds the auth information to the `request.auth` property; +if not, it responds with an appropriate error message. +- If access token verification fails, it responds with a 401 Unauthorized error. +- If the token does not have the required scopes, it responds with a 403 Forbidden error. +- If unexpected errors occur during the auth process, the middleware will re-throw them. + +**Note:** The `request.auth` object will contain extended fields compared to the standard +AuthInfo interface defined in the `@modelcontextprotocol/sdk` module. See the extended +interface in this file for details. + +## Parameters {#parameters} + +### param0 {#param0} + +[`BearerAuthConfig`](/references/js/type-aliases/BearerAuthConfig.md) + +Configuration for the Bearer auth handler. + +## Returns {#returns} + +`RequestHandler` + +A middleware function for Express that handles Bearer auth. + +## See {#see} + +[BearerAuthConfig](/references/js/type-aliases/BearerAuthConfig.md) for the configuration options. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md new file mode 100644 index 0000000..8166bf3 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfig.md @@ -0,0 +1,51 @@ +--- +sidebar_label: AuthServerConfig +--- + +# Type Alias: AuthServerConfig + +```ts +type AuthServerConfig = { + metadata: CamelCaseAuthorizationServerMetadata; + type: AuthServerType; +}; +``` + +Configuration for the remote authorization server integrated with the MCP server. + +## Properties {#properties} + +### metadata {#metadata} + +```ts +metadata: CamelCaseAuthorizationServerMetadata; +``` + +The metadata of the authorization server, which should conform to the MCP specification +(based on OAuth 2.0 Authorization Server Metadata). + +This metadata is typically fetched from the server's well-known endpoint (OAuth 2.0 +Authorization Server Metadata or OpenID Connect Discovery); it can also be provided +directly in the configuration if the server does not support such endpoints. + +**Note:** The metadata should be in camelCase format as per preferred by the mcp-auth +library. + +#### See {#see} + + - [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) + - [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html) + +*** + +### type {#type} + +```ts +type: AuthServerType; +``` + +The type of the authorization server. + +#### See {#see} + +[AuthServerType](/references/js/type-aliases/AuthServerType.md) for the possible values. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md new file mode 100644 index 0000000..05371c1 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigError.md @@ -0,0 +1,45 @@ +--- +sidebar_label: AuthServerConfigError +--- + +# Type Alias: AuthServerConfigError + +```ts +type AuthServerConfigError = { + cause?: Error; + code: AuthServerConfigErrorCode; + description: string; +}; +``` + +Represents an error that occurs during the validation of the authorization server metadata. + +## Properties {#properties} + +### cause? {#cause} + +```ts +optional cause: Error; +``` + +An optional cause of the error, typically an instance of `Error` that provides more context. + +*** + +### code {#code} + +```ts +code: AuthServerConfigErrorCode; +``` + +The code representing the specific validation error. + +*** + +### description {#description} + +```ts +description: string; +``` + +A human-readable description of the error. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md new file mode 100644 index 0000000..9ba4f41 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigErrorCode.md @@ -0,0 +1,16 @@ +--- +sidebar_label: AuthServerConfigErrorCode +--- + +# Type Alias: AuthServerConfigErrorCode + +```ts +type AuthServerConfigErrorCode = + | "invalid_server_metadata" + | "code_response_type_not_supported" + | "authorization_code_grant_not_supported" + | "pkce_not_supported" + | "s256_code_challenge_method_not_supported"; +``` + +The codes for errors that can occur when validating the authorization server metadata. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md new file mode 100644 index 0000000..f093e35 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarning.md @@ -0,0 +1,34 @@ +--- +sidebar_label: AuthServerConfigWarning +--- + +# Type Alias: AuthServerConfigWarning + +```ts +type AuthServerConfigWarning = { + code: AuthServerConfigWarningCode; + description: string; +}; +``` + +Represents a warning that occurs during the validation of the authorization server metadata. + +## Properties {#properties} + +### code {#code} + +```ts +code: AuthServerConfigWarningCode; +``` + +The code representing the specific validation warning. + +*** + +### description {#description} + +```ts +description: string; +``` + +A human-readable description of the warning. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md new file mode 100644 index 0000000..c5a297d --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerConfigWarningCode.md @@ -0,0 +1,11 @@ +--- +sidebar_label: AuthServerConfigWarningCode +--- + +# Type Alias: AuthServerConfigWarningCode + +```ts +type AuthServerConfigWarningCode = "dynamic_registration_not_supported"; +``` + +The codes for warnings that can occur when validating the authorization server metadata. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md new file mode 100644 index 0000000..75701aa --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerErrorCode.md @@ -0,0 +1,12 @@ +--- +sidebar_label: AuthServerErrorCode +--- + +# Type Alias: AuthServerErrorCode + +```ts +type AuthServerErrorCode = + | "invalid_server_metadata" + | "invalid_server_config" + | "missing_jwks_uri"; +``` diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md new file mode 100644 index 0000000..7bb5610 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerSuccessCode.md @@ -0,0 +1,17 @@ +--- +sidebar_label: AuthServerSuccessCode +--- + +# Type Alias: AuthServerSuccessCode + +```ts +type AuthServerSuccessCode = + | "server_metadata_valid" + | "dynamic_registration_supported" + | "pkce_supported" + | "s256_code_challenge_method_supported" + | "authorization_code_grant_supported" + | "code_response_type_supported"; +``` + +The codes for successful validation of the authorization server metadata. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerType.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerType.md new file mode 100644 index 0000000..21fa06b --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthServerType.md @@ -0,0 +1,13 @@ +--- +sidebar_label: AuthServerType +--- + +# Type Alias: AuthServerType + +```ts +type AuthServerType = "oauth" | "oidc"; +``` + +The type of the authorization server. This information should be provided by the server +configuration and indicates whether the server is an OAuth 2.0 or OpenID Connect (OIDC) +authorization server. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md new file mode 100644 index 0000000..5b7f0a7 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/AuthorizationServerMetadata.md @@ -0,0 +1,235 @@ +--- +sidebar_label: AuthorizationServerMetadata +--- + +# Type Alias: AuthorizationServerMetadata + +```ts +type AuthorizationServerMetadata = { + authorization_endpoint: string; + code_challenge_methods_supported?: string[]; + grant_types_supported?: string[]; + introspection_endpoint?: string; + introspection_endpoint_auth_methods_supported?: string[]; + introspection_endpoint_auth_signing_alg_values_supported?: string[]; + issuer: string; + jwks_uri?: string; + op_policy_uri?: string; + op_tos_uri?: string; + registration_endpoint?: string; + response_modes_supported?: string[]; + response_types_supported: string[]; + revocation_endpoint?: string; + revocation_endpoint_auth_methods_supported?: string[]; + revocation_endpoint_auth_signing_alg_values_supported?: string[]; + scope_supported?: string[]; + service_documentation?: string; + token_endpoint: string; + token_endpoint_auth_methods_supported?: string[]; + token_endpoint_auth_signing_alg_values_supported?: string[]; + ui_locales_supported?: string[]; + userinfo_endpoint?: string; +}; +``` + +Schema for OAuth 2.0 Authorization Server Metadata as defined in RFC 8414. + +## Type declaration {#type-declaration} + +### authorization\_endpoint {#authorization-endpoint} + +```ts +authorization_endpoint: string; +``` + +URL of the authorization server's authorization endpoint [[RFC6749](https://rfc-editor.org/rfc/rfc6749)]. +This is REQUIRED unless no grant types are supported that use the authorization endpoint. + +#### See {#see} + +https://rfc-editor.org/rfc/rfc6749#section-3.1 + +### code\_challenge\_methods\_supported? {#code-challenge-methods-supported} + +```ts +optional code_challenge_methods_supported: string[]; +``` + +JSON array containing a list of Proof Key for Code Exchange (PKCE) +[[RFC7636](https://www.rfc-editor.org/rfc/rfc7636)] code challenge methods supported by this +authorization server. + +### grant\_types\_supported? {#grant-types-supported} + +```ts +optional grant_types_supported: string[]; +``` + +JSON array containing a list of the OAuth 2.0 grant type values that this authorization server +supports. The array values used are the same as those used with the `grant_types` parameter +defined by "OAuth 2.0 Dynamic Client Registration Protocol" [[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. +If omitted, the default value is `["authorization_code", "implicit"]`. + +### introspection\_endpoint? {#introspection-endpoint} + +```ts +optional introspection_endpoint: string; +``` + +URL of the authorization server's OAuth 2.0 introspection endpoint +[[RFC7662](https://www.rfc-editor.org/rfc/rfc7662)]. + +### introspection\_endpoint\_auth\_methods\_supported? {#introspection-endpoint-auth-methods-supported} + +```ts +optional introspection_endpoint_auth_methods_supported: string[]; +``` + +### introspection\_endpoint\_auth\_signing\_alg\_values\_supported? {#introspection-endpoint-auth-signing-alg-values-supported} + +```ts +optional introspection_endpoint_auth_signing_alg_values_supported: string[]; +``` + +### issuer {#issuer} + +```ts +issuer: string; +``` + +The authorization server's issuer identifier, which is a URL that uses the `https` scheme and +has no query or fragment components. + +### jwks\_uri? {#jwks-uri} + +```ts +optional jwks_uri: string; +``` + +URL of the authorization server's JWK Set [[JWK](https://www.rfc-editor.org/rfc/rfc8414.html#ref-JWK)] +document. The referenced document contains the signing key(s) the client uses to validate +signatures from the authorization server. This URL MUST use the `https` scheme. + +### op\_policy\_uri? {#op-policy-uri} + +```ts +optional op_policy_uri: string; +``` + +### op\_tos\_uri? {#op-tos-uri} + +```ts +optional op_tos_uri: string; +``` + +### registration\_endpoint? {#registration-endpoint} + +```ts +optional registration_endpoint: string; +``` + +URL of the authorization server's OAuth 2.0 Dynamic Client Registration endpoint +[[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. + +### response\_modes\_supported? {#response-modes-supported} + +```ts +optional response_modes_supported: string[]; +``` + +JSON array containing a list of the OAuth 2.0 `response_mode` values that this +authorization server supports, as specified in "OAuth 2.0 Multiple Response +Type Encoding Practices" +[[OAuth.Responses](https://datatracker.ietf.org/doc/html/rfc8414#ref-OAuth.Responses)]. + +If omitted, the default is `["query", "fragment"]`. The response mode value `"form_post"` is +also defined in "OAuth 2.0 Form Post Response Mode" +[[OAuth.FormPost](https://datatracker.ietf.org/doc/html/rfc8414#ref-OAuth.Post)]. + +### response\_types\_supported {#response-types-supported} + +```ts +response_types_supported: string[]; +``` + +JSON array containing a list of the OAuth 2.0 `response_type` values that this authorization +server supports. The array values used are the same as those used with the `response_types` +parameter defined by "OAuth 2.0 Dynamic Client Registration Protocol" +[[RFC7591](https://www.rfc-editor.org/rfc/rfc7591)]. + +### revocation\_endpoint? {#revocation-endpoint} + +```ts +optional revocation_endpoint: string; +``` + +URL of the authorization server's OAuth 2.0 revocation endpoint +[[RFC7009](https://www.rfc-editor.org/rfc/rfc7009)]. + +### revocation\_endpoint\_auth\_methods\_supported? {#revocation-endpoint-auth-methods-supported} + +```ts +optional revocation_endpoint_auth_methods_supported: string[]; +``` + +### revocation\_endpoint\_auth\_signing\_alg\_values\_supported? {#revocation-endpoint-auth-signing-alg-values-supported} + +```ts +optional revocation_endpoint_auth_signing_alg_values_supported: string[]; +``` + +### scope\_supported? {#scope-supported} + +```ts +optional scope_supported: string[]; +``` + +### service\_documentation? {#service-documentation} + +```ts +optional service_documentation: string; +``` + +### token\_endpoint {#token-endpoint} + +```ts +token_endpoint: string; +``` + +URL of the authorization server's token endpoint [[RFC6749](https://rfc-editor.org/rfc/rfc6749)]. +This is REQUIRED unless only the implicit grant type is supported. + +#### See {#see} + +https://rfc-editor.org/rfc/rfc6749#section-3.2 + +### token\_endpoint\_auth\_methods\_supported? {#token-endpoint-auth-methods-supported} + +```ts +optional token_endpoint_auth_methods_supported: string[]; +``` + +### token\_endpoint\_auth\_signing\_alg\_values\_supported? {#token-endpoint-auth-signing-alg-values-supported} + +```ts +optional token_endpoint_auth_signing_alg_values_supported: string[]; +``` + +### ui\_locales\_supported? {#ui-locales-supported} + +```ts +optional ui_locales_supported: string[]; +``` + +### userinfo\_endpoint? {#userinfo-endpoint} + +```ts +optional userinfo_endpoint: string; +``` + +URL of the OpenID Connect [userinfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo). +This endpoint is used to retrieve information about the authenticated user. + +## See {#see} + +https://datatracker.ietf.org/doc/html/rfc8414 diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md b/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md new file mode 100644 index 0000000..50652be --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthConfig.md @@ -0,0 +1,95 @@ +--- +sidebar_label: BearerAuthConfig +--- + +# Type Alias: BearerAuthConfig + +```ts +type BearerAuthConfig = { + audience?: string; + issuer: string; + requiredScopes?: string[]; + showErrorDetails?: boolean; + verifyAccessToken: VerifyAccessTokenFunction; +}; +``` + +## Properties {#properties} + +### audience? {#audience} + +```ts +optional audience: string; +``` + +The expected audience of the access token (`aud` claim). This is typically the resource server +(API) that the token is intended for. If not provided, the audience check will be skipped. + +**Note:** If your authorization server does not support Resource Indicators (RFC 8707), +you can omit this field since the audience may not be relevant. + +#### See {#see} + +https://datatracker.ietf.org/doc/html/rfc8707 + +*** + +### issuer {#issuer} + +```ts +issuer: string; +``` + +The expected issuer of the access token (`iss` claim). This should be the URL of the +authorization server that issued the token. + +*** + +### requiredScopes? {#requiredscopes} + +```ts +optional requiredScopes: string[]; +``` + +An array of required scopes that the access token must have. If the token does not contain +all of these scopes, an error will be thrown. + +**Note:** The handler will check the `scope` claim in the token, which may be a space- +separated string or an array of strings, depending on the authorization server's +implementation. If the `scope` claim is not present, the handler will check the `scopes` claim +if available. + +*** + +### showErrorDetails? {#showerrordetails} + +```ts +optional showErrorDetails: boolean; +``` + +Whether to show detailed error information in the response. This is useful for debugging +during development, but should be disabled in production to avoid leaking sensitive +information. + +#### Default {#default} + +```ts +false +``` + +*** + +### verifyAccessToken {#verifyaccesstoken} + +```ts +verifyAccessToken: VerifyAccessTokenFunction; +``` + +Function type for verifying an access token. + +This function should throw an [MCPAuthTokenVerificationError](/references/js/classes/MCPAuthTokenVerificationError.md) if the token is invalid, +or return an AuthInfo object if the token is valid. + +#### See {#see} + +[VerifyAccessTokenFunction](/references/js/type-aliases/VerifyAccessTokenFunction.md) for more details. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md new file mode 100644 index 0000000..5887161 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthErrorCode.md @@ -0,0 +1,16 @@ +--- +sidebar_label: BearerAuthErrorCode +--- + +# Type Alias: BearerAuthErrorCode + +```ts +type BearerAuthErrorCode = + | "missing_auth_header" + | "invalid_auth_header_format" + | "missing_bearer_token" + | "invalid_issuer" + | "invalid_audience" + | "missing_required_scopes" + | "invalid_token"; +``` diff --git a/docs/references/js/type-aliases/BearerAuthJwtConfig.md b/versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md similarity index 100% rename from docs/references/js/type-aliases/BearerAuthJwtConfig.md rename to versioned_docs/version-0.1.1/references/js/type-aliases/BearerAuthJwtConfig.md diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md b/versioned_docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md new file mode 100644 index 0000000..637138a --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/CamelCaseAuthorizationServerMetadata.md @@ -0,0 +1,179 @@ +--- +sidebar_label: CamelCaseAuthorizationServerMetadata +--- + +# Type Alias: CamelCaseAuthorizationServerMetadata + +```ts +type CamelCaseAuthorizationServerMetadata = { + authorizationEndpoint: string; + codeChallengeMethodsSupported?: string[]; + grantTypesSupported?: string[]; + introspectionEndpoint?: string; + introspectionEndpointAuthMethodsSupported?: string[]; + introspectionEndpointAuthSigningAlgValuesSupported?: string[]; + issuer: string; + jwksUri?: string; + opPolicyUri?: string; + opTosUri?: string; + registrationEndpoint?: string; + responseModesSupported?: string[]; + responseTypesSupported: string[]; + revocationEndpoint?: string; + revocationEndpointAuthMethodsSupported?: string[]; + revocationEndpointAuthSigningAlgValuesSupported?: string[]; + scopeSupported?: string[]; + serviceDocumentation?: string; + tokenEndpoint: string; + tokenEndpointAuthMethodsSupported?: string[]; + tokenEndpointAuthSigningAlgValuesSupported?: string[]; + uiLocalesSupported?: string[]; + userinfoEndpoint?: string; +}; +``` + +The camelCase version of the OAuth 2.0 Authorization Server Metadata type. + +## Type declaration {#type-declaration} + +### authorizationEndpoint {#authorizationendpoint} + +```ts +authorizationEndpoint: string; +``` + +### codeChallengeMethodsSupported? {#codechallengemethodssupported} + +```ts +optional codeChallengeMethodsSupported: string[]; +``` + +### grantTypesSupported? {#granttypessupported} + +```ts +optional grantTypesSupported: string[]; +``` + +### introspectionEndpoint? {#introspectionendpoint} + +```ts +optional introspectionEndpoint: string; +``` + +### introspectionEndpointAuthMethodsSupported? {#introspectionendpointauthmethodssupported} + +```ts +optional introspectionEndpointAuthMethodsSupported: string[]; +``` + +### introspectionEndpointAuthSigningAlgValuesSupported? {#introspectionendpointauthsigningalgvaluessupported} + +```ts +optional introspectionEndpointAuthSigningAlgValuesSupported: string[]; +``` + +### issuer {#issuer} + +```ts +issuer: string; +``` + +### jwksUri? {#jwksuri} + +```ts +optional jwksUri: string; +``` + +### opPolicyUri? {#oppolicyuri} + +```ts +optional opPolicyUri: string; +``` + +### opTosUri? {#optosuri} + +```ts +optional opTosUri: string; +``` + +### registrationEndpoint? {#registrationendpoint} + +```ts +optional registrationEndpoint: string; +``` + +### responseModesSupported? {#responsemodessupported} + +```ts +optional responseModesSupported: string[]; +``` + +### responseTypesSupported {#responsetypessupported} + +```ts +responseTypesSupported: string[]; +``` + +### revocationEndpoint? {#revocationendpoint} + +```ts +optional revocationEndpoint: string; +``` + +### revocationEndpointAuthMethodsSupported? {#revocationendpointauthmethodssupported} + +```ts +optional revocationEndpointAuthMethodsSupported: string[]; +``` + +### revocationEndpointAuthSigningAlgValuesSupported? {#revocationendpointauthsigningalgvaluessupported} + +```ts +optional revocationEndpointAuthSigningAlgValuesSupported: string[]; +``` + +### scopeSupported? {#scopesupported} + +```ts +optional scopeSupported: string[]; +``` + +### serviceDocumentation? {#servicedocumentation} + +```ts +optional serviceDocumentation: string; +``` + +### tokenEndpoint {#tokenendpoint} + +```ts +tokenEndpoint: string; +``` + +### tokenEndpointAuthMethodsSupported? {#tokenendpointauthmethodssupported} + +```ts +optional tokenEndpointAuthMethodsSupported: string[]; +``` + +### tokenEndpointAuthSigningAlgValuesSupported? {#tokenendpointauthsigningalgvaluessupported} + +```ts +optional tokenEndpointAuthSigningAlgValuesSupported: string[]; +``` + +### uiLocalesSupported? {#uilocalessupported} + +```ts +optional uiLocalesSupported: string[]; +``` + +### userinfoEndpoint? {#userinfoendpoint} + +```ts +optional userinfoEndpoint: string; +``` + +## See {#see} + +[AuthorizationServerMetadata](/references/js/type-aliases/AuthorizationServerMetadata.md) for the original type and field information. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md new file mode 100644 index 0000000..9961d48 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthBearerAuthErrorDetails.md @@ -0,0 +1,55 @@ +--- +sidebar_label: MCPAuthBearerAuthErrorDetails +--- + +# Type Alias: MCPAuthBearerAuthErrorDetails + +```ts +type MCPAuthBearerAuthErrorDetails = { + actual?: unknown; + cause?: unknown; + expected?: unknown; + missingScopes?: string[]; + uri?: URL; +}; +``` + +## Properties {#properties} + +### actual? {#actual} + +```ts +optional actual: unknown; +``` + +*** + +### cause? {#cause} + +```ts +optional cause: unknown; +``` + +*** + +### expected? {#expected} + +```ts +optional expected: unknown; +``` + +*** + +### missingScopes? {#missingscopes} + +```ts +optional missingScopes: string[]; +``` + +*** + +### uri? {#uri} + +```ts +optional uri: URL; +``` diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md new file mode 100644 index 0000000..1d06689 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthConfig.md @@ -0,0 +1,23 @@ +--- +sidebar_label: MCPAuthConfig +--- + +# Type Alias: MCPAuthConfig + +```ts +type MCPAuthConfig = { + server: AuthServerConfig; +}; +``` + +Config for the [MCPAuth](/references/js/classes/MCPAuth.md) class. + +## Properties {#properties} + +### server {#server} + +```ts +server: AuthServerConfig; +``` + +Config for the remote authorization server. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md new file mode 100644 index 0000000..e3d2754 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/MCPAuthTokenVerificationErrorCode.md @@ -0,0 +1,9 @@ +--- +sidebar_label: MCPAuthTokenVerificationErrorCode +--- + +# Type Alias: MCPAuthTokenVerificationErrorCode + +```ts +type MCPAuthTokenVerificationErrorCode = "invalid_token" | "token_verification_failed"; +``` diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md b/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md new file mode 100644 index 0000000..2bb7325 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenFunction.md @@ -0,0 +1,40 @@ +--- +sidebar_label: VerifyAccessTokenFunction +--- + +# Type Alias: VerifyAccessTokenFunction() + +```ts +type VerifyAccessTokenFunction = (token: string) => MaybePromise; +``` + +Function type for verifying an access token. + +This function should throw an [MCPAuthTokenVerificationError](/references/js/classes/MCPAuthTokenVerificationError.md) if the token is invalid, +or return an AuthInfo object if the token is valid. + +For example, if you have a JWT verification function, it should at least check the token's +signature, validate its expiration, and extract the necessary claims to return an `AuthInfo` +object. + +**Note:** There's no need to verify the following fields in the token, as they will be checked +by the handler: + +- `iss` (issuer) +- `aud` (audience) +- `scope` (scopes) + +## Parameters {#parameters} + +### token {#token} + +`string` + +The access token string to verify. + +## Returns {#returns} + +`MaybePromise`\<`AuthInfo`\> + +A promise that resolves to an AuthInfo object or a synchronous value if the +token is valid. diff --git a/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md b/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md new file mode 100644 index 0000000..74e60ac --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/type-aliases/VerifyAccessTokenMode.md @@ -0,0 +1,9 @@ +--- +sidebar_label: VerifyAccessTokenMode +--- + +# Type Alias: VerifyAccessTokenMode + +```ts +type VerifyAccessTokenMode = "jwt"; +``` diff --git a/versioned_docs/version-0.1.1/references/js/variables/authServerErrorDescription.md b/versioned_docs/version-0.1.1/references/js/variables/authServerErrorDescription.md new file mode 100644 index 0000000..b4726e8 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/authServerErrorDescription.md @@ -0,0 +1,9 @@ +--- +sidebar_label: authServerErrorDescription +--- + +# Variable: authServerErrorDescription + +```ts +const authServerErrorDescription: Readonly>; +``` diff --git a/versioned_docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md b/versioned_docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md new file mode 100644 index 0000000..2b10818 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/authorizationServerMetadataSchema.md @@ -0,0 +1,15 @@ +--- +sidebar_label: authorizationServerMetadataSchema +--- + +# Variable: authorizationServerMetadataSchema + +```ts +const authorizationServerMetadataSchema: ZodObject; +``` + +Zod schema for OAuth 2.0 Authorization Server Metadata as defined in RFC 8414. + +## See {#see} + +https://datatracker.ietf.org/doc/html/rfc8414 diff --git a/versioned_docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md b/versioned_docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md new file mode 100644 index 0000000..ed1a931 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/bearerAuthErrorDescription.md @@ -0,0 +1,9 @@ +--- +sidebar_label: bearerAuthErrorDescription +--- + +# Variable: bearerAuthErrorDescription + +```ts +const bearerAuthErrorDescription: Readonly>; +``` diff --git a/versioned_docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md b/versioned_docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md new file mode 100644 index 0000000..daaa358 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/camelCaseAuthorizationServerMetadataSchema.md @@ -0,0 +1,15 @@ +--- +sidebar_label: camelCaseAuthorizationServerMetadataSchema +--- + +# Variable: camelCaseAuthorizationServerMetadataSchema + +```ts +const camelCaseAuthorizationServerMetadataSchema: ZodObject; +``` + +The camelCase version of the OAuth 2.0 Authorization Server Metadata Zod schema. + +## See {#see} + +[authorizationServerMetadataSchema](/references/js/variables/authorizationServerMetadataSchema.md) for the original schema and field information. diff --git a/versioned_docs/version-0.1.1/references/js/variables/serverMetadataPaths.md b/versioned_docs/version-0.1.1/references/js/variables/serverMetadataPaths.md new file mode 100644 index 0000000..68cbf41 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/serverMetadataPaths.md @@ -0,0 +1,12 @@ +--- +sidebar_label: serverMetadataPaths +--- + +# Variable: serverMetadataPaths + +```ts +const serverMetadataPaths: Readonly<{ + oauth: "/.well-known/oauth-authorization-server"; + oidc: "/.well-known/openid-configuration"; +}>; +``` diff --git a/versioned_docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md b/versioned_docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md new file mode 100644 index 0000000..3d6e760 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/tokenVerificationErrorDescription.md @@ -0,0 +1,9 @@ +--- +sidebar_label: tokenVerificationErrorDescription +--- + +# Variable: tokenVerificationErrorDescription + +```ts +const tokenVerificationErrorDescription: Readonly>; +``` diff --git a/versioned_docs/version-0.1.1/references/js/variables/validateServerConfig.md b/versioned_docs/version-0.1.1/references/js/variables/validateServerConfig.md new file mode 100644 index 0000000..e60de41 --- /dev/null +++ b/versioned_docs/version-0.1.1/references/js/variables/validateServerConfig.md @@ -0,0 +1,9 @@ +--- +sidebar_label: validateServerConfig +--- + +# Variable: validateServerConfig + +```ts +const validateServerConfig: ValidateServerConfig; +``` diff --git a/versioned_docs/version-0.1.1/snippets/_get-started-code.mdx b/versioned_docs/version-0.1.1/snippets/_get-started-code.mdx new file mode 100644 index 0000000..249b02f --- /dev/null +++ b/versioned_docs/version-0.1.1/snippets/_get-started-code.mdx @@ -0,0 +1,41 @@ +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + + + + + +```python +mcp = FastMCP("MyMCPServer") +mcp_auth = MCPAuth(server=fetch_server_config('', type=AuthServerType.OIDC)) +app = Starlette( + # ... your MCP server setup + middleware=[Middleware( + mcp_auth.bearer_auth_middleware("jwt", required_scopes=["read", "write"]) + )] +) + +# Use `mcp_auth.auth_info` to access the auth information for the current request +@mcp.tool() +def whoami() -> dict[str, Any]: + return mcp_auth.auth_info.claims +``` + + + + +```ts +const server = new McpServer(/* ... */); +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig('', { type: 'oidc' }), +}); +const app = express(); + +app.use(mcpAuth.bearerAuth('jwt', { requiredScopes: ['read', 'write'] })); +server.tool('whoami', ({ authInfo }) => { + // Use `authInfo` to access the auth information carried from `req.auth` +}); +``` + + + diff --git a/versioned_docs/version-0.1.1/tutorials/_category_.yml b/versioned_docs/version-0.1.1/tutorials/_category_.yml new file mode 100644 index 0000000..fb577fb --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/_category_.yml @@ -0,0 +1,5 @@ +position: 2 +label: Tutorials +link: + type: generated-index + title: Tutorials diff --git a/versioned_docs/version-0.1.1/tutorials/todo-manager/README.mdx b/versioned_docs/version-0.1.1/tutorials/todo-manager/README.mdx new file mode 100644 index 0000000..bbdf721 --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/todo-manager/README.mdx @@ -0,0 +1,1279 @@ +--- +sidebar_position: 2 +sidebar_label: 'Tutorial: Build a todo manager' +--- + +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +import SetupOauthOrOidc from './_setup-oauth-or-oidc.mdx'; +import SetupOidc from './_setup-oidc.mdx'; + +# Tutorial: Build a todo manager + +In this tutorial, we will build a todo manager MCP server with user authentication and authorization. + +After completing this tutorial, you will have: + +- ✅ A basic understanding of how to set up role-based access control (RBAC) in your MCP server. +- ✅ A MCP server that can manage personal todo lists. + +:::note +Before you start, we strongly recommend you to go through the [Who am I tutorial](./whoami) first if you are not familiar with MCP server and OAuth 2. +::: + +## Overview \{#overview} + +The tutorial will involve the following components: + +- **MCP server**: A simple MCP server that uses MCP official SDKs to handle requests, with an integrated Todo service for managing user's todo items. +- **MCP inspector**: A visual testing tool for MCP servers. It also acts as an OAuth / OIDC client to initiate the authorization flow and retrieve access tokens. +- **Authorization server**: An OAuth 2.1 or OpenID Connect provider that manages user identities and issues access tokens. + +Here's a high-level diagram of the interaction between these components: + +```mermaid +sequenceDiagram + participant Client as MCP Inspector + participant Server as MCP Server + participant Auth as Authorization Server + + Client->>Server: Request todo operation + Server->>Client: Return 401 Unauthorized + Client->>Auth: Initiate authorization flow + Auth->>Auth: Complete authorization flow + Auth->>Client: Redirect back with authorization code + Client->>Auth: Exchange code for access token + Auth->>Client: Return access token + Client->>Server: Request todo operation with access token + Server->>Server: Validate access token and get user scopes form access token + Note over Server: Execute todo operation + Server->>Client: Return todo operation result +``` + +## Understand your authorization server \{#understand-your-authorization-server} + +### Access tokens with scopes \{#access-tokens-with-scopes} + +To implement [role-based access control (RBAC)](https://auth.wiki/rbac) in your MCP server, your authorization server needs to support issuing access tokens with scopes. Scopes represent the permissions that a user has been granted. + + + + +[Logto](https://logto.io) provides RBAC support through its API resources (conforming [RFC 8707: Resource Indicators for OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc8707)) and roles features. Here's how to set it up: + +1. Sign in to [Logto Console](https://cloud.logto.io) (or your self-hosted Logto Console) + +2. Create API resource and scopes: + + - Go to "API Resources" + - Create a new API resource named "Todo Manager" + - Add the following scopes: + - `create:todos`: "Create new todo items" + - `read:todos`: "Read all todo items" + - `delete:todos`: "Delete any todo item" + +3. Create roles (recommended for easier management): + + - Go to "Roles" + - Create an "Admin" role and assign all scopes (`create:todos`, `read:todos`, `delete:todos`) + - Create a "User" role and assign only the `create:todos` scope + +4. Assign permissions: + - Go to "Users" + - Select a user + - You can either: + - Assign roles in the "Roles" tab (recommended) + - Or directly assign scopes in the "Permissions" tab + +The scopes will be included in the JWT access token's `scope` claim as a space-separated string. + + + + [Asgardeo](https://wso2.com/asgardeo) supports Role-Based Access Control (RBAC) and fine-grained authorization using API resources and scopes. Here's how to configure it: + + 1. Sign in to the [Asgardeo Console](https://console.asgardeo.io) + + 2. Define your API resource and scopes: + - Go to **API Resources** + - Click **"New API Resource"** + - Set the **Identifier** to `https://todo.mcp-server.app` (or your desired URL) + - Let the **Display Name** be `Todo Manager` + - Add the following scopes: + - `create:todos` : "Create new todo items" + - `read:todos` : "Read all todo items" + - `delete:todos` : "Delete any todo item" + - Create the resource + + 3. Create roles: + - Use the **User Management > Roles** to create roles and assign scopes directly. + - Click **New Role** + - Provide the role name (e.g., `Admin` or `User`) in **Basic Details** section + - Let the role audience be `Application` and select the `MCP Inspector Application` as the **Assigned Application** + - In **Permission Selection** section, choose the API resource you created earlier (e.g., `Todo Manager`) + - Select the scopes you want to assign to this role (e.g., `create:todos`, `read:todos`, `delete:todos`) + - Click **Finish** to create the role + + If you have already created the application + - Navigate to **Application > MCP Inspector Application > Roles tab** + - Select **Application Role** as the audience type, then click **New Role** + - Create an `Admin` role and attach all three scopes + - Create a `User` role and attach only the `create:todos` scope + + 4. Assign roles to users: + - Go to **User Management > Roles** + - Select the role you created (e.g., `Admin` or `User`) and move to **Users** tab + - Select **Assign User** and choose the users you want to assign this role to and save. + + The scopes will be included in the JWT access token's `scope` claim as a space-separated string. + + + + +OAuth 2.0 / OIDC providers typically support scope-based access control. When implementing RBAC: + +1. Define your required scopes in your authorization server +2. Configure your client to request these scopes during the authorization flow +3. Ensure your authorization server includes the granted scopes in the access token +4. The scopes are usually included in the JWT access token's `scope` claim + +Check your provider's documentation for specific details on: + +- How to define and manage scopes +- How scopes are included in the access token +- Any additional RBAC features like role management + + + + +### Validating tokens and checking permissions \{#validating-tokens-and-checking-permissions} + +When your MCP server receives a request, it needs to: + +1. Validate the access token's signature and expiration +2. Extract the scopes from the validated token +3. Check if the token has the required scopes for the requested operation + +For example, if a user wants to create a new todo item, their access token must include the `create:todos` scope. Here's how the flow works: + +```mermaid +sequenceDiagram + participant Client + participant MCP Server + participant Auth Server + + Client->>MCP Server: Request with access token + + alt JWT Validation + MCP Server->>Auth Server: Fetch JWKS + Auth Server-->>MCP Server: Return JWKS + MCP Server->>MCP Server: Validate JWT locally + else Token Introspection + MCP Server->>Auth Server: POST /introspect
(token=access_token) + Auth Server-->>MCP Server: Return token info
(active, scope, etc.) + end + + MCP Server->>MCP Server: Extract & check scopes + + alt Has required scopes + MCP Server->>Client: Allow operation + else Missing scopes + MCP Server->>Client: Return 403 Forbidden + end +``` + +### Dynamic Client Registration \{#dynamic-client-registration} + +Dynamic Client Registration is not required for this tutorial, but it can be useful if you want to automate the MCP client registration process with your authorization server. Check [Is Dynamic Client Registration required?](/provider-list#is-dcr-required) for more details. + +## Understand RBAC in todo manager \{#understand-rbac-in-todo-manager} + +For demonstration purposes, we'll implement a simple role-based access control (RBAC) system in our todo manager MCP server. This will show you the basic principles of RBAC while keeping the implementation straightforward. + +:::note +While this tutorial demonstrates RBAC-based scope management, it's important to note that not all authentication providers implement scope management through roles. Some providers may have their own unique implementations and mechanisms for managing access control and permissions. +::: + +### Tools and scopes \{#tools-and-scopes} + +Our todo manager MCP server provides three main tools: + +- `create-todo`: Create a new todo item +- `get-todos`: List all todos +- `delete-todo`: Delete a todo by ID + +To control access to these tools, we define the following scopes: + +- `create:todos`: Allows creating new todo items +- `delete:todos`: Allows deleting existing todo items +- `read:todos`: Allows querying and retrieving the list of all todo items + +### Roles and permissions \{#roles-and-permissions} + +We'll define two roles with different levels of access: + +| Role | create:todos | read:todos | delete:todos | +| ----- | ------------ | ---------- | ------------ | +| Admin | ✅ | ✅ | ✅ | +| User | ✅ | | | + +- **User**: A regular user who can create todo items and view or delete only their own todos +- **Admin**: An administrator who can create, view, and delete all todo items, regardless of ownership + +### Resource ownership \{#resource-ownership} + +While the permission table above shows the explicit scopes assigned to each role, there's an important principle of resource ownership to consider: + +- **Users** don't have the `read:todos` or `delete:todos` scopes, but they can still: + - Read their own todo items + - Delete their own todo items +- **Admins** have full permissions (`read:todos` and `delete:todos`), allowing them to: + - View all todo items in the system + - Delete any todo item, regardless of ownership + +This demonstrates a common pattern in RBAC systems where resource ownership grants implicit permissions to users for their own resources, while administrative roles receive explicit permissions for all resources. + +:::tip Learn More +To dive deeper into RBAC concepts and best practices, check out [Mastering RBAC: A Comprehensive Real-World Example](https://blog.logto.io/mastering-rbac). +::: + +## Configure authorization in your provider \{#configure-authorization-in-your-provider} + +To implement the access control system we described earlier, you'll need to configure your authorization server to support the required scopes. Here's how to do it with different providers: + + + + +[Logto](https://logto.io) provides RBAC support through its API resources and roles features. Here's how to set it up: + +1. Sign in to [Logto Console](https://cloud.logto.io) (or your self-hosted Logto Console) + +2. Create API resource and scopes: + + - Go to "API Resources" + - Create a new API resource named "Todo Manager" and using `https://todo.mcp-server.app` (demo purpose) as the indicator. + - Create the following scopes: + - `create:todos`: "Create new todo items" + - `read:todos`: "Read all todo items" + - `delete:todos`: "Delete any todo item" + +3. Create roles (recommended for easier management): + + - Go to "Roles" + - Create an "Admin" role and assign all scopes (`create:todos`, `read:todos`, `delete:todos`) + - Create a "User" role and assign only the `create:todos` scope + - In the "User" role's details page, switch to the "General" tab, and set the "User" role as the "Default role". + +4. Manage user roles and permissions: + - For new users: + - They will automatically get the "User" role since we set it as the default role + - For existing users: + - Go to "User management" + - Select a user + - Assign roles for the user in the "Roles" tab + +:::tip Programmatic Role Management +You can also use Logto's [Management API](https://docs.logto.io/integrate-logto/interact-with-management-api) to programmatically manage user roles. This is particularly useful for automated user management or when building admin panels. +::: + +When requesting an access token, Logto will include scopes in the token's `scope` claim based on the user's role permissions. + + + + +In [Keycloak](https://www.keycloak.org), you can set up the required permissions using client scopes: + +1. Create client scopes: + + - In your realm, go to "Client scopes" + - Create three new client scopes: + - `create:todos` + - `read:todos` + - `delete:todos` + +2. Configure the client: + + - Go to your client settings + - In the "Client scopes" tab, add all the scopes you created + - Make sure the token mapper is configured to include scopes + +3. Optional: Use roles for easier management + - If you prefer role-based management: + - Create realm roles for different access levels + - Map scopes to roles + - Assign roles to users + - Otherwise, you can directly assign scopes to users or through client-level permissions + +Keycloak will include the granted scopes in the access token's `scope` claim. + + + + +[Asgardeo](https://wso2.com/asgardeo) supports Role-Based Access Control (RBAC) and fine-grained authorization using API resources and scopes. Here's how to configure it: + +1. Sign in to the [Asgardeo Console](https://console.asgardeo.io) + +2. Define your API resource and scopes: + - Go to **API Resources** + - Click **"New API Resource"** + - Set the **Identifier** to `https://todo.mcp-server.app` (or your desired URL) + - Let the **Display Name** be `Todo Manager` + - Add the following scopes: + - `create:todos` : "Create new todo items" + - `read:todos` : "Read all todo items" + - `delete:todos` : "Delete any todo item" + - Create the resource + +3. Create roles: + - Use the **User Management > Roles** to create roles and assign scopes directly. + - Click **New Role** + - Provide the role name (e.g., `Admin` or `User`) in **Basic Details** section + - Let the role audience be `Application` and select the `MCP Inspector Application` as the **Assigned Application** + - In **Permission Selection** section, choose the API resource you created earlier (e.g., `Todo Manager`) + - Select the scopes you want to assign to this role (e.g., `create:todos`, `read:todos`, `delete:todos`) + - Click **Finish** to create the role + + If you have already created the application + - Navigate to **Application > MCP Inspector Application > Roles tab** + - Select **Application Role** as the audience type, then click **New Role** + - Create an `Admin` role and attach all three scopes + - Create a `User` role and attach only the `create:todos` scope + +4. Assign roles to users: + - Go to **User Management > Roles** + - Select the role you created (e.g., `Admin` or `User`) and move to **Users** tab + - Select **Assign User** and choose the users you want to assign this role to and save. + +The scopes will be included in the JWT access token's `scope` claim as a space-separated string. +After configuring your authorization server, users will receive access tokens containing their granted scopes. The MCP server will use these scopes to determine: + +Whether a user can create new todos (`create:todos`) +Whether a user can view all todos (`read:todos`) or only their own +Whether a user can delete any todo (`delete:todos`) or only their own + +For more details on configuring Asgardeo, refer to the following resources: +- [API Resources Guide](https://wso2.com/asgardeo/docs/guides/authorization/api-authorization) +- [Role Management](https://wso2.com/asgardeo/docs/guides/users/manage-roles) + + + +For OAuth 2.0 or OpenID Connect providers, you'll need to configure the scopes that represent different permissions. The exact steps will depend on your provider, but generally: + +1. Define scopes: + + - Configure your authorization server to support: + - `create:todos` + - `read:todos` + - `delete:todos` + +2. Configure client: + + - Register or update your client to request these scopes + - Ensure the scopes are included in the access token + +3. Assign permissions: + - Use your provider's interface to grant appropriate scopes to users + - Some providers may support role-based management, while others might use direct scope assignments + - Check your provider's documentation for the recommended approach + +:::tip +Most providers will include the granted scopes in the access token's `scope` claim. The format is typically a space-separated string of scope values. +::: + + + + +After configuring your authorization server, users will receive access tokens containing their granted scopes. The MCP server will use these scopes to determine: + +- Whether a user can create new todos (`create:todos`) +- Whether a user can view all todos (`read:todos`) or only their own +- Whether a user can delete any todo (`delete:todos`) or only their own + +## Set up the MCP server \{#set-up-the-mcp-server} + +We will use the [MCP official SDKs](https://github.com/modelcontextprotocol) to create our todo manager MCP server. + +### Create a new project \{#create-a-new-project} + + + + +```bash +mkdir mcp-server +cd mcp-server +uv init # Or use `pipenv` or `poetry` to create a new virtual environment +``` + + + + +Set up a new Node.js project: + +```bash +mkdir mcp-server +cd mcp-server +npm init -y # Or use `pnpm init` +npm pkg set type="module" +npm pkg set main="todo-manager.ts" +npm pkg set scripts.start="node --experimental-strip-types todo-manager.ts" +``` + +:::note +We're using TypeScript in our examples as Node.js v22.6.0+ supports running TypeScript natively using the `--experimental-strip-types` flag. If you're using JavaScript, the code will be similar - just ensure you're using Node.js v22.6.0 or later. See Node.js docs for details. +::: + + + + +### Install the MCP SDK and dependencies \{#install-the-mcp-sdk-and-dependencies} + + + + +```bash +pip install "mcp[cli]" starlette uvicorn +``` + +Or any other package manager you prefer, such as `uv` or `poetry`. + + + + +```bash +npm install @modelcontextprotocol/sdk express zod +``` + +Or any other package manager you prefer, such as `pnpm` or `yarn`. + + + + +### Create the MCP server \{#create-the-mcp-server} + +First, let's create a basic MCP server with the tool definitions: + + + + +Create a file named `todo-manager.py` and add the following code: + +```python +from typing import Any +from mcp.server.fastmcp import FastMCP +from starlette.applications import Starlette +from starlette.routing import Mount + +mcp = FastMCP("Todo Manager") + +@mcp.tool() +def create_todo(content: str) -> dict[str, Any]: + """Create a new todo.""" + return {"error": "Not implemented"} + +@mcp.tool() +def get_todos() -> dict[str, Any]: + """List all todos.""" + return {"error": "Not implemented"} + +@mcp.tool() +def delete_todo(id: str) -> dict[str, Any]: + """Delete a todo by id.""" + return {"error": "Not implemented"} + +app = Starlette( + routes=[Mount('/', app=mcp.sse_app())] +) +``` + +Run the server with: + +```bash +uvicorn todo_manager:app --host 0.0.0.0 --port 3001 +``` + + + + +:::note +Since the current MCP inspector implementation does not handle authorization flows, we will use the SSE approach to set up the MCP server. We'll update the code here once the MCP inspector supports authorization flows. +::: + +You can also use `pnpm` or `yarn` if you prefer. + +Create a file named `todo-manager.ts` and add the following code: + +```ts +// todo-manager.ts + +import { z } from 'zod'; +import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'; +import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js'; +import express from 'express'; + +// Create an MCP server +const server = new McpServer({ + name: 'Todo Manager', + version: '0.0.0', +}); + +server.tool('create-todo', 'Create a new todo', { content: z.string() }, async ({ content }) => { + return { + content: [{ type: 'text', text: JSON.stringify({ error: 'Not implemented' }) }], + }; +}); + +server.tool('get-todos', 'List all todos', async () => { + return { + content: [{ type: 'text', text: JSON.stringify({ error: 'Not implemented' }) }], + }; +}); + +server.tool('delete-todo', 'Delete a todo by id', { id: z.string() }, async ({ id }) => { + return { + content: [{ type: 'text', text: JSON.stringify({ error: 'Not implemented' }) }], + }; +}); + +// Below is the boilerplate code from MCP SDK documentation +const PORT = 3001; +const app = express(); + +const transports = {}; + +app.get('/sse', async (_req, res) => { + const transport = new SSEServerTransport('/messages', res); + transports[transport.sessionId] = transport; + + res.on('close', () => { + delete transports[transport.sessionId]; + }); + + await server.connect(transport); +}); + +app.post('/messages', async (req, res) => { + const sessionId = String(req.query.sessionId); + const transport = transports[sessionId]; + if (transport) { + await transport.handlePostMessage(req, res, req.body); + } else { + res.status(400).send('No transport found for sessionId'); + } +}); + +app.listen(PORT); +``` + +Run the server with: + +```bash +npm start +``` + + + + +## Inspect the MCP server \{#inspect-the-mcp-server} + +### Clone and run MCP inspector \{#clone-and-run-mcp-inspector} + +Now that we have the MCP server running, we can use the MCP inspector to see if the `whoami` tool is available. + +Due to the limit of the current implementation, we've forked the [MCP inspector](https://github.com/mcp-auth/inspector) to make it more flexible and scalable for authentication and authorization. We've also submitted a pull request to the original repository to include our changes. + +To run the MCP inspector, you can use the following command (Node.js is required): + +```bash +git clone https://github.com/mcp-auth/inspector.git +cd inspector +npm install +npm run dev +``` + +Then, open your browser and navigate to `http://localhost:6274/` (or other URL shown in the terminal) to access the MCP inspector. + +### Connect MCP inspector to the MCP server \{#connect-mcp-inspector-to-the-mcp-server} + +Before we proceed, check the following configuration in MCP inspector: + +- **Transport Type**: Set to `SSE`. +- **URL**: Set to the URL of your MCP server. In our case, it should be `http://localhost:3001/sse`. + +Now you can click the "Connect" button to see if the MCP inspector can connect to the MCP server. If everything is okay, you should see the "Connected" status in the MCP inspector. + +### Checkpoint: Run todo manager tools \{#checkpoint-run-todo-manager-tools} + +1. In the top menu of the MCP inspector, click on the "Tools" tab. +2. Click on the "List Tools" button. +3. You should see the `create-todo`, `get-todos`, and `delete-todo` tools listed on the page. Click on it to open the tool details. +4. You should see the "Run Tool" button in the right side. Click on it and enter required parameters to run the tool. +5. You should see the tool result with the JSON response `{"error": "Not implemented"}`. + +![MCP inspector first run](/docs-assets/images/tutorials/todo-manager/inspector-first-run.png) + +## Integrate with your authorization server \{#integrate-with-your-authorization-server} + +To complete this section, there are several considerations to take into account: + +
+**The issuer URL of your authorization server** + +This is usually the base URL of your authorization server, such as `https://auth.example.com`. Some providers may have a path like `https://example.logto.app/oidc`, so make sure to check your provider's documentation. + +
+ +
+**How to retrieve the authorization server metadata** + +- If your authorization server conforms to the [OAuth 2.0 Authorization Server Metadata](https://datatracker.ietf.org/doc/html/rfc8414) or [OpenID Connect Discovery](https://openid.net/specs/openid-connect-discovery-1_0.html), you can use the MCP Auth built-in utilities to fetch the metadata automatically. +- If your authorization server does not conform to these standards, you will need to manually specify the metadata URL or endpoints in the MCP server configuration. Check your provider's documentation for the specific endpoints. + +
+ +
+**How to register the MCP inspector as a client in your authorization server** + +- If your authorization server supports [Dynamic Client Registration](https://datatracker.ietf.org/doc/html/rfc7591), you can skip this step as the MCP inspector will automatically register itself as a client. +- If your authorization server does not support Dynamic Client Registration, you will need to manually register the MCP inspector as a client in your authorization server. + +
+ +
+**Understand token request parameters** + +When requesting access tokens from different authorization servers, you'll encounter various approaches for specifying the target resource and permissions. Here are the main patterns: + +- **Resource indicator based**: + + - Uses the `resource` parameter to specify the target API (see [RFC 8707: Resource Indicators for OAuth 2.0](https://datatracker.ietf.org/doc/html/rfc8707)) + - Common in modern OAuth 2.0 implementations + - Example request: + ```json + { + "resource": "https://todo.mcp-server.app", + "scope": "create:todos read:todos" + } + ``` + - The server issues tokens specifically bound to the requested resource + +- **Audience based**: + + - Uses the `audience` parameter to specify the intended token recipient + - Similar to resource indicators but with different semantics + - Example request: + ```json + { + "audience": "todo-api", + "scope": "create:todos read:todos" + } + ``` + +- **Pure scope based**: + - Relies solely on scopes without resource/audience parameters + - Traditional OAuth 2.0 approach + - Example request: + ```json + { + "scope": "todo-api:create todo-api:read openid profile" + } + ``` + - Often uses prefixed scopes to namespace permissions + - Common in simpler OAuth 2.0 implementations + +:::tip Best Practices + +- Check your provider's documentation for supported parameters +- Some providers support multiple approaches simultaneously +- Resource indicators provide better security through audience restriction +- Consider using resource indicators when available for better access control + ::: + +
+ +While each provider may have its own specific requirements, the following steps will guide you through the process of integrating the MCP inspector and MCP server with provider-specific configurations. + +### Register MCP inspector as a client \{#register-mcp-inspector-as-a-client} + + + + +Integrating the todo manager with [Logto](https://logto.io) is straightforward as it's an OpenID Connect provider that supports resource indicators and scopes, allowing you to secure your todo API with `https://todo.mcp-server.app` as the resource indicator. + +Since Logto does not support Dynamic Client Registration yet, you will need to manually register the MCP inspector as a client in your Logto tenant: + +1. Open your MCP inspector, click on the "OAuth Configuration" button. Copy the **Redirect URL (auto-populated)** value, which should be something like `http://localhost:6274/oauth/callback`. +2. Sign in to [Logto Console](https://cloud.logto.io) (or your self-hosted Logto Console). +3. Navigate to the "Applications" tab, click on "Create application". In the bottom of the page, click on "Create app without framework". +4. Fill in the application details, then click on "Create application": + - **Select an application type**: Choose "Single-page application". + - **Application name**: Enter a name for your application, e.g., "MCP Inspector". +5. In the "Settings / Redirect URIs" section, paste the **Redirect URL (auto-populated)** value you copied from the MCP inspector. Then click on "Save changes" in the bottom bar. +6. In the top card, you will see the "App ID" value. Copy it. +7. Go back to the MCP inspector and paste the "App ID" value in the "OAuth Configuration" section under "Client ID". +8. Enter the value `{"scope": "create:todos read:todos delete:todos", "resource": "https://todo.mcp-server.app"}` in the "Auth Params" field. This will ensure that the access token returned by Logto contains the necessary scopes to access the todo manager. + + + + + While Asgardeo supports dynamic client registration via a standard API, the endpoint is protected and requires an access token with the necessary permissions. In this tutorial, we’ll register the client manually through the Asgardeo Console. + + :::note + If you don’t have an Asgardeo account, you can [sign up for free](https://asgardeo.io). + ::: + + Follow these steps to configure Asgardeo for MCP Inspector: + + 1. Log in to the [Asgardeo Console](https://console.asgardeo.io) and select your organization. + + 2. Create a new application: + - Go to **Applications** → **New Application** + - Choose **Single-Page Application** + - Enter an application name like `MCP Inspector` + - In the **Authorized Redirect URLs** field, paste the **Redirect URL** copied from MCP Inspector client application (e.g.: `http://localhost:6274/oauth/callback`) + - Click **Create** + + 3. Configure the protocol settings: + - Under the **Protocol** tab: + - Copy the **Client ID** that was auto generated. + - Ensure switching to `JWT` for the `Token Type` in **Access Token** section + - Click **Update** + + 4. In MCP Inspector client application: + - Open the **OAuth Configuration** section + - Paste the copied **Client ID** + - Enter the following in the **Auth Params** field to request the necessary scopes: + + ```json + { "scope": "openid profile email" } + ``` + + + +:::note +This is a generic OAuth 2.0 / OpenID Connect provider integration guide. Both OAuth 2.0 and OIDC follow similar steps as OIDC is built on top of OAuth 2.0. Check your provider's documentation for specific details. +::: + +If your provider supports Dynamic Client Registration, you can directly go to step 8 below to configure the MCP inspector; otherwise, you will need to manually register the MCP inspector as a client: + +1. Open your MCP inspector, click on the "OAuth Configuration" button. Copy the **Redirect URL (auto-populated)** value, which should be something like `http://localhost:6274/oauth/callback`. + +2. Sign in to your provider's console. + +3. Navigate to the "Applications" or "Clients" section, then create a new application or client. + +4. If your provider requires a client type, select "Single-page application" or "Public client". + +5. After creating the application, you will need to configure the redirect URI. Paste the **Redirect URL (auto-populated)** value you copied from the MCP inspector. + +6. Find the "Client ID" or "Application ID" of the newly created application and copy it. + +7. Go back to the MCP inspector and paste the "Client ID" value in the "OAuth Configuration" section under "Client ID". + +8. Enter the following value in the "Auth Params" field to request the necessary scopes for todo operations: + +```json +{ "scope": "create:todos read:todos delete:todos" } +``` + + + + +### Set up MCP auth \{#set-up-mcp-auth} + +In your MCP server project, you need to install the MCP Auth SDK and configure it to use your authorization server metadata. + + + + +First, install the `mcpauth` package: + +```bash +pip install mcpauth +``` + +Or any other package manager you prefer, such as `uv` or `poetry`. + + + + +First, install the `mcp-auth` package: + +```bash +npm install mcp-auth +``` + + + + +MCP Auth requires the authorization server metadata to be able to initialize. Depending on your provider: + + + + + +The issuer URL can be found in your application details page in Logto Console, in the "Endpoints & Credentials / Issuer endpoint" section. It should look like `https://my-project.logto.app/oidc`. + + + + + + + + You can find the issuer URL in the Asgardeo Console. Navigate to the created application, and open the **Info** tab. The **Issuer** field will be displayed there and should look like: + `https://api.asgardeo.io/t//oauth2/token` + + + + + + + +For OAuth 2.0 providers, you'll need to: + +1. Check your provider's documentation for the authorization server URL (often called issuer URL or base URL) +2. Some providers may expose this at `https://{your-domain}/.well-known/oauth-authorization-server` +3. Look in your provider's admin console under OAuth/API settings + + + + + + + + + + + +Update the `todo-manager.py` to include the MCP Auth configuration: + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config + +auth_issuer = '' # Replace with your issuer endpoint +auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OIDC) +mcp_auth = MCPAuth(server=auth_server_config) +``` + + + + +Update the `todo-manager.ts` to include the MCP Auth configuration: + +```ts +// todo-manager.ts + +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const authIssuer = ''; // Replace with your issuer endpoint +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig(authIssuer, { type: 'oidc' }), +}); +``` + + + + +### Update MCP server \{#update-mcp-server} + +We are almost done! It's time to update the MCP server to apply the MCP Auth route and middleware function, then implement the permission-based access control for the todo manager tools based on the user's scopes. + + + + +```python +@mcp.tool() +def create_todo(content: str) -> dict[str, Any]: + """Create a new todo.""" + return ( + mcp_auth.auth_info.scopes + if mcp_auth.auth_info # This will be populated by the Bearer auth middleware + else {"error": "Not authenticated"} + ) + +# ... + +bearer_auth = Middleware(mcp_auth.bearer_auth_middleware("jwt")) +app = Starlette( + routes=[ + # Add the metadata route (`/.well-known/oauth-authorization-server`) + mcp_auth.metadata_route(), + # Protect the MCP server with the Bearer auth middleware + Mount('/', app=mcp.sse_app(), middleware=[bearer_auth]), + ], +) +``` + + + + +```js +server.tool( + 'create-todo', + 'Create a new todo', + { content: z.string() }, + async ({ content, authInfo }) => { + return { + content: [ + { type: 'text', text: JSON.stringify(authInfo?.scopes ?? { error: 'Not authenticated' }) }, + ], + }; + } +); + +// ... + +app.use(mcpAuth.delegatedRouter()); +app.use(mcpAuth.bearerAuth('jwt')); +``` + + + + +Next, let's implement the specific tools. + +First, let's create a simple todo service to provide basic CRUD operations for managing todo items in memory. + + + +```python +# service.py + +""" +A simple Todo service for demonstration purposes. +Uses an in-memory list to store todos. +""" + +from datetime import datetime +from typing import List, Optional, Dict, Any +import random +import string + +class Todo: +"""Represents a todo item.""" + + def __init__(self, id: str, content: str, owner_id: str, created_at: str): + self.id = id + self.content = content + self.owner_id = owner_id + self.created_at = created_at + + def to_dict(self) -> Dict[str, Any]: + """Convert todo to dictionary for JSON serialization.""" + return { + "id": self.id, + "content": self.content, + "ownerId": self.owner_id, + "createdAt": self.created_at + } + +class TodoService: +"""A simple Todo service for demonstration purposes.""" + + def __init__(self): + self._todos: List[Todo] = [] + + def get_all_todos(self, owner_id: Optional[str] = None) -> List[Dict[str, Any]]: + """ + Get all todos, optionally filtered by owner_id. + + Args: + owner_id: If provided, only return todos owned by this user + + Returns: + List of todo dictionaries + """ + if owner_id: + filtered_todos = [todo for todo in self._todos if todo.owner_id == owner_id] + return [todo.to_dict() for todo in filtered_todos] + return [todo.to_dict() for todo in self._todos] + + def get_todo_by_id(self, todo_id: str) -> Optional[Todo]: + """ + Get a todo by its ID. + + Args: + todo_id: The ID of the todo to retrieve + + Returns: + Todo object if found, None otherwise + """ + for todo in self._todos: + if todo.id == todo_id: + return todo + return None + + def create_todo(self, content: str, owner_id: str) -> Dict[str, Any]: + """ + Create a new todo. + + Args: + content: The content of the todo + owner_id: The ID of the user who owns this todo + + Returns: + Dictionary representation of the created todo + """ + todo = Todo( + id=self._generate_id(), + content=content, + owner_id=owner_id, + created_at=datetime.now().isoformat() + ) + self._todos.append(todo) + return todo.to_dict() + + def delete_todo(self, todo_id: str) -> Optional[Dict[str, Any]]: + """ + Delete a todo by its ID. + + Args: + todo_id: The ID of the todo to delete + + Returns: + Dictionary representation of the deleted todo if found, None otherwise + """ + for i, todo in enumerate(self._todos): + if todo.id == todo_id: + deleted_todo = self._todos.pop(i) + return deleted_todo.to_dict() + return None + + def _generate_id(self) -> str: + """Generate a random ID for a todo.""" + return ''.join(random.choices(string.ascii_lowercase + string.digits, k=8)) + +```` + + + + + +```ts +// todo-service.ts + +type Todo = { + id: string; + content: string; + ownerId: string; + createdAt: string; +}; + +/** + * A simple Todo service for demonstration purposes. + * Use an in-memory array to store todos + */ +export class TodoService { + private readonly todos: Todo[] = []; + + getAllTodos(ownerId?: string): Todo[] { + if (ownerId) { + return this.todos.filter((todo) => todo.ownerId === ownerId); + } + return this.todos; + } + + getTodoById(id: string): Todo | undefined { + return this.todos.find((todo) => todo.id === id); + } + + createTodo({ content, ownerId }: { content: string; ownerId: string }): Todo { + const todo: Todo = { + id: this.genId(), + content, + ownerId, + createdAt: new Date().toISOString(), + }; + + // eslint-disable-next-line @silverhand/fp/no-mutating-methods + this.todos.push(todo); + return todo; + } + + deleteTodo(id: string): Todo | undefined { + const index = this.todos.findIndex((todo) => todo.id === id); + + if (index === -1) { + return undefined; + } + + // eslint-disable-next-line @silverhand/fp/no-mutating-methods + const [deleted] = this.todos.splice(index, 1); + return deleted; + } + + private genId(): string { + return Math.random().toString(36).slice(2, 10); + } +} +```` + + + + +then in the tools layer, we'll determine whether operations are allowed based on the user's scopes: + + + + +```python +# todo-manager.py + +from typing import Any, Optional +from mcpauth.errors import MCPAuthBearerAuthError + +def assert_user_id(auth_info: Optional[dict]) -> str: + """Extract and validate user ID from auth info.""" + subject = auth_info.get('subject') if auth_info else None + if not subject: + raise ValueError('Invalid auth info') + return subject + +def has_required_scopes(user_scopes: list[str], required_scopes: list[str]) -> bool: + """Check if user has all required scopes.""" + return all(scope in user_scopes for scope in required_scopes) + +# Create an instance of TodoService +todo_service = TodoService() + +@mcp.tool() +def create_todo(content: str) -> dict[str, Any]: + """Create a new todo. + + Only users with 'create:todos' scope can create todos. + """ + # Get authentication info + auth_info = mcp_auth.auth_info + + # Validate user ID + try: + user_id = assert_user_id(auth_info) + except ValueError as e: + return {"error": str(e)} + + # Check if user has the required permissions + if not has_required_scopes(auth_info.scopes if auth_info else [], ['create:todos']): + raise MCPAuthBearerAuthError('missing_required_scopes') + + # Create new todo + created_todo = todo_service.create_todo(content=content, owner_id=user_id) + + # Return the created todo + return created_todo.__dict__ + +# ... +``` + +You can check our [sample code](https://github.com/mcp-auth/python/tree/master/samples/server) for all other detailed implementations. + + + + +```ts +// todo-manager.ts + +// ... other imports +import assert from 'node:assert'; +import { type AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js'; +import { TodoService } from './todo-service.js'; + +const todoService = new TodoService(); + +const assertUserId = (authInfo?: AuthInfo) => { + const { subject } = authInfo ?? {}; + assert(subject, 'Invalid auth info'); + return subject; +}; + +/** + * Check if user has all the required scopes for an operation + */ +const hasRequiredScopes = (userScopes: string[], requiredScopes: string[]): boolean => { + return requiredScopes.every((scope) => userScopes.includes(scope)); +}; + +server.tool( + 'create-todo', + 'Create a new todo', + { content: z.string() }, + ({ content }: { content: string }, { authInfo }) => { + const userId = assertUserId(authInfo); + + /** + * Only users with 'create:todos' scope can create todos + */ + if (!hasRequiredScopes(authInfo?.scopes ?? [], ['create:todos'])) { + throw new MCPAuthBearerAuthError('missing_required_scopes'); + } + + const createdTodo = todoService.createTodo({ content, ownerId: userId }); + + return { + content: [{ type: 'text', text: JSON.stringify(createdTodo) }], + }; + } +); + +// ... +``` + +You can check our [sample code](https://github.com/mcp-auth/js/tree/master/packages/sample-servers/src/todo-manager) for all other detailed implementations. + + + + +## Checkpoint: Run the `todo-manager` tools \{#checkpoint-run-the-todo-manager-tools} + +Restart your MCP server and open the MCP inspector in your browser. When you click the "Connect" button, you should be redirected to your authorization server's sign-in page. + +Once you sign in and back to the MCP inspector, repeat the actions we did in the previous checkpoint to run todo manager tools. This time, you can use these tools with your authenticated user identity. The behavior of the tools will depend on the roles and permissions assigned to your user: + +- If you're logged in as a **User** (with only `create:todos` scope): + + - You can create new todos using the `create-todo` tool + - You can only view and delete your own todos + - You won't be able to see or delete other users' todos + +- If you're logged in as an **Admin** (with all scopes: `create:todos`, `read:todos`, `delete:todos`): + - You can create new todos + - You can view all todos in the system using the `get-todos` tool + - You can delete any todo using the `delete-todo` tool, regardless of who created it + +You can test these different permission levels by: + +1. Signing out of the current session (click the "Disconnect" button in MCP inspector) +2. Signing in with a different user account that has different roles/permissions +3. Trying the same tools again to observe how the behavior changes based on the user's permissions + +This demonstrates how role-based access control (RBAC) works in practice, where different users have different levels of access to the system's functionality. + +![MCP inspector todo manager tool result](/docs-assets/images/tutorials/todo-manager/result.png) + + + + +:::info +Check out the [MCP Auth Python SDK repository](https://github.com/mcp-auth/python/blob/master/samples/server/todo-manager/server.py) for the complete code of the MCP server (OIDC version). +::: + + + + +:::info +Check out the [MCP Auth Node.js SDK repository](https://github.com/mcp-auth/js/blob/master/packages/sample-servers/src) for the complete code of the MCP server (OIDC version). +::: + + + + +## Closing notes \{#closing-notes} + +🎊 Congratulations! You have successfully completed the tutorial. Let's recap what we've done: + +- Setting up a basic MCP server with todo management tools (`create-todo`, `get-todos`, `delete-todo`) +- Implementing role-based access control (RBAC) with different permission levels for users and admins +- Integrating the MCP server with an authorization server using MCP Auth +- Configuring the MCP Inspector to authenticate users and use access tokens with scopes to call tools + +Be sure to check out other tutorials and documentation to make the most of MCP Auth. diff --git a/docs/tutorials/whoami/_manual-metadata-fetching.mdx b/versioned_docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx similarity index 100% rename from docs/tutorials/whoami/_manual-metadata-fetching.mdx rename to versioned_docs/version-0.1.1/tutorials/todo-manager/_manual-metadata-fetching.mdx diff --git a/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx b/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx new file mode 100644 index 0000000..a648043 --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oauth-or-oidc.mdx @@ -0,0 +1,41 @@ +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +import ManualMetadataFetching from './_manual-metadata-fetching.mdx'; +import MalformedMetadataTranspilation from './_transpile-metadata.mdx'; + + + + + +Update the `todo-manager.py` to include the MCP Auth configuration: + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config + +auth_issuer = '' # Replace with your issuer endpoint +auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OAUTH) # or AuthServerType.OIDC +mcp_auth = MCPAuth(server=auth_server_config) +``` + + + + +Update the `todo-manager.ts` to include the MCP Auth configuration: + +```js +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const authIssuer = ''; // Replace with your issuer endpoint +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig(authIssuer, { type: 'oauth' }), // or { type: 'oidc' } +}); +``` + + + + + + diff --git a/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx b/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx new file mode 100644 index 0000000..f0ccb7d --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/todo-manager/_setup-oidc.mdx @@ -0,0 +1,41 @@ +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +import ManualMetadataFetching from './_manual-metadata-fetching.mdx'; +import MalformedMetadataTranspilation from './_transpile-metadata.mdx'; + + + + + +Update the `todo-manager.py` to include the MCP Auth configuration: + +```python +from mcpauth import MCPAuth +from mcpauth.config import AuthServerType +from mcpauth.utils import fetch_server_config + +auth_issuer = '' # Replace with your issuer endpoint +auth_server_config = fetch_server_config(auth_issuer, type=AuthServerType.OIDC) +mcp_auth = MCPAuth(server=auth_server_config) +``` + + + + +Update the `todo-manager.ts` to include the MCP Auth configuration: + +```js +import { MCPAuth, fetchServerConfig } from 'mcp-auth'; + +const authIssuer = ''; // Replace with your issuer endpoint +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig(authIssuer, { type: 'oidc' }), +}); +``` + + + + +{props.showAlternative && } +{props.showAlternative && } diff --git a/docs/tutorials/whoami/_transpile-metadata.mdx b/versioned_docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx similarity index 100% rename from docs/tutorials/whoami/_transpile-metadata.mdx rename to versioned_docs/version-0.1.1/tutorials/todo-manager/_transpile-metadata.mdx diff --git a/docs/tutorials/todo-manager/assets/inspector-first-run.png b/versioned_docs/version-0.1.1/tutorials/todo-manager/assets/inspector-first-run.png similarity index 100% rename from docs/tutorials/todo-manager/assets/inspector-first-run.png rename to versioned_docs/version-0.1.1/tutorials/todo-manager/assets/inspector-first-run.png diff --git a/docs/tutorials/todo-manager/assets/result.png b/versioned_docs/version-0.1.1/tutorials/todo-manager/assets/result.png similarity index 100% rename from docs/tutorials/todo-manager/assets/result.png rename to versioned_docs/version-0.1.1/tutorials/todo-manager/assets/result.png diff --git a/docs/tutorials/whoami/README.mdx b/versioned_docs/version-0.1.1/tutorials/whoami/README.mdx similarity index 99% rename from docs/tutorials/whoami/README.mdx rename to versioned_docs/version-0.1.1/tutorials/whoami/README.mdx index 2eaf241..f2445df 100644 --- a/docs/tutorials/whoami/README.mdx +++ b/versioned_docs/version-0.1.1/tutorials/whoami/README.mdx @@ -97,7 +97,7 @@ While OAuth 2.0 does not define a standard way to retrieve user identity informa ### Dynamic Client Registration \{#dynamic-client-registration} -Dynamic Client Registration is not required for this tutorial, but it can be useful if you want to automate the MCP client registration process with your authorization server. Check [Is Dynamic Client Registration required?](../../provider-list.mdx#is-dcr-required) for more details. +Dynamic Client Registration is not required for this tutorial, but it can be useful if you want to automate the MCP client registration process with your authorization server. Check [Is Dynamic Client Registration required?](/provider-list#is-dcr-required) for more details. ## Set up the MCP server \{#set-up-the-mcp-server} diff --git a/versioned_docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx b/versioned_docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx new file mode 100644 index 0000000..78bfbcb --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/whoami/_manual-metadata-fetching.mdx @@ -0,0 +1,3 @@ +:::note +If your provider does not support {props.oidc ? 'OpenID Connect Discovery' : 'OAuth 2.0 Authorization Server Metadata'}, you can manually specify the metadata URL or endpoints. Check [Other ways to initialize MCP Auth](../../configure-server/mcp-auth.mdx#other-ways) for more details. +::: diff --git a/docs/tutorials/whoami/_setup-oauth.mdx b/versioned_docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx similarity index 100% rename from docs/tutorials/whoami/_setup-oauth.mdx rename to versioned_docs/version-0.1.1/tutorials/whoami/_setup-oauth.mdx diff --git a/docs/tutorials/whoami/_setup-oidc.mdx b/versioned_docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx similarity index 100% rename from docs/tutorials/whoami/_setup-oidc.mdx rename to versioned_docs/version-0.1.1/tutorials/whoami/_setup-oidc.mdx diff --git a/versioned_docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx b/versioned_docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx new file mode 100644 index 0000000..d13ff01 --- /dev/null +++ b/versioned_docs/version-0.1.1/tutorials/whoami/_transpile-metadata.mdx @@ -0,0 +1,31 @@ +import TabItem from '@theme/TabItem'; +import Tabs from '@theme/Tabs'; + +In some cases, the provider response may be malformed or not conforming to the expected metadata format. If you are confident that the provider is compliant, you can transpile the metadata via the config option: + + + + +```python +mcp_auth = MCPAuth( + server=fetch_server_config( + # ...other options + transpile_data=lambda data: {**data, 'response_types_supported': ['code']} # [!code highlight] + ) +) +``` + + + + +```ts +const mcpAuth = new MCPAuth({ + server: await fetchServerConfig(authIssuer, { + // ...other options + transpileData: (data) => ({ ...data, response_types_supported: ['code'] }), // [!code highlight] + }), +}); +``` + + + diff --git a/docs/tutorials/whoami/assets/inspector-first-run.png b/versioned_docs/version-0.1.1/tutorials/whoami/assets/inspector-first-run.png similarity index 100% rename from docs/tutorials/whoami/assets/inspector-first-run.png rename to versioned_docs/version-0.1.1/tutorials/whoami/assets/inspector-first-run.png diff --git a/docs/tutorials/whoami/assets/result.png b/versioned_docs/version-0.1.1/tutorials/whoami/assets/result.png similarity index 100% rename from docs/tutorials/whoami/assets/result.png rename to versioned_docs/version-0.1.1/tutorials/whoami/assets/result.png diff --git a/versioned_sidebars/version-0.1.1-sidebars.json b/versioned_sidebars/version-0.1.1-sidebars.json new file mode 100644 index 0000000..39332bf --- /dev/null +++ b/versioned_sidebars/version-0.1.1-sidebars.json @@ -0,0 +1,8 @@ +{ + "docsSidebar": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/versions.json b/versions.json new file mode 100644 index 0000000..5dbdc69 --- /dev/null +++ b/versions.json @@ -0,0 +1,3 @@ +[ + "0.1.1" +]