Skip to content

What's the proper way to pass current working directory to the global opencode.json config? #3395

Closed

Description

@sheldonhull

Question

    "mcp-gopls": {
      "type": "local",
      "command": [
        "mcp-gopls",
        "-workspace",
        "."
      ]
    },

Is this correct way to reference the current location I opened opencode from?
Didn't work for filesystem mcp, and not sure if I should use $(PWD) or some other type of approach. The docs don't mention how to use this.

I think it worked with ".", but it worked through a few errors initially so can't tell if that's opencode fixing the calls since initially it started with /tmp/ as the path it was examining, then /usr/local/go/src/fmt/print.go for some reason, then finally listed document symbols in the actual project.

Activity

  1. github-actions commented on Oct 23, 2025

    @github-actions
    Contributor

    This issue might be a duplicate or related to existing issues. Please check:

    Feel free to ignore if none of these address your specific case about passing the current working directory to opencode.json.

  2. sheldonhull commented on Oct 23, 2025

    @sheldonhull
    Author

    Partial match with mcp command and relative path, but this is just more focused on how do I use my global config in a local repo properly with a path not hard coded but just where I am working. Not sure if that consistents the same scope as the other.

  3. self-assigned this
    on Oct 23, 2025
  4. rekram1-node commented on Oct 23, 2025

    @rekram1-node
    Collaborator

    Custom lsp servers will spawn in the cwd of wherever you are running opencode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions