
jameshwade/shinymcp
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
Shiny Apps를 MCP 앱으로 변환
개요
MCP Apps로 라이브 샤이 워크플로우를 켭니다. 빛나는 인터페이스와 R computations를 MCP 앱으로 변환합니다. 대화 클라이언트, 빛나는 호스트 및 빛나는 채팅 대화에서 실행할 수있는 대화 형 카드. 시작된 사용 사례 빛나는chat 사용 ui:// 리소스 Declare HTML 앱 표면 MCP 호스트. postMessage bridge 입력, 도구 호출 및 동기화 된 결과를 유지. 빛나는 호스팅 엠베드 MCP 앱을 풀 스크린 캡블 빛나는 카드. Shiny 또는 bslib 입력을 사용하여 MCP 출력 대상을 추가하고 R 도구에 바인딩하십시오. Flatten reactive groups as tool function while keep the user-facing 워크플로우.
개요(AI 번역)
빛나는 MCP 구축 R. An MCP 앱 앱은 페이지가있는 도구입니다. MCP Apps를 지원하는 채팅 클라이언트 Claude, ChatGPT 또는 VS Code와 같은 확장은 페이지에 표시됩니다. 대화, 사람과 함께 일할 수 있습니다. 빛나는 도구는 R 기능과 페이지는 빛나는 UI입니다. 모델은 호출 할 수 있습니다 자신의 도구, 어떤 MCP 클라이언트에서, 페이지는 같은 도구를 호출 사람으로 그것을 사용합니다.
설치
도구에서 앱
이름은 2개의 halves를 연결합니다. 도구의 인수 bins 는 값이 걸립니다.
id와 입력에서, 그리고 목록은 출력을 채우다
histogram 과 [T2]]. 사람이 슬라이더를 이동할 때, 페이지
다시 도구 호출.
모델은 동일한 도구를 호출하고, 그것이 반환하는 것을 읽습니다, 여부 또는 아니 그것의 클라이언트는 페이지를 보여줄 수 있습니다:
도형도 이미지로 도달합니다. 각 결과는 3가지의 방법 분할됩니다: 텍스트 및 컴팩트 한 구조화 된 데이터 모델, 그리고 페이지가 그립니다. (HTML, 이미지, 위젯 데이터), 클라이언트가 페이지에 전달하고 유지 모델에서. 결과 텍스트, 테이블, 플로트, 이미지, HTML 및 한국어
preview_app(app) 브라우저에서 앱을 엽니다. 채팅 클라이언트
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
원문 README의 일부입니다. 원문 보기.
shinymcp
shinymcp builds MCP Apps in R. An MCP App is a tool with a page: a chat client that supports the MCP Apps extension, such as Claude, ChatGPT, or VS Code, shows the page in the conversation, and the person can keep working with it. In shinymcp the tools are R functions and the page is Shiny UI. The model can call the tools on their own, in any MCP client, and the page calls the same tools as the person uses it.
Installation
# install.packages("pak")
pak::pak("JamesHWade/shinymcp")
An app from a tool
library(shiny)
library(shinymcp)
faithful_histogram <- ellmer::tool(
function(bins = 20) {
list(
histogram = mcp_result_plot(
function() hist(faithful$waiting, breaks = bins, main = NULL, xlab = "Minutes"),
text = "Histogram of waiting times between eruptions."
),
caption = sprintf("%d eruptions; median wait %d minutes.", nrow(faithful), median(faithful$waiting))
)
},
name = "faithful_histogram",
description = "Show a histogram of waiting times between Old Faithful eruptions.",
arguments = list(
bins = ellmer::type_integer("Number of bins, 5 to 50.", required = FALSE)
),
annotations = ellmer::tool_annotations(read_only_hint = TRUE)
)
app <- mcp_app(
ui = fluidPage(
sliderInput("bins", "Number of bins", min = 5, max = 50, value = 20),
plotOutput("histogram"),
textOutput("caption")
),
tools = list(faithful_histogram),
name = "faithful"
)
Names connect the two halves. The tool’s argument bins takes its value
from the input with that id, and the list it returns fills the outputs
histogram and caption. When the person moves the slider, the page
calls the tool again.
The model calls the same tool, and reads what it returns, whether or not its client can show the page:
result <- app$run_tool("faithful_histogram", list(bins = 30))
cat(result$content[[1]]$text)
#> histogram: Histogram of waiting times between eruptions.
#>
#> caption: 272 eruptions; median wait 76 minutes.
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →설정
{
"mcpServers": {
"faithful": {
"command": "Rscript",
"args": ["/path/to/app.R"]
}
}
}