Skip to content

Commit 5f72e96

Browse files
author
Lasim
committed
docs: Update database management and backend documentation; clarify OAuth server requirements and user credential management
1 parent 94d722f commit 5f72e96

7 files changed

Lines changed: 438 additions & 78 deletions

File tree

development/backend/database/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ turso db shell your-database
498498

499499
The environment-based architecture makes it easy to add support for additional databases:
500500

501-
- **PostgreSQL**: Planned for future release
501+
- **PostgreSQL**: Possible future addition
502502
- **MySQL**: Possible future addition
503503
- **Other SQLite-compatible databases**: Can be added with minimal changes
504504

development/backend/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The DeployStack backend is a modern, high-performance Node.js application built
1313

1414
- **Framework**: Fastify for high-performance HTTP server
1515
- **Language**: TypeScript for type safety
16-
- **Database**: SQLite (default) or PostgreSQL with Drizzle ORM
16+
- **Database**: SQLite with Drizzle ORM
1717
- **Validation**: JSON Schema for request/response validation and OpenAPI generation
1818
- **Plugin System**: Extensible architecture with security isolation
1919
- **Authentication**: Dual authentication system - cookie-based sessions for frontend and OAuth 2.1 for satellite access
@@ -44,7 +44,7 @@ The development server starts at `http://localhost:3000` with API documentation
4444
href="/development/backend/database/index"
4545
title="Database Management"
4646
>
47-
SQLite and PostgreSQL setup, schema management, migrations, and Drizzle ORM best practices.
47+
SQLite setup, schema management, migrations, and Drizzle ORM best practices.
4848
</Card>
4949

5050
<Card
@@ -162,7 +162,7 @@ services/backend/
162162
- **Type Safety**: Request/response validation with TypeScript
163163

164164
### Database Management
165-
- **Multi-Database Support**: SQLite (default) and PostgreSQL
165+
- **Multi-Database Support**: SQLite
166166
- **Type-Safe ORM**: Drizzle ORM with full TypeScript integration
167167
- **Migration System**: Automatic schema management
168168
- **Plugin Extensions**: Plugins can add their own tables

general/mcp-catalog.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ Each server in the catalog includes comprehensive metadata:
142142
- **Tags**: Searchable keywords and labels
143143
- **Status**: Active, deprecated, or maintenance mode
144144
- **Sync Status**: Whether server is synced from official registry
145+
- **OAuth Requirement**: Whether server requires OAuth authorization (see [OAuth-Enabled MCP Servers](/mcp-oauth))
145146

146147
#### Technical Specifications
147148
- **Language**: Programming language (TypeScript, Python, etc.)

general/mcp-configuration.mdx

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ The system separates configuration into three distinct layers:
1414
2. **Team Level** - Shared team configurations with lock/unlock controls
1515
3. **User Level** - Personal configurations within team-defined boundaries
1616

17-
This architecture enables teams to share common settings like API keys while allowing individual members to customize personal settings like local file paths while maintaining team security and standards.
17+
This architecture enables teams to share common settings like API keys while allowing individual members to use their own private credentials or customize personal settings like local file paths - all within the same team installation, maintaining both team collaboration and individual privacy.
18+
19+
**Note on OAuth-Enabled MCP Servers:** Some MCP servers require OAuth authorization, which happens at the user level—separate from this three-tier configuration system. Each user must authorize individually with their own account. For details, see [OAuth-Enabled MCP Servers](/mcp-oauth).
1820

1921
## How It Works
2022

@@ -42,9 +44,9 @@ This architecture enables teams to share common settings like API keys while all
4244
┌─────────────────────────────────────────────────────────────────────────────────┐
4345
│ TIER 3: USER (Individual) │
4446
│ ┌─────────────────────────────────────────────────────────────────────────────┐ │
45-
│ │ 🔓 Personal Settings: Local paths, preferences │ │
46-
│ │ 🔗 Automatic Inheritance: Use team credentials seamlessly │ │
47-
│ │ 🛡️ Team Security: Access controlled through team OAuth tokens │ │
47+
│ │ 🔓 Personal Settings: Private credentials, local paths, preferences │ │
48+
│ │ 🔗 Automatic Inheritance: Use team credentials OR your own private ones │ │
49+
│ │ 🛡️ Privacy: Your credentials are NOT shared with other team members │ │
4850
│ └─────────────────────────────────────────────────────────────────────────────┘ │
4951
└─────────────────────────────────────────────────────────────────────────────────┘
5052
@@ -67,17 +69,20 @@ The heart of the system is sophisticated lock/unlock controls with precise categ
6769
- **Validation Rules** - Set data types, constraints, and security requirements for configurable elements
6870
- **Precise Schema Definition** - Create detailed schemas that control the exact configuration experience
6971

