DEV Community

刘欢
刘欢

Posted on

MCP tools + permission hooks: giving a desktop AI real tools without giving up control

Cloud agents can call tools — but the keys, transcripts, and policy often live somewhere else. When the work is on your machine (CRM exports, local PDFs, SMTP), you want the opposite: tools that run locally, with a gate you can see.

I have been building aiFetchly, an open-source local-first desktop AI agent (Electron; Windows / macOS / Linux) for marketing and ops workflows. Today's write-up is about two pieces that pair well: MCP Tools and Hooks.

MCP Tools

aiFetchly can connect Model Context Protocol servers (Stdio, SSE, or WebSocket) so the AI Marketing Assistant can search the web, query databases, call APIs, or run custom business logic. Config accepts Claude Desktop-compatible JSON, and plugins can bundle MCP servers too.

Docs: https://docs.aifetchly.com/docs/ai-outreach/mcp-tools

Hooks that gate tool calls

Hooks sit between the AI and the tools it wants to run (skills, MCP tools, and others). A PreToolUse hook can block a dangerous call before it ever executes. Other hooks can rewrite inputs, inject compliance context after a tool runs, or keep an audit trail. Built-in safety hooks ship by default; you can add your own command hooks as small scripts.

That sits beside the normal permission system — a hook that allows a call still does not bypass permissions.

Specialist subagents

For focused jobs (for example lead research), aiFetchly can hand work to specialist subagents with their own prompts, allowed tools, and limits — then return a structured result to the main chat.

Docs: https://docs.aifetchly.com/docs/ai-outreach/subagents

Links

If you are building local agents for non-coding business workflows, I would love feedback on the MCP + hooks model.

Top comments (0)