Skip to main content
Glama

Home Assistant MCP Server

components.ts1.49 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { apiLogger } from "../../logger.js"; import type { HassClient } from "../../api/client.js"; /** * Registers a prompt for listing Home Assistant components * @param server The MCP server to register the prompt with * @param hassClient The Home Assistant client */ export function registerSystemComponentsPrompt( server: McpServer, _hassClient: HassClient, // Prefixed with underscore to indicate intentional non-usage ) { server.prompt( "system-components", "List all loaded Home Assistant components", {}, async (request) => { apiLogger.info("Processing system components prompt", { args: request, }); return { messages: [ { role: "user", content: { type: "text", text: "List all the components currently loaded in Home Assistant", }, }, ], _meta: { systemPrompt: `You are a helpful Home Assistant system information assistant. Your task is to retrieve and display all components currently loaded in the Home Assistant instance. Use the system components tool to fetch the list of all loaded components. Present the information in a clear, organized manner. If there are many components, consider grouping them by category or domain. If there's an error, explain what went wrong and suggest alternatives.`, }, }; }, ); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/oleander/home-assistant-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server