Skip to contents

Create MCP Apps

Build and serve MCP Apps from UI components and tools.

mcp_app()
Create an MCP App
McpApp
MCP App
as_mcp_app()
Convert an object to an MCP App
as_mcp_apps()
Split a parsed Shiny app into chat-sized MCP App scaffolds
bindMcp()
Mark a Shiny UI element for MCP exposure
mcp_tool_module()
Create an MCP App from a Shiny module
serve()
Serve an MCP App
preview_app()
Preview an MCP App in a web browser

Shinychat and Hosting

Embed MCP Apps in Shiny and shinychat, and return typed rich results.

as_shinychat_tool()
Wrap an McpApp as an ellmer tool for shinychat
mcp_content_result()
Build a shinychat-friendly tool result with a live embedded card
mcp_embed()
Embed an MCP app inside a live Shiny session
mcp_host_server()
Host shell server for an embedded MCP app
mcp_host_ui()
Host shell UI for an embedded MCP app
mcp_result_html()
Build a typed HTML result
mcp_result_image()
Build a typed image result
mcp_result_pdf()
Build a typed PDF result
mcp_result_plot()
Build a typed plot result
mcp_result_table()
Build a typed table result
mcp_result_text()
Build a typed text result
mcp_result_widget()
Build a typed widget result

Input Components

Interactive inputs that mirror Shiny’s API. Values are sent to tools when the user interacts with them.

mcp_select()
Create an MCP select input
mcp_text_input()
Create an MCP text input
mcp_numeric_input()
Create an MCP numeric input
mcp_checkbox()
Create an MCP checkbox input
mcp_slider()
Create an MCP slider input
mcp_radio()
Create MCP radio button inputs
mcp_action_button()
Create an MCP action button
mcp_input()
Mark an element as an MCP input

Output Components

Placeholders populated by tool results. The JS bridge routes values to outputs based on matching IDs.

mcp_text()
Create an MCP text output
mcp_plot()
Create an MCP plot output
mcp_table()
Create an MCP table output
mcp_html()
Create an MCP HTML output
mcp_output()
Mark an element as an MCP output

Conversion Pipeline

Parse, analyze, and generate MCP Apps from existing Shiny apps.

convert_app()
Convert a Shiny app to an MCP App
parse_shiny_app()
Parse a Shiny app into intermediate representation
analyze_reactive_graph()
Analyze reactive graph from parsed Shiny app
generate_mcp_app()
Generate MCP App from analysis
print(<ReactiveAnalysis>)
Print method for ReactiveAnalysis
print(<ShinyAppIR>)
Print method for ShinyAppIR

Bridge Helpers

Internal helpers for the JS bridge configuration.

bridge_config_tag()
Bridge config tag
bridge_script_tag()
Bridge script tag

Package

shinymcp shinymcp-package
shinymcp: Convert Shiny Apps to MCP Apps