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
'Discover how to add authentication and authorization for AI agents accessing your app, ensuring security and control across AI-driven workflows.',
44
+
'Discover how to add authentication and authorization for third-party AI agents accessing your app, ensuring security and control across AI-driven workflows.',
# Enable AI agent and third-party app access to your MCP server
13
+
# Enable third-party AI agent access to your MCP server
14
14
15
15
:::note
16
-
If you want to integrate your MCP server with your own app, please refer to the [Enable auth for your MCP-powered apps with Logto](./mcp-server-add-auth) guide.
16
+
If you want to integrate your MCP server with your own AI agent or app, please refer to the [Enable auth for your MCP-powered apps with Logto](./mcp-server-add-auth) guide.
17
17
:::
18
18
19
19
This guide walks you through integrating Logto with your MCP server using [mcp-auth](https://mcp-auth.dev), allowing you to authenticate users and securely retrieve their identity information using the standard OpenID Connect flow.
@@ -22,28 +22,30 @@ You'll learn how to:
22
22
23
23
- Configure Logto as the authorization server for your MCP server.
24
24
- Set up a “whoami” tool to return the current user's identity claims.
25
-
- Test the flow with an AI agent or third-party app.
25
+
- Test the flow with a third-party AI agent.
26
26
27
27
After this tutorial, your MCP server will:
28
28
29
29
- Authenticate users in your Logto tenant.
30
30
- Return identity claims (`sub`, `username`, `name`, `email`, etc.) for the "whoami" tool invocation.
31
31
32
-
<PrerequisitesclientDescription="The AI agent or third-party app will be used as the client in this guide." />
32
+
<PrerequisitesclientDescription="The third-party AI agent will be used as the client in this guide." />
33
33
34
-
## Set up AI agent or third-party app
34
+
## Set up third-party AI agent
35
35
36
-
To enable the AI agent or third-party app (client) to access your MCP server, you need to set up the following:
36
+
To enable the third-party AI agent to access your MCP server, you need to set up the following:
37
37
38
38
1. The client should be able to make MCP requests to invoke the tools exposed by the MCP server.
39
39
2. The client should be able to handle the 401 Unauthorized response. See [Authorization Flow Steps](https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization#2-5-authorization-flow-steps) for more details.
40
40
3. After successful authentication, the client should be able to make requests to the MCP server with the access token obtained from Logto.
41
41
42
-
## Set up app in Logto
42
+
## Set up AI agent in Logto
43
43
44
-
### Allow developers to create third-party apps
44
+
To enable the third-party AI agent to access your MCP server, you need to set up a **third-party app** in Logto. This app will be used to represent the AI agent and obtain the necessary credentials for authentication and authorization.
45
45
46
-
If you are building a marketplace or want to allow developers to create third-party apps, you can leverage [Logto Management API](/integrate-logto/interact-with-management-api) to create third-party apps programmatically. This allows developers to register their applications and obtain the necessary credentials for authentication.
46
+
### Allow developers to create third-party apps in Logto
47
+
48
+
If you are building a marketplace or want to allow developers to create third-party apps in Logto, you can leverage [Logto Management API](/integrate-logto/interact-with-management-api) to create third-party apps programmatically. This allows developers to register their applications and obtain the necessary credentials for authentication.
47
49
48
50
You'll need to host your own service to handle the client registration process. This service will interact with the Logto Management API to create third-party apps on behalf of developers.
49
51
@@ -57,7 +59,7 @@ flowchart LR
57
59
58
60
Alternatively, you can manually create third-party apps in Logto Console to get familiar with the process.
59
61
60
-
### Manually create a third-party app
62
+
### Manually create a third-party app in Logto
61
63
62
64
You can manually create a third-party app in Logto Console for testing purposes or ad-hoc integrations. This is useful when you want to quickly test the integration without implementing a full client-registration flow.
63
65
@@ -84,7 +86,7 @@ You can manually create a third-party app in Logto Console for testing purposes
84
86
## Test the integration
85
87
86
88
1. Start the MCP server.
87
-
2. Start the AI agent or third-party app (client).
89
+
2. Start the AI agent.
88
90
3. In the client, invoke the `whoami` tool to retrieve the current user's identity claims.
89
91
4. The client should handle the 401 Unauthorized response and redirect the user to Logto for authentication.
90
92
5. After successful authentication, the client should receive an access token and use it to make requests to the MCP server.
0 commit comments