Title: Question: How to pass environment variable from MCP client to MCP server (sse_client) · Issue #442 · modelcontextprotocol/python-sdk · GitHub
Open Graph Title: Question: How to pass environment variable from MCP client to MCP server (sse_client) · Issue #442 · modelcontextprotocol/python-sdk
X Title: Question: How to pass environment variable from MCP client to MCP server (sse_client) · Issue #442 · modelcontextprotocol/python-sdk
Description: For stdio_client I have seen an option python-sdk/src/mcp/client/stdio/__init__.py Line 116 in c2ca8e0 env=( but not for sse_client Is there any way to send some environment variables from mcp-client to mcp-server that can change the beh...
Open Graph Description: For stdio_client I have seen an option python-sdk/src/mcp/client/stdio/__init__.py Line 116 in c2ca8e0 env=( but not for sse_client Is there any way to send some environment variables from mcp-clie...
X Description: For stdio_client I have seen an option python-sdk/src/mcp/client/stdio/__init__.py Line 116 in c2ca8e0 env=( but not for sse_client Is there any way to send some environment variables from mcp-clie...
Opengraph URL: https://github.com/modelcontextprotocol/python-sdk/issues/442
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Question: How to pass environment variable from MCP client to MCP server (sse_client)","articleBody":"For stdio_client I have seen an option https://github.com/modelcontextprotocol/python-sdk/blob/c2ca8e03e046908935d089a2ceed4e80b0c29a24/src/mcp/client/stdio/__init__.py#L116 but not for sse_client\nIs there any way to send some environment variables from `mcp-client` to `mcp-server` that can change the behaviour of `mcp server` depending up on the env.","author":{"url":"https://github.com/injusticescorpio","@type":"Person","name":"injusticescorpio"},"datePublished":"2025-04-07T07:45:01.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/442/python-sdk/issues/442"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d1b0d98-1db3-21e9-f8d1-437835206b82 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A0E4:2C1EC0:FBC7D8:1686B8D:6A5A0F09 |
| html-safe-nonce | cdcac295b49f0bd734feae66e94e75aa4e69c0ed0bd5c880fc87e9bdf4c2eaaa |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMEU0OjJDMUVDMDpGQkM3RDg6MTY4NkI4RDo2QTVBMEYwOSIsInZpc2l0b3JfaWQiOiIxMDE2NzE5ODI5OTE3ODk2NDU3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 792c20d28ac3664d91f476b0d19e42192d1f23eac2fbef5dc0930f499021cba1 |
| hovercard-subject-tag | issue:2975931708 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/modelcontextprotocol/python-sdk/442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/661fd72efffe3eb33b1b86ee0959354c686043ac144c3cccae94cc42f4c20657/modelcontextprotocol/python-sdk/issues/442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/661fd72efffe3eb33b1b86ee0959354c686043ac144c3cccae94cc42f4c20657/modelcontextprotocol/python-sdk/issues/442 |
| og:image:alt | For stdio_client I have seen an option python-sdk/src/mcp/client/stdio/__init__.py Line 116 in c2ca8e0 env=( but not for sse_client Is there any way to send some environment variables from mcp-clie... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | injusticescorpio |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8c2fe7351e4e987cb8f75e2425a0b895d807779bc4c2d3c312be0a54082219f7 |
| turbo-cache-control | no-preview |
| go-import | github.com/modelcontextprotocol/python-sdk git https://github.com/modelcontextprotocol/python-sdk.git |
| octolytics-dimension-user_id | 182288589 |
| octolytics-dimension-user_login | modelcontextprotocol |
| octolytics-dimension-repository_id | 862584018 |
| octolytics-dimension-repository_nwo | modelcontextprotocol/python-sdk |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 862584018 |
| octolytics-dimension-repository_network_root_nwo | modelcontextprotocol/python-sdk |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 501ec24a694e4933bb3d70e768b1461c0def57a2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width