Private Desktop AI Agents: Connecting Local Ollama and MCP Servers to aiFetchly

Step-by-step: use local Ollama models and stdio MCP servers in aiFetchly, with Plan Mode approval and PreToolUse hooks.

Short answer: Pair local Ollama models with Model Context Protocol (MCP) servers in aiFetchly to get private desktop AI workflows. Point a custom OpenAI-compatible provider at localhost, mount developer tools over stdio, and keep human approval in the loop, so code analysis, database queries and file transformations run without sending proprietary data to third-party cloud APIs.

Many engineering teams work under IP and privacy rules that forbid sending source code, architecture notes or local database records to commercial cloud models. Yet hand-rolling CLI wrappers to orchestrate local open-weights models next to your dev tooling is tedious and fragile.

The aiFetchly desktop app pairs a local-first desktop runtime with the open MCP ecosystem. Here is the setup, step by step.

Step 1: Configure Ollama as a custom AI provider

Make sure your Ollama daemon is running and serving a model (for example ollama run qwen2.5-coder or ollama run llama3.3).

In aiFetchly, open Settings → AI Providers → Add Custom Provider (provider setup guide):

  • Provider type: OpenAI Compatible
  • Base URL: http://localhost:11434/v1
  • API key: ollama (any non-empty placeholder)
  • Model: qwen2.5-coder (or your local tag)

Click Test Connection, save, and set it as the active model. Prompts are now processed on your own hardware.

Step 2: Register MCP servers

Go to System Settings → MCP Servers and add servers with stdio transport:

{
  "mcpServers": {
    "sqlite-db": {
      "command": "uvx",
      "args": ["mcp-server-sqlite", "--db-path", "./analytics.db"]
    }
  }
}

On save, aiFetchly starts the server as a child process, discovers its tools (schema inspection, SQL queries, …) and adds them to the agent’s tool catalog.

Step 3: Use Plan Mode for human oversight

Switch the chat to Plan Mode. When you ask the local assistant to analyze a repo or query the SQLite database, it first produces a step-by-step plan card. Review the SQL and file paths, then click Approve to execute.

Step 4: Enforce safety hooks

Configure PreToolUse hooks in settings. These shell hooks see tool arguments before execution, so you can validate scripts, sandbox directories and reject destructive operations before they touch your OS.

Wrap-up

Local model + MCP tools + plan approval + hooks = an agent that is useful on real code and data while nothing leaves your machine. Try it at aifetchly.com.


Tip: start with a read-only MCP server and Plan Mode on.


Write a comment