[Feature request] Handle prompts/list

Aperta
#59 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
38/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
r
Ambito
api

Direzione di ricerca

Inizia in R/server.R, in handle_message_from_client, e confronta il flusso prompts/list richiesto con la specifica MCP prompts e gli handler JSON-RPC esistenti. Determina la risposta prompt supportata per btw, quindi verifica che il server restituisca una risposta valida anziché -32601; nell'issue non è indicato alcun file di test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Thanks for this work, I'm grateful for it

Background

My AI IDE calls a prompts/list method when setting itself up as an MCP client.

When I try running btw_mcp_server under MCP, I'm thrown an Error listing offerings: MCP error -32601: Method not found. Config looks like:

    "r-btw-docs": {
      "command": "Rscript",
      "args": ["-e", "btw::btw_mcp_server()"],
      "cwd": "/..../path/to/relevant/renv",
      "env": {
        "MCPTOOLS_SERVER_LOG": "/path/to/logs/btw_server.log"
      }
    }

Looking at mcptools logs, I see FROM CLIENT: {"method":"prompts/list","jsonrpc":"2.0","id":2}, which doesn't seem implemented yet in handle_message_from_client.

prompts/list is included in MCP, as you'll see here

Expectation

I don't expect to get a -32601 when I use btw

Possible Solution

I'm happy to put in a PR but didn't want to assume this solution is acceptable. I've written a placeholder for my own use:

diff --git a/R/server.R b/R/server.R
index 5977e93..25bd786 100644
--- a/R/server.R
+++ b/R/server.R
@@ -174,6 +174,15 @@ handle_message_from_client <- function(line) {
       )
     )
 
+    cat_json(res)
+  } else if (data$method == "prompts/list") {
+    res <- jsonrpc_response(
+      data$id,
+      list(
+        prompts = list()
+      )
+    )
+
     cat_json(res)
   } else if (data$method == "tools/call") {
     tool_name <- data$params$name

However, I'm just using list() isn't very satisfying an implementation.

I'm happy to put in a PR for the above or work on something if you have a preference for how to handle prompts

Lingua principale
R
Stelle
207
Fork
24
Merge medio
36m
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di posit-dev/mcptools

Tutte le issue di posit-dev/mcptools

Issue simili

Altre issue su R

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.