hydroxy

Assistant MCP

Manage the tool servers an assistant can use. Built-in connectors and custom servers sit in two lists, each row connecting on request and listing its tools; custom servers are added from an inline form. A separate card lets a server ask the person for input.

Connectors

  • GitHubRead repositories, pull requests and issues.Not connected
  • LinearSearch and update issues in your workspace.Not connected
  • FilesystemRead files from a folder you choose.Not connected

Custom servers

  • Team noteshttps://notes.acme.dev/mcpNot connected

Linear needs a few details

To file the issue, Linear asks which repository it belongs to.

Repository
Branch
Keep the issue private

Usage

use std::{collections::HashMap, time::Duration};

use hydroxy_leptos::assistant_mcp::{AssistantMcpElicitation, AssistantMcpManager, ElicitField, McpServerInfo};
use leptos::prelude::*;

fn tools_for(id: &str) -> Vec<String> {
    let names: &[&str] = match id {
        "github" => &["search_repositories", "get_pull_request", "create_issue", "list_commits"],
        "linear" => &["search_issues", "create_issue", "update_issue"],
        "filesystem" => &["read_file", "list_directory"],
        _ => &["list_items", "get_item", "search"],
    };
    names.iter().map(|n| (*n).to_string()).collect()
}

pub fn demo() -> AnyView {
    let (servers, set_servers) = signal(vec![
        McpServerInfo::connector("github", "GitHub", "Read repositories, pull requests and issues."),
        McpServerInfo::connector("linear", "Linear", "Search and update issues in your workspace."),
        McpServerInfo::connector("filesystem", "Filesystem", "Read files from a folder you choose."),
        McpServerInfo::custom("notes", "Team notes", "https://notes.acme.dev/mcp"),
    ]);
    let outcomes = RwSignal::new(HashMap::<String, Result<Vec<String>, String>>::new());
    let (add_result, set_add_result) = signal(None::<Result<(), String>>);
    // Linear fails its first attempt so Retry shows.
    let linear_failed = StoredValue::new(false);
    let next_custom = StoredValue::new(1_u32);
    let (answers, set_answers) = signal(None::<Vec<(String, String)>>);

    let on_answers = move |a: Vec<(String, String)>| set_answers.set(Some(a));

    view! {
        <div style="display: grid; gap: var(--space-6); max-width: 560px;">
            <AssistantMcpManager
                servers=servers
                outcomes=outcomes
                add_result=add_result
                on_connect=move |id: String| {
                    outcomes.update(|m| {
                        m.remove(&id);
                    });
                    set_timeout(
                        move || {
                            let first_linear = id == "linear" && !linear_failed.get_value();
                            let result = if first_linear {
                                linear_failed.set_value(true);
                                Err("Authorization expired".to_string())
                            } else {
                                Ok(tools_for(&id))
                            };
                            outcomes.try_update(|m| m.insert(id, result));
                        },
                        Duration::from_millis(1200),
                    );
                }
                on_disconnect=move |id: String| {
                    outcomes.update(|m| {
                        m.remove(&id);
                    });
                }
                on_remove=move |id: String| {
                    set_servers.update(|v| v.retain(|s| s.id != id));
                    outcomes.update(|m| {
                        m.remove(&id);
                    });
                }
                on_add=move |(name, url): (String, String)| {
                    set_add_result.set(None);
                    set_timeout(
                        move || {
                            if url.contains("taken") {
                                set_add_result.try_set(Some(Err("A server at that address is already added.".to_string())));
                                return;
                            }
                            let n = next_custom.get_value();
                            next_custom.set_value(n + 1);
                            set_servers.try_update(|v| v.push(McpServerInfo::custom(format!("custom-{n}"), name, url)));
                            set_add_result.try_set(Some(Ok(())));
                        },
                        Duration::from_millis(900),
                    );
                }
            />
            <div style="display: grid; gap: var(--space-3);">
                <AssistantMcpElicitation
                    title="Linear needs a few details"
                    message="To file the issue, Linear asks which repository it belongs to."
                    fields=vec![
                        ElicitField::text("repository", "Repository"),
                        ElicitField::choice("branch", "Branch", &["main", "develop", "release"]),
                        ElicitField::bool("private", "Keep the issue private"),
                    ]
                    on_submit=on_answers
                    on_cancel=move |()| set_answers.set(None)
                />
                {move || {
                    answers
                        .get()
                        .map(|a| {
                            let text = a.iter().map(|(k, v)| format!("{k}: {v}")).collect::<Vec<_>>().join(", ");
                            view! { <p style="margin: 0; font: var(--text-sm); color: var(--text-2);">{text}</p> }
                        })
                }}
            </div>
        </div>
    }
    .into_any()
}

Anatomy

Componentdata-partRenders
AssistantMcpManagerconnectors / custom-serversThe two sections, each with a heading and a list
add-triggerButton that reveals the add form
emptyShown when there are no custom servers
AssistantMcpServerrootA row. data-connection-state is disconnected, connecting, connected or error
icon / name / description / statusInitial letter, text and the status line
toolsTool names, shown while connected
connect-button / disconnect-buttonWhichever the connection allows
remove-buttonCustom servers only
AssistantMcpAddFormroot / field / inputName and URL fields with inline errors in field-error
error / submitThe owner's rejection (role alert) and the submit button
AssistantMcpElicitationroot / title / messageThe card. data-status is pending, submitted or cancelled
field / label / input / checkbox / optionsOne question and its control
submit / cancel / resultButtons while pending, then the outcome line

