Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add ${workspaceFolder} Variable Expansion to MCP Server #62

@VooDisss

Description

@VooDisss

Description:
The rpg-mcp-server currently receives its project root as a CLI argument. When MCP clients (like Antigravity or opencode) pass ${workspaceFolder} without expanding it, the server receives the literal string and fails to find any source files.

This PR adds a resolve_project_root function that:

  • Detects ${workspaceFolder} in the CLI argument
  • Resolves it to std::env::current_dir() (the MCP client launches the server in the workspace directory)
  • Handles partial patterns like ${workspaceFolder}/subdir
  • Logs the resolution to stderr so users know what happened

This allows the rpg-mcp-server to be configured in global MCP configs rather than requiring per-project local configs with hardcoded paths.

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