You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This guide walks you through enabling your AI agent to access third-party APIs (e.g., Google Calendar, GitHub, etc.) on behalf of users. By leveraging Logto's social connectors and Secret Vault, you can securely store and manage access tokens, allowing your agent to perform automated tasks without repeatedly asking users to re-authenticate.
3. Fill in the app name and other required fields, then click **Create application**.
62
-
4. Click **Permissions** tab, in the **User** section, click "Add".
63
-
5. In the opened dialog -> **User data** -> select **`profile`**, **`email`** permissions, then click **Save**.
64
-
6. In the third-party app, configure scopes to request `openid profile email` permissions (scopes).
62
+
4. Click the **Permissions** tab to grant [permissions](/integrate-logto/third-party-applications/permission-management) to the app:
65
63
66
-
**Note**: `openid` is required for OIDC, and `profile` and `email` are the permissions you added in the previous step.
64
+
-**User** section: user data permissions such as **`profile`** and **`email`**, for basic identity claims.
65
+
-**API resource** section: permissions (scopes) of the [API resources](/authorization/global-api-resources) you've defined in Logto, e.g., the API resource that represents your {props.serviceName??'service'}.
66
+
-**Organization** section: organization permissions, if you use Logto organizations.
67
67
68
-
7. Configure the **redirect URI** of your third-party application accordingly. Remember to update the redirect URI in Logto as well.
68
+
5. In the third-party app, configure scopes to request the permissions you granted, e.g., `openid profile email` plus the API resource scopes.
69
+
70
+
**Note**: `openid` is required for OIDC. To receive an access token bound to an API resource, the app must also include the `resource` parameter in the authorization request. MCP clients that follow the latest MCP specification do this automatically based on the protected resource metadata.
71
+
72
+
6. Configure the **redirect URI** of your third-party application accordingly. Remember to update the redirect URI in Logto as well.
Copy file name to clipboardExpand all lines: docs/use-cases/ai/fragments/_mcp-prerequisites.mdx
+20-23Lines changed: 20 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,38 +3,35 @@ import Mermaid from '@theme/Mermaid';
3
3
## Prerequisites \{#prerequisites}
4
4
5
5
- A [Logto Cloud](https://cloud.logto.io) (or self-hosted) tenant
6
-
- Node.js or Python environment
6
+
- Node.js >= 20 environment
7
7
8
8
### Understanding the architecture \{#understanding-the-architecture}
9
9
10
-
-**MCP server**: The server that exposes tools and resources to MCP clients.
11
-
-**MCP client**: A client used to initiate the authentication flow and test the integration. {<b>{props.isThirdParty?'The third-party AI agent will be used as the client in this guide.':"We'll use the MCP Inspector as the client in this guide."}</b>}
12
-
-**Logto**: Serves as the OpenID Connect provider (authorization server) and manages user identities.
10
+
-**MCP server**: The server that exposes tools and resources to MCP clients. Following the [latest MCP specification](https://modelcontextprotocol.io/specification/latest/basic/authorization), it acts as an OAuth 2.0 resource server that validates access tokens issued by Logto.
11
+
-**MCP client**: A client used to initiate the authentication flow and test the integration. {<b>{props.isThirdParty?'The third-party AI agent will be used as the client in this guide.':"We'll use VS Code (with built-in MCP support) as the client in this guide."}</b>}
12
+
-**Logto**: Serves as the OpenID Connect provider (authorization server), manages user identities, and issues audience-bound JWT access tokens for your MCP server.
13
13
14
14
A non-normative sequence diagram illustrates the overall flow of the process:
15
15
16
16
<Mermaidvalue={`sequenceDiagram
17
-
participant Client as MCP Client<br/>${props.isThirdParty?'(third-party AI agent)':'(MCP Inspector)'}
The complete, runnable sample code for this guide can be found in the [mcp-auth/js](https://github.com/mcp-auth/js/tree/master/packages/sample-servers) repository:
3
3
4
-
<TabsgroupId="sdk">
5
-
<TabItemvalue="python"label="Python">
4
+
-[`whoami-express`](https://github.com/mcp-auth/js/tree/master/packages/sample-servers/src/whoami-express): the "whoami" server in this guide, on Node.js with Express.
5
+
-[`whoami`](https://github.com/mcp-auth/js/tree/master/packages/sample-servers/src/whoami): the same server built fetch-native (web-standard `Request` / `Response` with [Hono](https://hono.dev)), deployable to Cloudflare Workers.
6
6
7
-
The full MCP server code can be found in the [mcp-auth/python](https://github.com/mcp-auth/python) repository.
8
-
9
-
</TabItem>
10
-
<TabItemvalue="node"label="Node.js">
11
-
12
-
The full MCP server code can be found in the [mcp-auth/js](https://github.com/mcp-auth/js) repository.
0 commit comments