Keyboard

KeyDoes
EnterIn a field: submit the form
SpaceOn a checkbox or radio: toggle or choose

Props

PropTypeNotes
serversVec<McpServerInfo>Manager: the servers. A server has id, name, description and custom
outcomesHashMap<String, Result<Vec<String>, String>>Manager: latest connection result per server id, tool names or an error. Clear an entry in on_connect
on_connect / on_disconnect / on_removeCallback<String>Server id. You do the connecting, then fill outcomes
on_add / add_resultCallback<(String, String)> / Result<(), String>Name and URL after validation. Answer with add_result; the form closes on Ok and shows the message on Err
outcomeResult<Vec<String>, String>Server row: the same result for one server
title / message / fieldsString / String / Vec<ElicitField>Elicitation: text, bool and choice fields, required unless marked optional
on_submit / on_cancelCallback<Vec<(String, String)>> / Callback<()>Elicitation: answers once every required field has one, or the decline
Actions
Button
Icon button
Toolbar
Theme menu
Display
Avatar
Badge
Card
Chip
Code block
Markdown
Doc card
Due pill
Kbd
Priority mark
Source chip
Space icon
Status diamond
Tag
Value diff
Carousel
Reveal
Media timeline
QR code
Transcript viewer
Audio waveform
Audio player
Forms
Calendar
Checkbox
Combobox
Date picker
Color picker
Cron builder
Theme editor
Mention input
Signature pad
Image cropper
Date field
Date range picker
Duration field
Quantity stepper
Filter chip
Input
Markdown editor
Radio group
Search field
Segmented control
Select
Slider
Range slider
Rating
Toggle button
File dropzone
Upload queue
Attachment
Switch
Tags input
Number field
Money field
Phone field
Time field
OTP input
Password field
Questionnaire
Availability picker
Voice input
Recording control
Inline edit
Async validated input
Shortcut recorder
Data
Spreadsheet grid
Week scheduler
Virtual list
Stat card
Step track
Kanban board
Sortable list
Filter builder
Data table
Grid
Access editor
File manager
Gantt chart
Log stream
Diff viewer
JSON inspector
Terminal
Node editor
Whiteboard
Navigation
Table of contents
Breadcrumb
Tabs
Wizard
Nav item
Nav section
Tree view
Pagination
Menubar
Navigation menu
Saved views
Layout
Master detail
App shell
Sidebar layout
Resizable panels
Dashboard layout
Dock layout
Feedback
Callout
Check list
Empty state
Progress bar
Toast
Approval card
Skeleton
Notification center
Bars
Bar chart
Diverging bar chart
Span chart
Pictogram chart
Stacked bar chart
Funnel chart
Bullet chart
Waffle chart
Marimekko chart
Dot plot chart
Error bar chart
Pareto chart
Waterfall chart
Lollipop chart
Grouped bar chart
Bar race chart
KPIs and frames
Chart frame
Metric card
Sparkline
Points
Scatter chart
Smith chart
Strip plot
Beeswarm chart
Parallel coordinates
Ternary chart
Bland-Altman chart
Quiver chart
Connected scatter chart
Grids and tables
Heatmap chart
Chart table
Cohort chart
Radial
Radial charts
Radar chart
Polar area chart
Stat ring
Clock chart
Spiral chart
Lines and areas
Bump chart
Slope chart
Line chart
Composed chart
Small multiples
Cycle plot chart
Horizon chart
Stacked area chart
Threshold chart
Split line chart
Linked charts
Confidence band chart
Forecast fan chart
Step chart
Range area chart
Distributions
Contour chart
Histogram
Box plot
Density chart
Ridgeline chart
Violin chart
Q-Q chart
Survival chart
ECDF chart
Raincloud plot
Forest plot
Maps
Geo map
Bubble map
Hexbin map
Cartogram
Flow map
Parts of a whole
Donut chart
Voronoi treemap
Nested donut chart
Treemap chart
Sunburst chart
Bubble pack chart
Icicle chart
Flame graph chart
Pie chart
Word cloud
Relationships
Sankey chart
Network chart
Chord chart
UpSet chart
Venn chart
Alluvial chart
Adjacency matrix chart
Dependency graph chart
Tree chart
Arc diagram
Hive plot
Edge bundling
Finance
Candlestick chart
OHLC chart
Depth chart
Renko chart
Time
Timeline chart
Calendar heatmap chart
Spectrogram chart
Marey chart
Overlays
Tour
Lightbox
Alert dialog
Command palette
Dialog
Menu
Popover
Tooltip
Sheet
Hover card
Context menu
Utilities
Pacer
Hotkeys
Disclosure
Accordion
Collapsible
Chat
Chat bubble
Voice session
Composer
Thread
Thread list
Assistant composer
Assistant MCP
Assistant modal
Assistant thread
Assistant thread list
Message scroller
Insight note
Emoji picker
Tool trace
Model picker
Citation popover
Activity
Activity feed
Comment thread
Timeline
Presence bar
Live cursors
Reaction bar
Guides
Getting started
All components
All charts