Skip to content

feat: add workspaceFolder variable expansion to MCP server#63

Merged
userFRM merged 1 commit intouserFRM:mainfrom
VooDisss:fix/add-workspacefolder-variable-expansion
Feb 27, 2026
Merged

feat: add workspaceFolder variable expansion to MCP server#63
userFRM merged 1 commit intouserFRM:mainfrom
VooDisss:fix/add-workspacefolder-variable-expansion

Conversation

@VooDisss
Copy link
Contributor

Description:
Allows rpg-mcp-server to be configured in global MCP configs by resolving ${workspaceFolder} to the current working directory at runtime. Handles both bare ${workspaceFolder} and ${workspaceFolder}/subpath patterns.

MCP Setup in opencode.jsonc

{
  "mcp": {
    "rpg": {
      "type": "local",
      "command": [
        "npx",
        "-y", 
        "-p",
        "rpg-encoder",
        "rpg-mcp-server",
        "${workspaceFolder}"
      ]
    }
  }
}

The ${workspaceFolder} is now resolved by the server at runtime, so users don't need hardcoded paths in their configs.

Testing

  • Manual verification: built RPG with 988 entities, 53 files, 2599 dependency edges
  • Server correctly resolves ${workspaceFolder} to the current working directory

@VooDisss VooDisss force-pushed the fix/add-workspacefolder-variable-expansion branch from e2aa70a to 0958eb1 Compare February 27, 2026 09:53
The server now defaults to current working directory when no path is
provided. MCP clients launch the server from the workspace directory,
so no explicit path configuration is needed.
@VooDisss VooDisss force-pushed the fix/add-workspacefolder-variable-expansion branch from 0958eb1 to ca119d8 Compare February 27, 2026 10:42
@VooDisss
Copy link
Contributor Author

I think that the README.md was misleading about the MCP setup and the logic that it falls back to if the path is omitted. @userFRM please check the changes and merge if you agree.

I have removed the initial changes done to the codebase, as it seems that it's the documentation issue.

@userFRM userFRM merged commit 7808c3c into userFRM:main Feb 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants