Add Stitch MCP configuration using environment variables

This commit is contained in:
2026-04-27 12:49:34 +10:00
parent 5697342a58
commit 72768cb4fd

View File

@@ -238,14 +238,16 @@ 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";
};
};
};