Support async tool handlers (promises)

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Quiet
Tech stack
r
Domain
api, backend

Research direction

Start by tracing execute_tool_call() through the HTTP transport and its httpuv call. Read how tool results become JSON-RPC responses, then inspect the {promises} behavior described in the issue. Done means a promise returned by a tool handler can defer the JSON-RPC response while synchronous handlers continue to work.

Written by the indexing model from the issue text.

Description

execute_tool_call() is synchronous and the HTTP transport returns plain lists from the httpuv call. Tools that need to wait (long-poll patterns, external requests via {promises}) can't be expressed.

httpuv already supports returning a promise from call; if a tool handler returns a promise, mcptools could chain the JSON-RPC response onto it. Shiny's MCP tunnel depends on this (a receive tool holds its response until the app has messages to flush).

Part of #115.

Dominant language
R
Stars
207
Forks
24
Avg merge
36m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from posit-dev/mcptools

All issues in posit-dev/mcptools

Similar issues

More R issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.