Skip to content

more informative error when processes error in mcp_tools() #82

@simonpcouch

Description

@simonpcouch
library(mcptools)

config <- list(
  mcpServers = list(
    "test" = list(
      command = "uv",
      args = c(
        "run",
        "boop"
      )
    )
  )
)

tmpfile <- withr::local_tempfile(fileext = ".json")
jsonlite::write_json(config, tmpfile, auto_unbox = TRUE)

mcp_tools(tmpfile)
#> Error in "process_write_input(self, private, str, sep)": ! Native call to `processx_connection_write_bytes` failed
#> Caused by error in `chain_call(c_processx_connection_write_bytes, con, str)`:
#> ! Cannot write connection (system error 32, Broken pipe) @processx-connection.c:996 (processx_c_connection_write_bytes)

Created on 2025-10-22 with reprex v2.1.1

I wonder if we can surface the actual error raised by the program:

simoncouch@simoncouch-X7FT mcptools % uv run boop
error: Failed to spawn: `boop`
  Caused by: No such file or directory (os error 2)

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