|
1 | 1 | --- |
2 | 2 | title: "OAuth" |
3 | 3 | metadataTitle: "OAuth Authentication | xmcp Documentation" |
4 | | -publishedAt: "2025-07-06" |
5 | | -summary: "Learn how to use OAuth authentication in your xmcp application." |
6 | | -description: "Implement OAuth in your MCP server with your own providers." |
| 4 | +publishedAt: "2025-01-16" |
| 5 | +summary: "OAuth authentication plugins for xmcp servers." |
| 6 | +description: "Production-ready OAuth implementations with authentication plugins." |
7 | 7 | --- |
8 | 8 |
|
9 | 9 | <Callout variant="warning"> |
10 | | - This is an experimental feature and may not work as expected. |
| 10 | + The experimental `oauth` configuration has been deprecated in favor of |
| 11 | + production-ready plugin implementations. |
11 | 12 | </Callout> |
12 | 13 |
|
13 | | -The OAuth provider implementation strictly implements Dynamic Client Registration. |
| 14 | +The built-in OAuth system has been replaced with dedicated authentication plugins that provide better DX, improved security, and more features out of the box. |
14 | 15 |
|
15 | | -You can configure the OAuth provider by adding the following to your `xmcp.config.ts` file: |
| 16 | +Use one of the official plugins below that handle OAuth flows, token management, and session handling for you: |
16 | 17 |
|
17 | | -```typescript title="xmcp.config.ts" |
18 | | -import { XmcpConfig } from "xmcp"; |
| 18 | +<OAuthPlugins /> |
19 | 19 |
|
20 | | -const config: XmcpConfig = { |
21 | | - experimental: { |
22 | | - oauth: { |
23 | | - baseUrl: "https://my-app.com", |
24 | | - endpoints: { |
25 | | - authorizationUrl: "https://auth-provider.com/oauth/authorize", |
26 | | - tokenUrl: "https://auth-provider.com/oauth/token", |
27 | | - registerUrl: "https://auth-provider.com/oauth/register", // mandatory |
28 | | - }, |
29 | | - issuerUrl: "https://my-app.com", |
30 | | - defaultScopes: ["openid", "profile", "email"], |
31 | | - pathPrefix: "/oauth2", |
32 | | - }, |
33 | | - }, |
34 | | -}; |
35 | | - |
36 | | -export default config; |
37 | | -``` |
38 | | - |
39 | | -The usage of this configuration is only limited to the HTTP transport on apps scaffolded with `create-xmcp-app`, not with the adapter modes. |
| 20 | +Each plugin integrates directly with its respective auth provider and requires minimal configuration. Choose the one that matches your existing infrastructure or start fresh with any of them. |
0 commit comments