modscode / Gallery / agent-discover
agent-discover
Find, install and enable MCP servers mid-session. Search tools across installed and marketplace servers, approve installs with full provenance, and manage everything in the /discover pane.
What it does
- Draws a pane, a band above the prompt, toasts
- Adds /discover
- Hooks session.start
- Calls the network
Good points
- Starts no processes
- Written in TypeScript
- Handles errors
- Writes no files
Code to start from
Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.
Starter (register.tsx)
import type { Register } from 'claude-code'
// Drawn like agent-discover by keshrath (pane, band, status, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/keshrath-agent-discover/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "agent-discover" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text, Select } = $.ui.resolve(e)
const label = '…'
const enabled = '…'
const length = '…'
const busy = '…'
const server = '…'
const message = '…'
const title = '…'
const server2 = '…'
const message2 = '…'
const server3 = '…'
const message3 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexWrap="wrap" columnGap={1}>
<Button label={`${label}`} />
<Button label={`${label}`} />
<Button label={`${label}`} />
<Button label="Refresh" dimColor />
<Text dimColor>
{"MCP "}
{enabled}
/
{length}
</Text>
</Box>
<Text dimColor wrap="truncate">
Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the prompt
</Text>
<Text color="yellow">
{busy}
...
</Text>
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1}>
<Text color="yellow">
{server}
{" asks:"}
</Text>
<Text>
{message}
</Text>
<Select label={`${title}`} />
<Select label={`${title}`} />
<Select label={`${title}`} />
<Box flexWrap="wrap" columnGap={1}>
<Button label="Accept" variant="primary" />
<Button label="Decline" />
<Button label="Cancel" dimColor />
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1}>
<Text color="yellow">
{server2}
{" asks:"}
</Text>
<Text>
{message2}
</Text>
<Select label={`${title}`} />
<Select label={`${title}`} />
<Select label={`${title}`} />
<Box flexWrap="wrap" columnGap={1}>
<Button label="Accept" variant="primary" />
<Button label="Decline" />
<Button label="Cancel" dimColor />
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1}>
<Text color="yellow">
{server3}
{" asks:"}
</Text>
<Text>
{message3}
</Text>
<Select label={`${title}`} />
<Select label={`${title}`} />
<Select label={`${title}`} />
<Box flexWrap="wrap" columnGap={1}>
<Button label="Accept" variant="primary" />
<Button label="Decline" />
<Button label="Cancel" dimColor />
</Box>
</Box>
</Box>
)
})
// the band above the prompt; what else goes there is drawn under it
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const { Box, Text, Button } = $.ui.resolve(e)
const what = '…'
return (
<Box flexDirection="column">
<Box columnGap={1} flexWrap="wrap">
<Text color="yellow">
{"agent-discover: "}
{what}
</Text>
<Button label="Review" variant="primary" />
<Button label="Dismiss" dimColor />
</Box>
{await next(e)}
</Box>
)
})
on('session.start', async ($, e, next) => {
const name = '…'
const server = '…'
await $.ui.toast(`agent-discover: ${name} quarantined, review before use`)
await $.ui.toast(`agent-discover: ${server} asks a question (/discover)`)
return next(e)
})
}
The mod's own code
Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.
plugin/hooks/register.tsx lines 752–777 · Pane
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const el = $.ui.resolve(e);
const snap = await read($, snapshot);
if (!snap) return <el.Text dimColor>Loading...</el.Text>;
return (
<Pane
el={el}
snap={snap}
route={await read($, route)}
detail={await read($, detail)}
tool={await read($, tool)}
confirm={await read($, confirm)}
browse={await read($, browse)}
plan={await read($, plan)}
logs={await read($, logs)}
audit={await read($, audit)}
busy={await read($, busy)}
notice={await read($, notice)}
isFocused={e.props.isFocused}
masked={await read($, masked)}
editing={await read($, editing)}
on={actions($)}
/>
);
});plugin/hooks/view.tsx lines 165–225 · Pane
export function Pane(p: PaneProps) {
const { Box, Text, Button } = p.el;
const { snap, route, on } = p;
const enabled = snap.servers.filter((s) => s.enabled).length;
let body;
if (!snap.isUp) body = <Text color="red">The daemon does not answer at {snap.origin}.</Text>;
else if (route.tab === 'servers' && route.server)
body = p.detail ? (
<Detail
el={p.el}
on={on}
d={p.detail}
tool={p.tool}
confirm={p.confirm}
masked={p.masked}
editing={p.editing}
/>
) : (
<Text dimColor>Loading {route.server}...</Text>
);
else if (route.tab === 'servers') body = <Servers el={p.el} on={on} servers={snap.servers} />;
else if (route.tab === 'browse')
body = <Browse el={p.el} on={on} browse={p.browse} plan={p.plan} masked={p.masked} />;
else if (route.tab === 'logs') body = <Logs el={p.el} on={on} logs={p.logs} />;
else body = <Audit el={p.el} on={on} audit={p.audit} />;
return (
<Box flexDirection="column" gap={1}>
<Box flexWrap="wrap" columnGap={1}>
{TABS.map(([tab, label]) => (
<Button
key={`tab:${tab}`}
label={label}
{...primary(route.tab === tab)}
onPress={() => on.go(tab)}
/>
))}
<Button key="refresh" label="Refresh" dimColor onPress={on.refresh} />
{snap.isUp && (
<Text dimColor>
MCP {enabled}/{snap.servers.length}
</Text>
)}
</Box>
<Text dimColor wrap="truncate">
{p.isFocused
? 'Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the prompt'
: 'ctrl+x tab: use this pane from the keyboard'}
</Text>
{p.busy ? (
<Text color="yellow">{p.busy}...</Text>
) : (
p.notice && <Text dimColor>{p.notice}</Text>
)}
{snap.elicitations.map((q) => (
<Question key={`q:${q.id}`} el={p.el} on={on} q={q} />
))}
{body}
</Box>
);
}plugin/hooks/view.tsx lines 227–273 · Pane
function Question({ el, on, q }: ViewProps & { q: AgentDiscoverElicitation }) {
const { Box, Text, Button, Input, Select } = el;
return (
<Box flexDirection="column" borderStyle="round" borderColor="yellow" paddingX={1}>
<Text color="yellow">{q.server} asks:</Text>
<Text>{q.message}</Text>
{q.fields.map((f) =>
f.options.length && Select ? (
<Select
key={`q:${q.id}:${f.name}`}
label={f.title}
options={f.options.map((o) => ({ value: o, label: o }))}
onSelect={(v) => on.answer(q.id, f.name, v)}
/>
) : (
Input && (
<Input
key={`q:${q.id}:${f.name}`}
label={`${f.title}${f.required ? ' *' : ''}`}
submitLabel="set"
onSubmit={(v) => on.answer(q.id, f.name, v)}
/>
)
),
)}
<Box flexWrap="wrap" columnGap={1}>
<Button
key={`q:${q.id}:accept`}
label="Accept"
variant="primary"
onPress={() => on.respond(q.id, 'accept')}
/>
<Button
key={`q:${q.id}:decline`}
label="Decline"
onPress={() => on.respond(q.id, 'decline')}
/>
<Button
key={`q:${q.id}:cancel`}
label="Cancel"
dimColor
onPress={() => on.respond(q.id, 'cancel')}
/>
</Box>
</Box>
);
}plugin/hooks/register.tsx lines 779–791 · Band
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const snap = await read($, snapshot);
if (
e.props.hasSurvey ||
!snap?.isUp ||
(snap.attention.length === 0 && snap.elicitations.length === 0) ||
(await read($, dismissed)) === signature(snap)
) {
return next(e);
}
return <Band el={$.ui.resolve(e)} snap={snap} on={actions($)} />;
});plugin/hooks/view.tsx lines 843–857 · Band
export function Band({ el, snap, on }: ViewProps & { snap: AgentDiscoverSnapshot }) {
const { Box, Text, Button } = el;
const what = [
snap.attention.length > 0 && `needs a look: ${snap.attention.join(', ')}`,
snap.elicitations.length > 0 && `${snap.elicitations.length} question(s) waiting for you`,
].filter(Boolean);
return (
<Box columnGap={1} flexWrap="wrap">
<Text color="yellow">agent-discover: {what.join('; ')}</Text>
<Button key="open" label="Review" variant="primary" onPress={on.openFromBand} />
<Button key="dismiss" label="Dismiss" dimColor onPress={on.dismiss} />
</Box>
);
}Licence text (MIT)
MIT License Copyright (c) 2026 MuK IT GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
What its code calls
networkenv vars
The design, read from code
Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.
What its code shows
Read from the source at commit bec8b70ade10 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.
| Decides the listing: code you can check | |
|---|---|
| Entry read | Every module hooks/hooks.json names was read.plugin/hooks/register.tsx |
| Parses | Every file parses as TypeScript or JavaScript.2 files parsed |
| All its code is in the mod | Every import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod |
| Readable | No minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs |
| Calls in the open | Network and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open |
| For you to weigh before installing | |
| Where it draws | The terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, the same in both |
| Install line | Whether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there |
| Programs on Windows | Whether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks |
| Network | Whether every fetch names its https host in the code.plugin/hooks/register.tsx:71 fetch(`${base}/api/token`); plugin/hooks/register.tsx:76 fetch(`${base}${path}`) |
| Programs | Whether every program it starts is named in the code and is not a shell, an interpreter or a network tool.starts no programs |
| Reads and sends | Whether it both reads files or environment variables and reaches the network.reads environment variables and reaches the network |
| Keys in the source | Whether the source holds what looks like an API key or a private key.no keys in the source |
| Licence | An open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT |
This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen
Install it
Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.
Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:
/plugin marketplace add keshrath/agent-discover/plugin install agent-discover@agent-discoverThis installs the marketplace's latest commit, which may not be the one read here (bec8b70ade10). Compare them before you install.
Ask Claude about it
With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:
Read the modscode design "keshrath-agent-discover" with its code and make me a pane like itSearch them from Claude: the MCP connector
Similar designs
-
Ask Claude…clawdifybuild 3build 3build 3Presets layer on top of what you have. Reset first for a clean slate.Empty = Claude Code default · lists are comma-separated · tokens {model} {cwd} {time} {date}buildbuildbuildYours bring back exactly the look you saved. /clawdify delete <name> removes one.buildbuildbuildSave current as my-look savecopy JSONreset allWhile thinking
-
Ask Claude…QuestList 1 Kanban 2Fleet f This repo l Refs g Refresh r Normal size z Collapse cOpen FilterokAll reposDoneClosedClose itList* marks a task whose refs disagree about its status; origin/dev is drawn where it has one. Resolving it is that reposit…New task in acme/app CreateClosed tracker change in acme/app not committed yet. Until they land, this repository's other checkouts cannot see the ids in them and can mint the same… Ask Claude to land them⋯
-
What it does
- Draws a pane, a band above the prompt, the status line
- Adds /pet
- Watches tool calls and can refuse them
- Hooks prompt.submit, session.end, session.start, turn.complete and 2 more
-
Ask Claude…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
● pace Write · Park to1 park 12 dismiss 2pace: resume point 2h 10m · Fix login · 33 resume 34 discard 45 all 3 5pace: Park to resume point older than 7 days6 clear 6Ask Claude…
-
Ask Claude…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel