Skip to content

opencode config path on Windows uses %APPDATA% instead of ~/.config/opencode/ #535

@fucknoobhanzo

Description

@fucknoobhanzo

Describe the bug

On Windows, CodeGraph's opencode installer target writes config to %APPDATA%\opencode\ instead of ~/.config/opencode\. However, opencode uses ~/.config/opencode/ on all platforms including Windows, so the MCP config is never picked up.

This is a known issue affecting multiple projects — see:

To Reproduce

  1. Install CodeGraph globally on Windows
  2. Run codegraph init -i in a project
  3. Select opencode as a target
  4. Config is written to %APPDATA%\opencode\ (wrong location)
  5. OpenCode does not detect CodeGraph MCP server

Expected behavior

Config should be written to ~/.config/opencode/opencode.jsonc on all platforms including Windows.

Environment

  • OS: Windows
  • CodeGraph version: latest
  • OpenCode config path: C:\Users\<user>\.config\opencode\opencode.jsonc

Workaround

Manually create/edit ~/.config/opencode/opencode.jsonc:

{
  "mcp": {
    "codegraph": {
      "type": "local",
      "command": ["<path-to-codegraph-binary>", "serve", "--mcp"],
      "enabled": true
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions