Skip to main content

write_empty_mcp_config_tempfile

Function write_empty_mcp_config_tempfile 

Source
pub fn write_empty_mcp_config_tempfile() -> Result<PathBuf, Error>
Expand description

Writes an empty MCP config tempfile with {"mcpServers":{}} and returns the path. Callers should cmd.arg(path.as_os_str()) to substitute for the inline '{}' literal rejected by Claude Code 2.1.177.

Tempfile lives in the OS temp dir with a graphrag-mcp- prefix. Caller is responsible for keeping the path alive until the spawned process terminates; tempfile::NamedTempFile cleans up on Drop.