posit-dev / posit-dev/mcptools

Non-blocking stdio serving (coexist with an event loop)

Open
#120 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
196
Forks
21
Avg merge
1h 14m
Merged PRs (30d)
1

Description

The stdio transport blocks the process in nanonext::wait(cv), so a server that also needs to run a {later}/httpuv event loop (e.g. a live Shiny app speaking MCP over stdio to Claude Desktop) can't use it.

Shiny's dependency-free workaround: file(\"stdin\", blocking = FALSE) polled from a later::later() loop (Unix only; see R/mcp-stdio.R on the shiny branch). nanonext's read_stdin() could support the same pattern if exposed as a pollable/aio rather than a blocking loop.

Part of #115.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Shiny branch's R/mcp-stdio.R workaround and the current nanonext::wait(cv) path described in the issue. Then inspect how nanonext::read_stdin() could be exposed for polling or asynchronous use. Done means stdio serving can coexist with a later/httpuv event loop, such as a live Shiny app, without blocking the process.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.