Skip to content

Commit 59316fb

Browse files
committed
address greptile
1 parent 466f2d3 commit 59316fb

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

apps/sim/lib/mcp/resolve-config.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ export async function resolveMcpConfigEnvVars(
3535
const { strict = true } = options
3636
const allMissingVars: string[] = []
3737

38+
let envVars: Record<string, string> = {}
39+
try {
40+
envVars = await getEffectiveDecryptedEnv(userId, workspaceId)
41+
} catch (error) {
42+
logger.error('Failed to fetch environment variables for MCP config:', error)
43+
return { config, missingVars: [] }
44+
}
45+
3846
const resolveValue = (value: string): string => {
3947
const missingVars: string[] = []
4048
const resolved = resolveEnvVarReferences(value, envVars, {
@@ -44,14 +52,6 @@ export async function resolveMcpConfigEnvVars(
4452
return resolved
4553
}
4654

47-
let envVars: Record<string, string> = {}
48-
try {
49-
envVars = await getEffectiveDecryptedEnv(userId, workspaceId)
50-
} catch (error) {
51-
logger.error('Failed to fetch environment variables for MCP config:', error)
52-
return { config, missingVars: [] }
53-
}
54-
5555
const resolvedConfig = { ...config }
5656

5757
if (resolvedConfig.url) {

0 commit comments

Comments
 (0)