Skip to content

Add ProcessDirectory option to InstallMCPServer #69

@rhennigan

Description

@rhennigan

Feature Request

Add a ProcessDirectory option to InstallMCPServer that allows specifying the working directory for the MCP server process.

Motivation

Currently, the Wolfram Language kernel running the MCP server does not inherit the working directory from the client (e.g., Claude Code). For example, when Claude Code is running in H:\Documents\MCPServer, the WL kernel reports its directory as the Anthropic Claude app installation directory instead.

This makes it inconvenient when working on projects, as file paths need to be absolute rather than relative to the project directory.

Proposed Implementation

  1. Add ProcessDirectory option to InstallMCPServer
  2. If provided, add environment variable MCP_SERVER_DIRECTORY to the MCP client configuration
  3. On server startup, if MCP_SERVER_DIRECTORY is set, call SetDirectory[Environment["MCP_SERVER_DIRECTORY"]] to set the working directory

Related

This would improve the developer experience when using the MCP server with Claude Code or other MCP clients that operate within a specific project directory.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions