How to Pass and Retrive env for authentication in MCP dotnet #176
-
Beta Was this translation helpful? Give feedback.
Answered by
rude-seagull
Apr 1, 2025
Replies: 1 comment 13 replies
-
Same issue, I tried this : await using IMcpClient mcpClient = await McpClientFactory.CreateAsync(
new()
{
Id = "github",
Name = "GitHub",
TransportType = "stdio",
Location = null,
TransportOptions = new()
{
["command"] = "npx",
["arguments"] = "-y @modelcontextprotocol/server-github",
["env"] = JsonSerializer.Serialize(new Dictionary<string, string>
{
["GITHUB_PERSONAL_ACCESS_TOKEN"] = ""
})
},
}, Without any luck |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could also try this (did not work for me but maybe this will do the trick for you)