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
- Add
ProcessDirectory option to InstallMCPServer
- If provided, add environment variable
MCP_SERVER_DIRECTORY to the MCP client configuration
- 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.
Feature Request
Add a
ProcessDirectoryoption toInstallMCPServerthat 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
ProcessDirectoryoption toInstallMCPServerMCP_SERVER_DIRECTORYto the MCP client configurationMCP_SERVER_DIRECTORYis set, callSetDirectory[Environment["MCP_SERVER_DIRECTORY"]]to set the working directoryRelated
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.