Skip to content

Commit

Permalink
fix: env not work
Browse files Browse the repository at this point in the history
  • Loading branch information
Kadxy committed Jan 15, 2025
1 parent c89e488 commit e440ff5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/mcp/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ export async function createClient(
const transport = new StdioClientTransport({
command: config.command,
args: config.args,
env: config.env,
env: {
...Object.fromEntries(
Object.entries(process.env)
.filter(([_, v]) => v !== undefined)
.map(([k, v]) => [k, v as string]),
),
...(config.env || {}),
},
});

const client = new Client(
Expand Down

0 comments on commit e440ff5

Please sign in to comment.