mirror of
https://github.com/httprunner/httprunner.git
synced 2026-08-28 19:47:14 +08:00
feat: integrate MCP tools with UI actions and improve environment variable inheritance
This commit is contained in:
+5
-1
@@ -110,10 +110,14 @@ func (h *MCPHost) connectToServer(ctx context.Context, serverName string, config
|
||||
mcpClient, err = client.NewSSEMCPClient(cfg.Url,
|
||||
client.WithHeaders(parseHeaders(cfg.Headers)))
|
||||
case STDIOServerConfig:
|
||||
env := make([]string, 0, len(cfg.Env))
|
||||
// Start with current process environment variables
|
||||
env := os.Environ()
|
||||
|
||||
// Add or override with config-specific environment variables
|
||||
for k, v := range cfg.Env {
|
||||
env = append(env, fmt.Sprintf("%s=%s", k, v))
|
||||
}
|
||||
|
||||
mcpClient, err = client.NewStdioMCPClient(cfg.Command, env, cfg.Args...)
|
||||
if stdioClient, ok := mcpClient.(*client.Client); ok {
|
||||
stderr, _ := client.GetStderr(stdioClient)
|
||||
|
||||
Reference in New Issue
Block a user