70-
**Team Administrator Controls:**
72+
**Team Administrator Controls (`team_admin` role only):**
73+
- **Install MCP Servers** - Only `team_admin` can install MCP servers to teams (not `team_user`)
7174
- **Configure Team Settings** - Set shared credentials and parameters within schema boundaries
7275
- **Control User Access** - Lock/unlock elements for team members based on organizational needs
7376
- **Manage Team Credentials** - Securely handle team-wide secrets with appropriate visibility controls
7477
- **Work Within Schema Boundaries** - Configure only elements designated as "Team Configurable" by global admins
7578

79+
**Important:** Users with `team_user` role cannot install MCP servers, view team credentials, or modify team settings. They can only configure their own personal user-level settings.
80+
7681
**User Access:**
82+
- **Private Credentials** - Configure personal API keys and secrets that are NOT shared with other team members
7783
- **Personal Customization** - Modify only unlocked elements within boundaries set by global admin categorization
78-
- **Secure Experience** - No access to locked configuration, team secrets, or template elements
84+
- **Credential Privacy** - Your user-level credentials remain private and isolated from other team members
7985
- **Focused Interface** - See only configuration elements designated as personally configurable
80-
- **Team Integration** - Access through OAuth team authentication
8186

8287
## User Journey Workflows
8388

@@ -88,16 +93,20 @@ Each tier has its own focused workflow:
8893

8994
Key workflow: Repository → Claude Desktop Config → **Configuration Schema Categorization** → Basic Info → Catalog Entry
9095

91-
### For Team Administrators
96+
### For Team Administrators (`team_admin` role)
9297
**[Team Installation](/mcp-team-installation)** - Learn how to install MCP servers from the catalog, configure shared team settings, and control user access.
9398

9499
Key workflow: Browse Catalog → Configure Team Settings → Set Lock Controls → Deploy Installation
95100

96-
### For Individual Users
101+
**Note:** Only users with `team_admin` role can perform team installations. Users with `team_user` role skip this step and go directly to user configuration.
102+
103+
### For Individual Users (both `team_admin` and `team_user` roles)
97104
**[User Configuration](/mcp-user-configuration)** - Learn how to configure personal MCP settings and customize your workflow.
98105

99106
Key workflow: Access Team Installation → Configure Personal Settings → Save Configuration
100107

108+
**Note:** Both `team_admin` and `team_user` roles configure personal settings the same way. The difference is that only `team_admin` can install the MCP server to the team in the first place.
109+
101110
## Official Registry Configuration Mapping
102111

103112
When MCP servers are synced from the official MCP Registry, their environment variables are automatically mapped to the appropriate tier based on their properties:
@@ -201,17 +210,21 @@ This automatic mapping enables synced servers from the official registry to work
201210

202211
**Flexibility:** Support for variable-length configurations and individual customization
203212

204-
**Collaboration:** Teams coordinate through shared settings while maintaining individual customization
213+
**Collaboration:** Teams coordinate through shared settings while maintaining individual customization and credential privacy
205214

206215
**Governance:** Clear boundaries and audit trails for organizational compliance, with precise control over configuration inheritance
207216

208217
## Common Use Cases
209218

210-
**Development Teams:** Share Git tokens and project settings while allowing personal directory configurations
219+
**Development Teams:** Share org-wide Git tokens and project settings while team members can use their personal GitHub tokens for individual rate limits
220+
221+
**Data Science Teams:** Share production database credentials at team level while data scientists use personal API keys for external services
222+
223+
**Support Teams:** Share customer service API keys at team level while support agents use personal OAuth tokens for individual accountability
211224

212-
**Data Science Teams:** Share database credentials and data lake access while supporting individual analysis workflows
225+
**Rate Limit Management:** Team shares basic API access while individual users configure personal premium API keys for higher rate limits
213226

214-
**Support Teams:** Share customer service API keys while allowing personal workspace customization
227+
**Multi-Account Access:** Team accesses shared resources while users maintain separate credentials for personal accounts or dev environments
215228

216229
## Official Registry Transport Types
217230

general/mcp-oauth.mdx

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
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

Comments
 (0)