📝 docs(hub): add comments explaining why hub is not in builtin list

- Add JSDoc to HubServer class explaining its purpose and design
- Add comment to builtinMCPServers explaining hub exclusion
- Hub is a meta-server for LLM code mode, auto-enabled internally
This commit is contained in:
Vaayne 2025-12-29 15:41:26 +08:00
parent d1ed8c315f
commit 6c951a3945
2 changed files with 20 additions and 0 deletions

View File

@ -9,6 +9,18 @@ import type { ExecInput, SearchQuery } from './types'
const logger = loggerService.withContext('MCPServer:Hub')
/**
* Hub MCP Server - A meta-server that aggregates all active MCP servers.
*
* This server is NOT included in builtinMCPServers because:
* 1. It aggregates tools from all other MCP servers, not a standalone tool provider
* 2. It's designed for LLM "code mode" - enabling AI to discover and call tools programmatically
* 3. It should be auto-enabled when code mode features are used, not manually installed by users
*
* The server exposes two tools:
* - `search`: Find available tools by keywords, returns JS function signatures
* - `exec`: Execute JavaScript code that calls discovered tools
*/
export class HubServer {
public server: Server
private toolRegistry: ToolRegistry

View File

@ -86,6 +86,14 @@ export { mcpSlice }
// Export the reducer as default export
export default mcpSlice.reducer
/**
* User-installable built-in MCP servers shown in the UI.
*
* Note: The `hub` server (@cherry/hub) is intentionally excluded because:
* - It's a meta-server that aggregates all other MCP servers
* - It's designed for LLM code mode, not direct user interaction
* - It should be auto-enabled internally when needed, not manually installed
*/
export const builtinMCPServers: BuiltinMCPServer[] = [
{
id: nanoid(),