[GH-ISSUE #50] How to pass the variable env into the MCP command #18

Closed
opened 2026-10-18 21:10:19 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @jxbwhe on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/50

Hello, how can I pass in the corresponding key through a command for something like this with env

{ "mcpServers": { "baidu-maps": { "command": "uvx", "args": [ "mcp-server-baidu-maps" ], "env": { "BAIDU_MAPS_API_KEY": "xxx" } } } }

Is that so?

uvx mcpo --port 8000 -- uvx mcp-server-baidu-maps --BAIDU_MAPS_API_KEY=xxxx
Originally created by @jxbwhe on GitHub (Apr 3, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/50 Hello, how can I pass in the corresponding key through a command for something like this with env `{ "mcpServers": { "baidu-maps": { "command": "uvx", "args": [ "mcp-server-baidu-maps" ], "env": { "BAIDU_MAPS_API_KEY": "xxx" } } } }` Is that so? ```shell uvx mcpo --port 8000 -- uvx mcp-server-baidu-maps --BAIDU_MAPS_API_KEY=xxxx ```
Author
Owner

@TKraski commented on GitHub (Apr 3, 2025):

If I understand the implementation correctly, then the defined env variables should actually be forwarded. But that doesn't seem to happen for me? maybe it's a bug?

<!-- gh-comment-id:2780579480 --> @TKraski commented on GitHub (Apr 3, 2025): If I understand the implementation correctly, then the defined env variables should actually be forwarded. But that doesn't seem to happen for me? maybe it's a bug?
Author
Owner

@TKraski commented on GitHub (Apr 3, 2025):

you can use the --config parameter and add the environment variables to the claude json config.
This works like a charm

<!-- gh-comment-id:2780579482 --> @TKraski commented on GitHub (Apr 3, 2025): you can use the --config parameter and add the environment variables to the claude json config. This works like a charm
Author
Owner

@louisLiu1004 commented on GitHub (Apr 4, 2025):

you can use

uvx mcpo -- env TAVILY_API_KEY=you-api-key uv --directory ./servers/mcp-server-tavily run tavily-search

<!-- gh-comment-id:2780579484 --> @louisLiu1004 commented on GitHub (Apr 4, 2025): you can use uvx mcpo -- env TAVILY_API_KEY=you-api-key uv --directory ./servers/mcp-server-tavily run tavily-search
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#18
No description provided.