Skip to content

feat: add optional working_dir to MCP and LSP toolset configs #2459

@simonferquel-clanker

Description

@simonferquel-clanker

Summary

MCP and LSP toolsets should support an optional working_dir field so they can be launched from a directory other than the agent's working directory.

Motivation

Some language servers (e.g. gopls) must be started from the Go module root. If the module lives in a subdirectory (e.g. ./backend), running the server from the repo root can cause resolution issues. Today there is no way to configure this.

Proposed config syntax

toolsets:
  - type: LSP
    command: gopls
    working_dir: ./backend

  - type: MCP
    command: my-mcp-server
    working_dir: ./tools/mcp

working_dir should be:

  • Optional (defaults to the agent's working directory when omitted)
  • Resolved relative to the agent's working directory if it is a relative path

Acceptance criteria

  • working_dir field parsed from YAML/config for both MCP and LSP toolset types
  • The toolset process is started with that directory as its CWD
  • Relative paths are resolved relative to the agent's working directory
  • Existing behaviour unchanged when working_dir is omitted
  • Tests updated / added

Metadata

Metadata

Assignees

No one assigned

    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