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.
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -27,7 +27,7 @@ Homarr is an open-source, self-hosted dashboard for managing homelab services. I
|
|||||||
|
|
||||||
## Repository Structure
|
## Repository Structure
|
||||||
|
|
||||||
```
|
```text
|
||||||
homarr/
|
homarr/
|
||||||
├── apps/
|
├── apps/
|
||||||
│ ├── nextjs/ # Main Next.js application (port 3000)
|
│ ├── nextjs/ # Main Next.js application (port 3000)
|
||||||
|
|||||||
@@ -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.
|
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
|
## Adding MCP to a procedure
|
||||||
|
|
||||||
Add `.meta({ mcp: { enabled: true, description: "..." } })` to the procedure chain:
|
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:**
|
**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"
|
"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:**
|
**Bad:**
|
||||||
|
|
||||||
```
|
```text
|
||||||
"Get calendar events"
|
"Get calendar events"
|
||||||
```
|
```
|
||||||
|
|
||||||
**For tools that return permission fields**, explain what they mean:
|
**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"
|
"List all integrations. Returns permissions.hasUseAccess (read) and permissions.hasInteractAccess (actions) — false means the API key lacks that permission, not an error"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user