Files
rhema-claw/web/claw/app/components/settings/McpPage.vue
T
vhaudiquet 829f30d27e
android / debug (push) Successful in 2m12s
ci / checks (push) Successful in 3m42s
ci / web (push) Successful in 12s
android / release (push) Successful in 2m5s
ci / test (push) Successful in 2m12s
ci / chart (push) Successful in 6s
ci / docker (push) Successful in 1m58s
ci / publish-edge-images (deploy/docker/claw.Dockerfile, rhema-claw) (push) Successful in 1m55s
ci / publish-edge-images (deploy/docker/ui.Dockerfile, rhema-claw-ui) (push) Successful in 15s
ci / publish-edge-chart (push) Successful in 4s
feat(claw): load skills and subagents and edit the identity files
The claw's agents had no skills and no way to delegate, and the settings
surface could only read a pair of booleans.

Skills now seed the bundled `commit-message` and `unslop` folders into
the global directory, discover the global and workspace tiers on every
dispatch, and list them in the prompt. The settings table owns an off
switch per skill, so the Skills page can hold one back without editing
YAML. The config set is the seed.

Subagents build on `rhema-subagents`. Definitions are `SUBAGENT.md`
folders under the global directory and the workspace tier, and the
parent prompt advertises the `subagent` tool. The wire passes the
parent's skills, environment report, and USER.md to the child, so a
delegated turn knows the same context.

The Bootstrap page reads the three identity files and writes SOUL.md
and USER.md. ENVIRONMENT.md stays read-only because the boot pass
rewrites it. The MCP page reads the client's config through the same
file the shell uses and shows servers, transports, and the daemon's
mute set. It stays read-only: the standalone client owns that file.

`GET` and `PUT /v1/bootstrap/{kind}`, `GET /v1/bootstrap/files`, `GET`
and `PUT /v1/skills`, and `GET /v1/mcp` carry the pages. The config
gains `skills_root`, `skills_disabled`, `subagents_root`, and
`disabled_subagents`.

fmt, clippy with -D warnings over all targets, the 304 lib and 46 HTTP
tests, and nuxt typecheck and build pass.
2026-11-29 23:20:32 +01:00

172 lines
4.1 KiB
Vue

<script setup lang="ts">
// The MCP page: the standalone client's configured servers and the
// names claw.yaml mutes. Read-only by design — the config file belongs
// to the client, and the claw only names it through MCP_CONFIG.
import type { McpState } from '~/composables/useClaw'
const props = defineProps<{
state: McpState | null
loading: boolean
}>()
defineEmits<{ refresh: [] }>()
// The missing-file line is the callout's job; every other notice is a
// parse or shape problem worth its own warn.
const notices = computed(() =>
(props.state?.notices ?? []).filter((notice) => !notice.startsWith('no MCP config file')),
)
const TRANSPORTS: Record<string, string> = {
stdio: 'local process',
http: 'HTTP',
unknown: 'unrecognized',
}
</script>
<template>
<div class="page">
<PageHeader title="MCP" subtitle="Servers the agent's shell can call.">
<template #actions>
<button :disabled="loading" @click="$emit('refresh')">
{{ loading ? 'Refreshing…' : 'Refresh' }}
</button>
</template>
</PageHeader>
<div class="scroll">
<p v-if="!state" class="muted">loading MCP servers…</p>
<template v-else>
<AppCallout v-if="!state.exists" variant="info" title="No MCP config file">
The client has no servers configured at
<span class="mono">{{ state.config }}</span>. Add a
<code>servers</code> object there, then refresh.
</AppCallout>
<AppCallout
v-for="notice in notices"
:key="notice"
variant="warn"
title="MCP config"
>
{{ notice }}
</AppCallout>
<SettingCard
title="Servers"
:meta="`${state.servers.length} configured${state.disabled.length ? `, ${state.disabled.length} muted` : ''}`"
>
<p v-if="state.servers.length === 0 && state.exists" class="empty">
The config exists but holds no servers.
</p>
<template v-else>
<div v-for="server in state.servers" :key="server.name" class="server">
<div class="server-head">
<span class="server-name mono">{{ server.name }}</span>
<span class="server-transport">{{ TRANSPORTS[server.transport] }}</span>
<span class="server-state" :class="{ off: state.disabled.includes(server.name) }">
{{ state.disabled.includes(server.name) ? 'muted' : 'active' }}
</span>
</div>
<p v-if="server.description" class="server-description">{{ server.description }}</p>
<p v-if="server.program" class="server-program mono">{{ server.program }}</p>
</div>
</template>
</SettingCard>
<p class="footnote">
Config: <span class="mono">{{ state.config }}</span>.
Mutes: <code>disabled_mcp_servers</code> in <code>claw.yaml</code>.
The page is read-only; the client owns the file.
</p>
</template>
</div>
</div>
</template>
<style scoped>
.page {
display: flex;
flex-direction: column;
min-height: 0;
min-width: 0;
flex: 1;
}
.scroll {
flex: 1;
overflow-y: auto;
padding: 0 24px 24px;
display: flex;
flex-direction: column;
gap: 16px;
max-width: 860px;
}
.muted {
color: var(--text3);
}
.empty {
margin: 0;
padding: 13px 16px;
color: var(--text3);
}
.server {
display: flex;
flex-direction: column;
gap: 3px;
padding: 12px 16px;
}
.server-head {
display: flex;
align-items: baseline;
gap: 12px;
}
.server-name {
font-weight: 600;
color: var(--text);
}
.server-transport {
color: var(--text3);
font-size: 11.5px;
}
.server-state {
margin-left: auto;
color: var(--ok);
font-size: 11.5px;
}
.server-state.off {
color: var(--text3);
}
.server-description {
margin: 0;
color: var(--text2);
font-size: 12.5px;
overflow-wrap: anywhere;
}
.server-program {
margin: 0;
color: var(--text3);
font-size: 11.5px;
overflow-wrap: anywhere;
}
.footnote {
margin: 0;
padding: 0 2px;
color: var(--text3);
font-size: 12px;
}
</style>