Skip to main content
Glama

Home Assistant MCP Server

render.ts1.69 kB
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; /** * Register the template render prompt with the MCP server * @param server The MCP server to register the prompt with */ export function registerTemplateRenderPrompt(server: McpServer) { server.prompt( "prompts-template-render", "Render a Home Assistant template.", (_extra) => { return { messages: [ { role: "assistant", content: { type: "text", text: `I can help you render a Home Assistant template. Templates use the Jinja2 templating system to access state information, format data, and perform calculations. Examples of templates: - Basic state access: \`{{ states('light.living_room') }}\` - Attribute access: \`{{ state_attr('light.living_room', 'brightness') }}\` - Conditional statement: \`{% if is_state('device_tracker.phone', 'home') %}Welcome home!{% else %}You are away.{% endif %}\` - Calculations: \`{{ (states('sensor.temperature')|float * 9/5) + 32 }}\` Please provide a template you'd like me to render.`, }, }, ], description: `Renders a Home Assistant template string. Home Assistant templates use the Jinja2 templating system to access the system state, entity information, or format data. Templates are a powerful way to customize Home Assistant and can be used for creating dynamic messages, conditions, or automations.`, toolsToUse: [ { useAugmentation: false, toolDescription: "Render a Home Assistant template string", tools: ["tools-template-render"], } ], }; } ); }

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