From 72768cb4fd88912efa36b1687737289d04b68650 Mon Sep 17 00:00:00 2001 From: Sam Rolfe Date: Mon, 27 Apr 2026 12:49:34 +1000 Subject: [PATCH] Add Stitch MCP configuration using environment variables --- home/sam/home.nix | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/home/sam/home.nix b/home/sam/home.nix index 9f5d5c1..5a73685 100644 --- a/home/sam/home.nix +++ b/home/sam/home.nix @@ -238,19 +238,21 @@ dconf.settings."org/gnome/desktop/interface" = { programs.opencode = { enable = true; settings = { - mcpServers = { + mcp = { stitch = { - command = "npx"; - args = [ "-y" "@google/stitch-mcp-server" ]; - env = { - # This pulls the key from your shell environment - # instead of hardcoding it in the Nix file - STITCH_API_KEY = builtins.getEnv "STITCH_API_KEY"; + # Use "remote" type to leverage the Stitch API directly + type = "remote"; + url = "https://stitch.googleapis.com/mcp"; + # Use false if you are using an API Key instead of OAuth + oauth = false; + headers = { + # Nix grabs this from your local shell during 'switch --impure' + "X-Goog-Api-Key" = builtins.getEnv "STITCH_API_KEY"; }; }; }; }; - }; + }; # --- # Shell (zsh + oh-my-zsh + powerlevel10k)