Skip to content

Commit 79b90ce

Browse files
committed
feat(satellite): add instance path and token hash to MCP server config
1 parent c755887 commit 79b90ce

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

services/backend/src/routes/satellites/config.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ const CONFIG_RESPONSE_SCHEMA = {
5858
},
5959
git_commit_sha: { type: 'string', description: 'Git commit SHA for GitHub deployments (used to reconstruct args dynamically)' },
6060
repository_url: { type: 'string', description: 'GitHub repository URL for GitHub deployments' },
61-
git_branch: { type: 'string', description: 'Git branch name for GitHub deployments' }
61+
git_branch: { type: 'string', description: 'Git branch name for GitHub deployments' },
62+
instance_path: { type: 'string', description: 'Memorable path slug for direct instance access (e.g., bold-penguin-42a3)' },
63+
instance_token_hash: { type: 'string', description: 'Argon2 hash of the instance access token for token verification' }
6264
},
6365
required: ['installation_id', 'team_id', 'server_name', 'transport_type', 'enabled']
6466
},
@@ -167,6 +169,8 @@ interface McpServerConfig {
167169
user_id: string;
168170
user_slug: string;
169171
instance_status?: string; // Instance status from mcpServerInstances
172+
instance_path?: string; // Path-based routing identifier
173+
instance_token_hash?: string; // Hash of instance token (not raw token)
170174
// OAuth support for HTTP/SSE MCP servers
171175
requires_oauth?: boolean;
172176
// Server source (for GitHub detection)
@@ -437,6 +441,8 @@ export default async function satelliteConfigRoute(server: FastifyInstance) {
437441
// Declare instance variables before try block so they're accessible in catch block
438442
let instanceId: string | undefined;
439443
let instanceStatus: string | undefined;
444+
let instancePath: string | undefined;
445+
let instanceTokenHash: string | undefined;
440446

441447
try {
442448
// Create unique per-user process identifier: {server_slug}-{team_slug}-{user_id}-{installation_id}
@@ -708,7 +714,9 @@ export default async function satelliteConfigRoute(server: FastifyInstance) {
708714
const instances = await db
709715
.select({
710716
id: mcpServerInstances.id,
711-
status: mcpServerInstances.status
717+
status: mcpServerInstances.status,
718+
instance_path: mcpServerInstances.instance_path,
719+
instance_token: mcpServerInstances.instance_token
712720
})
713721
.from(mcpServerInstances)
714722
.where(
@@ -721,6 +729,8 @@ export default async function satelliteConfigRoute(server: FastifyInstance) {
721729

722730
instanceId = instances[0]?.id;
723731
instanceStatus = instances[0]?.status;
732+
instancePath = instances[0]?.instance_path || undefined;
733+
instanceTokenHash = instances[0]?.instance_token || undefined;
724734
} catch (error) {
725735
request.log.warn({
726736
serverId: server.id,
@@ -756,6 +766,8 @@ export default async function satelliteConfigRoute(server: FastifyInstance) {
756766
user_id: member.id,
757767
user_slug: member.id,
758768
instance_status: instanceStatus,
769+
instance_path: instancePath,
770+
instance_token_hash: instanceTokenHash,
759771
// OAuth support for HTTP/SSE MCP servers
760772
requires_oauth: server.requires_oauth || false,
761773
// Source (for GitHub detection)
@@ -1094,6 +1106,8 @@ export default async function satelliteConfigRoute(server: FastifyInstance) {
10941106
user_id: member.id,
10951107
user_slug: member.id,
10961108
instance_status: instanceStatus,
1109+
instance_path: instancePath,
1110+
instance_token_hash: instanceTokenHash,
10971111
enabled: false, // Disabled due to processing error
10981112
requires_oauth: server.requires_oauth || false,
10991113
source: server.source as 'manual' | 'github' | 'official_registry' | null,

services/satellite/src/process/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { ChildProcess } from 'child_process';
66
export interface MCPServerConfig {
77
installation_id: string; // Database ID from backend
88
instance_id?: string; // Instance ID from mcpServerInstances table (per-user instance)
9+
instance_path?: string; // Path-based routing identifier
10+
instance_token_hash?: string; // Hash of instance token
911
installation_name: string; // e.g., "context7-john-user123-R36no6FGoMFEZO9nWJJLT" (includes user_id)
1012
team_id: string; // Team UUID
1113
team_slug: string; // Team slug for identification

services/satellite/src/services/command-polling-service.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,12 @@ export interface McpServerConfig {
7373
/** Instance status from mcpServerInstances table */
7474
instance_status?: string;
7575

76+
/** Path-based routing identifier */
77+
instance_path?: string;
78+
79+
/** Hash of instance token (not raw token) */
80+
instance_token_hash?: string;
81+
7682
/** Installation settings */
7783
settings?: {
7884
request_logging_enabled?: boolean;

services/satellite/src/types/mcp-server.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,12 @@ export interface McpServerConfig {
7070
/** Instance status from mcpServerInstances table */
7171
instance_status?: string;
7272

73+
/** Path-based routing identifier */
74+
instance_path?: string;
75+
76+
/** Hash of instance token (not raw token) */
77+
instance_token_hash?: string;
78+
7379
/** Whether OAuth is required for this server */
7480
requires_oauth?: boolean;
7581

0 commit comments

Comments
 (0)