|
1 | | -# MCP Server: External Auth Provider |
| 1 | +# External Auth |
2 | 2 |
|
3 | | -Demonstrates connecting an external MCP server (GitHub) using a manually configured OAuth provider. You register your own OAuth credentials and Slack brokers the per-user authorization flow. |
4 | | - |
5 | | -## How it works |
6 | | - |
7 | | -1. You create a GitHub OAuth App and get a client ID + secret |
8 | | -2. Define the OAuth provider in `external_auth_providers` in your manifest |
9 | | -3. Reference it via `auth_provider_key` in your `mcp_servers` config |
10 | | -4. Users authorize with GitHub when they first connect in Slackbot |
11 | | -5. Slack stores per-user tokens and passes them to the MCP server |
12 | | - |
13 | | -No app code is needed — GitHub hosts the MCP server. This manifest is all you need. |
| 3 | +Connect a remote MCP server with manual OAuth provider configuration. |
14 | 4 |
|
15 | 5 | ## Setup |
16 | 6 |
|
17 | | -1. Create a GitHub OAuth App at [github.com/settings/developers](https://github.com/settings/developers) |
18 | | - - Set the callback URL to: `https://oauth2.slack.com/external/auth/callback` |
19 | | -2. Replace `YOUR_GITHUB_CLIENT_ID` in `manifest.json` |
20 | | -3. Create a new app at [api.slack.com/apps](https://api.slack.com/apps) using the manifest |
21 | | -4. Add the client secret via the **External MCP Servers** section in the App Config UI |
22 | | -5. Install the app to your workspace |
23 | | - |
24 | | -## Try it |
25 | | - |
26 | | -Ask Slackbot: _"Show me my recent GitHub pull requests"_ |
27 | | - |
28 | | -## Manifest |
| 7 | +> Callback URL: https://oauth2.slack.com/external/auth/callback |
29 | 8 |
|
30 | | -```json |
31 | | -"external_auth_providers": { |
32 | | - "oauth2": { |
33 | | - "github": { |
34 | | - "provider_type": "CUSTOM", |
35 | | - "options": { |
36 | | - "client_id": "YOUR_GITHUB_CLIENT_ID", |
37 | | - "authorization_url": "https://github.com/login/oauth/authorize", |
38 | | - "token_url": "https://github.com/login/oauth/access_token", |
39 | | - "identity_config": { |
40 | | - "url": "https://api.github.com/user", |
41 | | - "account_identifier": "$.login" |
42 | | - } |
43 | | - } |
44 | | - } |
45 | | - } |
46 | | -}, |
47 | | -"mcp_servers": { |
48 | | - "github": { |
49 | | - "url": "https://api.githubcopilot.com/mcp/", |
50 | | - "auth_provider_key": "github" |
51 | | - } |
52 | | -} |
| 9 | +```sh |
| 10 | +$ open https://github.com/settings/developers # Create GitHub app |
| 11 | +$ slack manifest # Replace values |
| 12 | +$ slack install --environment deployed # Create Slack app |
| 13 | +$ slack external-auth add-secret --force |
53 | 14 | ``` |
54 | 15 |
|
55 | | -The `auth_provider_key` links the MCP server to the OAuth provider defined in `external_auth_providers`. |
| 16 | +Ask Slackbot: "Show me my recent GitHub pull requests" |
0 commit comments