{
  "$schema": "https://opencode.ai/config.json",

  "mcp": {
    // --- Locaux via stdio ---
    "filesystem": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "@modelcontextprotocol/server-filesystem",
        // Limite aux dossiers que tu veux exposer
        "/Users/humperdoo/Github"
      ]
    },
    "fetch": {
      "type": "local",
      "command": ["uvx", "mcp-server-fetch"]
    },

    "memory": {
      "type": "local",
      "command": ["npx", "-y", "@modelcontextprotocol/server-memory"]
    },

    "sequential-thinking": {
      "type": "local",
      "command": [
        "npx",
        "-y",
        "@modelcontextprotocol/server-sequential-thinking"
      ]
    },

    "time": {
      "type": "local",
      "command": ["uvx", "mcp-server-time"]
    },

    "gemini-bridge": {
      "type": "local",
      "command": ["uvx", "gemini-bridge"]
    },

    "next-devtools": {
      "type": "local",
      "command": ["npx", "-y", "next-devtools-mcp@latest"]
    },

    "lighthouse": {
      "type": "local",
      "command": ["npx", "@danielsogl/lighthouse-mcp@latest"]
    },

    // --- Remotes natifs OpenCode ---

    // Context7 : on suit la doc officielle OpenCode
    // (MCP remote + header contenant la clé API)
    "context7": {
      "type": "remote",
      "url": "https://mcp.context7.com/mcp",
      "headers": {
        "CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
      }
    },

    // GitHub MCP (Copilot)
    // On désactive OAuth auto et on passe le token en Bearer
    "github": {
      "type": "remote",
      "url": "https://api.githubcopilot.com/mcp",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:GITHUB_TOKEN}"
      }
    },
    "git": {
      "type": "local",
      "command": ["uvx", "mcp-server-git"]
    },
    // PostHog : on remplace le wrapper `mcp-remote`
    // par un remote MCP direct
    "posthog": {
      "type": "remote",
      "url": "https://mcp.posthog.com/sse",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:POSTHOG_API_KEY}"
      }
    }
  }
}
