dsh-brain/src/entries/mcp.ts

25 lines
1.0 KiB
TypeScript

/**
* MCP sub-plugin entry — the host half of the MCP management tab.
*
* The MCP feature is a browser bridge: the client tab talks to the host
* dsh-mcp-connector plugin, and this entry only contributes the
* capability fragment that makes `/dsh-brain/status` report
* `mcpBridge: 'host-plugin'` (the card then shows the tab). With this row
* disabled the capability reports 'unavailable' and the client keeps the
* tab hidden — no routes or state exist on this side either way.
*/
import type { CloudMemoryContext } from '../context-types.ts'
import { brainKernel } from '../kernel.ts'
export const name = 'dsh-brain-mcp'
/** Services required before `apply` runs (none: activation only). */
export const inject: string[] = []
/** Register the sub-plugin with the host. */
export function apply(ctx: CloudMemoryContext, config: unknown): void {
const kernel = brainKernel(config, ctx.logger('dsh-brain'))
kernel.activate('mcp')
ctx.effect(() => () => kernel.deactivate('mcp'), 'dsh-brain-mcp: activation')
}