From 0125e6d72c6f8a45cee40de54cb7fbc68cb93ec1 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sun, 16 Aug 2026 16:23:41 +0200 Subject: [PATCH] chore: address coderabbit security-review and markdown lint findings Add explicit security-review guidance before exposing MCP tools and label plain-text code fences to satisfy markdownlint MD040. --- .agents/skills/codebase-context/SKILL.md | 2 +- .agents/skills/mcp-integration/SKILL.md | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.agents/skills/codebase-context/SKILL.md b/.agents/skills/codebase-context/SKILL.md index 83301b2a4..d10509bff 100644 --- a/.agents/skills/codebase-context/SKILL.md +++ b/.agents/skills/codebase-context/SKILL.md @@ -27,7 +27,7 @@ Homarr is an open-source, self-hosted dashboard for managing homelab services. I ## Repository Structure -``` +```text homarr/ ├── apps/ │ ├── nextjs/ # Main Next.js application (port 3000) diff --git a/.agents/skills/mcp-integration/SKILL.md b/.agents/skills/mcp-integration/SKILL.md index b1eb8f611..38658da5a 100644 --- a/.agents/skills/mcp-integration/SKILL.md +++ b/.agents/skills/mcp-integration/SKILL.md @@ -7,6 +7,8 @@ description: Expose tRPC procedures as MCP tools for AI clients. Use when modify Every new tRPC procedure that provides useful functionality should be exposed as an MCP tool so AI assistants (Claude, Cursor, etc.) can use it. This is a first-class feature of Homarr. +Exposing a procedure makes it callable by any AI client with an API key. Before adding `.meta({ mcp })`, review what the tool exposes: authorization requirements, sensitive data, tenant isolation, auditability, and whether the action is destructive. Prefer exposing read-only queries over mutations unless the mutation is safe and permission-scoped. When in doubt, ask for a security review before shipping a new MCP tool. + ## Adding MCP to a procedure Add `.meta({ mcp: { enabled: true, description: "..." } })` to the procedure chain: @@ -45,19 +47,19 @@ The description is the **only thing** an AI sees to decide when and how to use t **Good:** -``` +```text "Get calendar events for upcoming and recent media releases. Fetches from all connected Sonarr (TV), Radarr (movies), Lidarr (music), and Readarr (books) integrations. Requires integrationIds from integration_all" ``` **Bad:** -``` +```text "Get calendar events" ``` **For tools that return permission fields**, explain what they mean: -``` +```text "List all integrations. Returns permissions.hasUseAccess (read) and permissions.hasInteractAccess (actions) — false means the API key lacks that permission, not an error" ```