|
| 1 | +--- |
| 2 | +title: OAuth-Enabled MCP Servers |
| 3 | +description: Learn how to install and authorize OAuth-enabled MCP servers with per-user authentication and automatic token management. |
| 4 | +sidebarTitle: MCP OAuth Servers |
| 5 | +--- |
| 6 | + |
| 7 | +Some MCP servers require OAuth authorization to access external services like Box, Google Drive, or Slack. OAuth-enabled servers work differently from standard MCP servers because each user must authorize individually with their own account. |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +**OAuth-enabled MCP servers** connect to third-party services that require user consent. When your team installs an OAuth server, each team member must go through their own authorization flow. |
| 12 | + |
| 13 | +**Key Difference:** |
| 14 | +- **Standard MCP servers**: Team admin configures shared credentials |
| 15 | +- **OAuth MCP servers**: Each user authorizes with their personal account |
| 16 | + |
| 17 | +**Why User-Level Authorization?** |
| 18 | +- Alice's Google Drive ≠ Bob's Google Drive |
| 19 | +- Each user accesses their own data, not shared team data |
| 20 | +- OAuth tokens are private and encrypted per user |
| 21 | +- Actions are traceable to individual users for accountability |
| 22 | + |
| 23 | +**This is NOT:** |
| 24 | +- GitHub OAuth (used for logging into DeployStack) |
| 25 | +- Satellite OAuth (used for client connections) |
| 26 | +- Team-level configuration (args/env/headers from three-tier system) |
| 27 | + |
| 28 | +## How OAuth MCP Servers Work |
| 29 | + |
| 30 | +### Team Installation (Team Admin Only) |
| 31 | + |
| 32 | +When a `team_admin` installs an OAuth-enabled MCP server: |
| 33 | + |
| 34 | +1. **Browse the catalog** and find an OAuth server (Box, Google Drive, etc.) |
| 35 | +2. **Click "Install & Authorize"** to create the team installation |
| 36 | +3. **The team admin is redirected** to authorize with their own account |
| 37 | +4. **Installation appears in team** with "Connected" status for team admin |
| 38 | + |
| 39 | +**Important:** Only the team admin sees "Connected" at this point. Other team members will see "Auth Required" until they authorize. |
| 40 | + |
| 41 | +### Individual Authorization (All Users) |
| 42 | + |
| 43 | +When Bob (team_user) or any other team member views the installations: |
| 44 | + |
| 45 | +1. **Bob sees the installation** with "⚠ Auth Required" status |
| 46 | +2. **Bob clicks "Reconnect"** to start his own authorization |
| 47 | +3. **Browser popup opens** to the OAuth provider (Box, Google, etc.) |
| 48 | +4. **Bob consents** to DeployStack accessing his account |
| 49 | +5. **Bob is redirected back** and sees "✓ Connected" status |
| 50 | + |
| 51 | +**Result:** Bob's tokens are stored separately from Alice's tokens. Each user's MCP operations use their own credentials. |
| 52 | + |
| 53 | +## Authorization Flow |
| 54 | + |
| 55 | +### Step 1: User Initiates Authorization |
| 56 | + |
| 57 | +When you click "Authorize" or "Reconnect": |
| 58 | +- DeployStack starts OAuth discovery from the MCP server |
| 59 | +- A unique authorization URL is generated for you |
| 60 | +- PKCE security parameters are created (prevents token theft) |
| 61 | + |
| 62 | +### Step 2: Consent Screen |
| 63 | + |
| 64 | +A browser window opens showing: |
| 65 | +- The service you're authorizing (Box, Google, etc.) |
| 66 | +- What permissions DeployStack is requesting |
| 67 | +- Your personal account to authorize with |
| 68 | + |
| 69 | +**You choose:** Allow or Deny |
| 70 | + |
| 71 | +### Step 3: Token Exchange |
| 72 | + |
| 73 | +After you click "Allow": |
| 74 | +- The OAuth provider redirects you back to DeployStack |
| 75 | +- DeployStack exchanges the authorization code for tokens |
| 76 | +- Tokens are encrypted and stored with your user ID |
| 77 | +- You see "✓ Connected" status |
| 78 | + |
| 79 | +### Step 4: Automatic Token Management |
| 80 | + |
| 81 | +Once authorized: |
| 82 | +- Background job monitors token expiration |
| 83 | +- Tokens are automatically refreshed before they expire |
| 84 | +- You stay connected without re-authorizing |
| 85 | +- If refresh fails, you'll see "Auth Required" again |
| 86 | + |
| 87 | +## Multi-User Team Scenarios |
| 88 | + |
| 89 | +### Scenario: Three-Person Team with Box MCP |
| 90 | + |
| 91 | +**Team:** Acme Corp |
| 92 | +- Alice (team_admin) |
| 93 | +- Bob (team_user) |
| 94 | +- Carol (team_user) |
| 95 | + |
| 96 | +**Timeline:** |
| 97 | + |
| 98 | +1. **Alice installs Box MCP Server** |
| 99 | + - Creates installation "Team Box Files" |
| 100 | + - Alice authorizes with her Box account |
| 101 | + - Alice sees: ✓ Connected |
| 102 | + |
| 103 | +2. **Bob logs in** |
| 104 | + - Sees installation "Team Box Files" |
| 105 | + - Status: ⚠ Auth Required |
| 106 | + - Clicks "Reconnect" |
| 107 | + - Authorizes with his Box account |
| 108 | + - Bob sees: ✓ Connected |
| 109 | + |
| 110 | +3. **Carol logs in** |
| 111 | + - Sees installation "Team Box Files" |
| 112 | + - Status: ⚠ Auth Required |
| 113 | + - Must authorize with her Box account |
| 114 | + - Carol sees: ✓ Connected |
| 115 | + |
| 116 | +**Data Access:** |
| 117 | +- Alice's requests → Alice's Box files |
| 118 | +- Bob's requests → Bob's Box files |
| 119 | +- Carol's requests → Carol's Box files |
| 120 | +- No cross-user data access |
| 121 | + |
| 122 | +### Scenario: User Switches Teams |
| 123 | + |
| 124 | +**Context:** Alice is in both "Engineering Team" and "Marketing Team" |
| 125 | + |
| 126 | +**What Happens:** |
| 127 | + |
| 128 | +1. **Engineering Team** installs Google Drive MCP |
| 129 | + - Alice authorizes with her Google account |
| 130 | + - Alice's tokens stored for Engineering Team |
| 131 | + |
| 132 | +2. **Marketing Team** also has Google Drive MCP |
| 133 | + - Alice must authorize again for Marketing Team |
| 134 | + - Separate tokens stored for Marketing Team context |
| 135 | + - Same Google account, different team = separate authorization |
| 136 | + |
| 137 | +**Why?** Tokens are stored per user + team + installation combination for security isolation. |
| 138 | + |
| 139 | +## Token Storage and Security |
| 140 | + |
| 141 | +### Encryption at Rest |
| 142 | + |
| 143 | +Your OAuth tokens are encrypted in the database using AES-256-GCM encryption: |
| 144 | +- Access tokens encrypted before storage |
| 145 | +- Refresh tokens encrypted before storage |
| 146 | +- Only decrypted when Satellite needs them at runtime |
| 147 | + |
| 148 | +For complete security details, see [Security and Privacy](/security). |
| 149 | + |
| 150 | +### Privacy Guarantees |
| 151 | + |
| 152 | +**Your tokens are private:** |
| 153 | +- Team admins cannot see your OAuth tokens |
| 154 | +- Other team members cannot see your OAuth tokens |
| 155 | +- Tokens are filtered by your user ID on every query |
| 156 | + |
| 157 | +**Your tokens are isolated:** |
| 158 | +- Each user has separate token records |
| 159 | +- Revoking your access doesn't affect other users |
| 160 | +- Your authorization status is independent |
| 161 | + |
| 162 | +### Runtime Token Injection |
| 163 | + |
| 164 | +When you use an OAuth MCP server: |
| 165 | + |
| 166 | +1. **Satellite receives your request** (with your user ID) |
| 167 | +2. **Satellite asks backend** for your tokens (filtered by user_id) |
| 168 | +3. **Backend decrypts** your tokens and returns them |
| 169 | +4. **Satellite injects tokens** into the MCP server process |
| 170 | +5. **MCP server uses your credentials** to access the service |
| 171 | + |
| 172 | +This happens automatically and transparently. |
| 173 | + |
| 174 | +## Token Refresh Process |
| 175 | + |
| 176 | +### Automatic Refresh |
| 177 | + |
| 178 | +A background job runs every few minutes: |
| 179 | +- Checks for tokens expiring soon (< 10 minutes remaining) |
| 180 | +- Uses the refresh_token to get new access_token |
| 181 | +- Updates stored tokens automatically |
| 182 | +- No user action required |
| 183 | + |
| 184 | +### When Refresh Fails |
| 185 | + |
| 186 | +If token refresh fails (revoked access, expired refresh token): |
| 187 | +- Your installation status changes to "⚠ Auth Required" |
| 188 | +- You see a prompt to re-authorize |
| 189 | +- Click "Reconnect" to start a new authorization flow |
| 190 | +- New tokens are stored after authorization |
| 191 | + |
| 192 | +## Identifying OAuth-Enabled Servers |
| 193 | + |
| 194 | +### In the MCP Catalog |
| 195 | + |
| 196 | +OAuth-enabled servers are marked with: |
| 197 | +- **"Requires OAuth" badge** in the server card |
| 198 | +- **OAuth indicator** in the server details |
| 199 | +- **Authorization notice** in the installation instructions |
| 200 | + |
| 201 | +### During Installation |
| 202 | + |
| 203 | +When installing an OAuth server: |
| 204 | +- Button text: "Install & Authorize" (not just "Install") |
| 205 | +- You'll be redirected to authorization immediately after installation |
| 206 | +- Installation won't be fully functional until authorized |
| 207 | + |
| 208 | +## Common Questions |
| 209 | + |
| 210 | +### Q: Can team admins authorize on behalf of users? |
| 211 | + |
| 212 | +**No.** Each user must authorize with their own account. Team admins cannot authorize for other users because OAuth tokens are tied to individual user accounts. |
| 213 | + |
| 214 | +### Q: What if I don't want to authorize? |
| 215 | + |
| 216 | +You won't be able to use that MCP server. The installation will show "Auth Required" and remain unusable until you authorize. |
| 217 | + |
| 218 | +### Q: Can I revoke access later? |
| 219 | + |
| 220 | +Yes. You can revoke DeployStack's access directly from the OAuth provider (Box, Google, etc.). DeployStack will show "Auth Required" status after revocation, and you can re-authorize anytime. |
| 221 | + |
| 222 | +### Q: Do I need to re-authorize if I leave and rejoin the team? |
| 223 | + |
| 224 | +Yes. When you leave a team, your tokens for that team are deleted. If you rejoin, you must authorize again. |
| 225 | + |
| 226 | +### Q: What happens if tokens expire while I'm using the server? |
| 227 | + |
| 228 | +The Satellite will detect expired tokens and return an error. You'll see "Auth Required" status and need to re-authorize. |
| 229 | + |
| 230 | +## Comparison with Other OAuth Types |
| 231 | + |
| 232 | +| Feature | GitHub OAuth | Satellite OAuth | MCP Server OAuth | |
| 233 | +|---------|-------------|-----------------|------------------| |
| 234 | +| **Purpose** | Login to DeployStack | Connect clients to Satellite | Access third-party services | |
| 235 | +| **Who authorizes** | Individual users | Team (via credentials) | Individual users | |
| 236 | +| **Frequency** | Once per login session | Per Satellite connection | Per MCP server | |
| 237 | +| **Storage** | Session cookies | Client configuration | Database (per-user) | |
| 238 | +| **Visibility** | User only | Team visible | User-private | |
| 239 | +| **Refresh** | Session-based | Client handles | Automatic background | |
| 240 | +| **Revocation** | Logout | Delete credentials | Revoke at provider | |
| 241 | + |
| 242 | +## Related Documentation |
| 243 | + |
| 244 | +For complete understanding of OAuth MCP servers in context: |
| 245 | + |
| 246 | +- [MCP Configuration System](/mcp-configuration) - Three-tier architecture (OAuth is separate) |
| 247 | +- [MCP Team Installation](/mcp-team-installation) - How team admins install OAuth servers |
| 248 | +- [MCP User Configuration](/mcp-user-configuration) - User settings and authorization |
| 249 | +- [MCP Catalog](/mcp-catalog) - Discovering OAuth-enabled servers |
| 250 | +- [Security and Privacy](/security) - Token encryption and storage security |
| 251 | + |
| 252 | +OAuth-enabled MCP servers provide secure, per-user access to external services while maintaining privacy and security through encrypted token storage and automatic token management. |
0 commit comments