Model Context Protocol is an open standard from Anthropic that defines how LLMs connect to external tools and data. One protocol - many sources.

Architecture:

┌─────────────┐         ┌─────────────┐         ┌─────────────┐
│  LLM Client │  ←→    │  MCP Server │  ←→    │   Resource  │
│ (Cursor,    │  stdio/ │ (filesystem,│        │  (files, DB,│
│  Claude,    │  HTTP   │  github...) │        │   API...)   │
│  OpenWebUI) │         │             │         │             │
└─────────────┘         └─────────────┘         └─────────────┘
  • Client - app with LLM (Cursor, Claude Desktop, Open WebUI)
  • Server - wrapper around a resource (Node.js/Python process)
  • Resource - data source or action (DB, API, filesystem)

💡 MCP defines a standard way to connect the model to external tools. The model doesn’t become “smarter” - it gains access to data and actions.


Top MCP Servers

Official (from Anthropic and partners)

ServerPurposeWhen needed
filesystemRead/write/search filesWorking with projects
githubIssues, PRs, repos, codeGitOps automation
postgresPostgreSQL queriesAnalytics, admin
sqliteLocal SQLite DBsPrototyping
fetchHTTP requests, scrapingWeb data collection
puppeteerBrowser controlE2E tests, UI automation
brave-searchSearch via Brave APICurrent information
memoryKnowledge graphLong-term memory
sequential-thinkingReasoning chainsComplex tasks
gitGit operationsCommits, branches, history
slackSlack workspaceTeam automation

Community

ServerPurpose
docker-mcpContainer management
kubernetes-mcpK8s clusters
ssh-mcpRemote servers
shell-mcpShell command execution
notion-mcpNotion workspace
todoist-mcpTask management
browserbaseCloud headless browser
exa-searchSemantic search

MCP Clients

ClientTypeLocal LLMsNotes
Claude DesktopDesktop❌ Claude onlyOfficial, stable
CursorIDE✅ Via Ollama/LM StudioBest for code
WindsurfIDE✅Cursor alternative
ClineVS Code ext✅Open-source, flexible
ContinueVS Code/JetBrains✅Cross-platform
Open WebUIWeb✅ NativePipes + Tools
LM StudioDesktop✅ NativeBuilt-in MCP
Cherry StudioDesktop✅Popular in Asia
JanDesktop✅Local-first

Setup on NixOS

# home.nix
{ pkgs, ... }:
{
  home.packages = with pkgs; [
    nodejs_22        # For npx-based servers
    uv               # For Python servers
    nodePackages.typescript-language-server
  ];

  # Config for Claude Desktop / Cursor
  xdg.configFile."claude/claude_desktop_config.json".text = builtins.toJSON {
    mcpServers = {
      filesystem = {
        command = "npx";
        args = [
          "-y"
          "@modelcontextprotocol/server-filesystem"
          "/home/ponfertato/projects"
          "/home/ponfertato/documents"
        ];
      };
      github = {
        command = "npx";
        args = [ "-y" "@modelcontextprotocol/server-github" ];
        env.GITHUB_PERSONAL_ACCESS_TOKEN = "<TOKEN>";
      };
      postgres = {
        command = "npx";
        args = [
          "-y"
          "@modelcontextprotocol/server-postgres"
          "postgresql://user:pass@localhost:5432/mydb"
        ];
      };
      memory = {
        command = "npx";
        args = [ "-y" "@modelcontextprotocol/server-memory" ];
      };
      fetch = {
        command = "uvx";
        args = [ "mcp-server-fetch" ];
      };
    };
  };
}

Option 2: NixOS module (system level)

# modules/mcp.nix
{ config, pkgs, lib, ... }:
{
  environment.systemPackages = with pkgs; [
    nodejs_22
    uv
    # If native packages exist:
    # mcp-server-filesystem
    # mcp-server-github
  ];

  # Optional: systemd user services for always-on servers
  systemd.user.services.mcp-filesystem = {
    enable = true;
    description = "MCP Filesystem Server";
    serviceConfig = {
      ExecStart = "${pkgs.nodejs_22}/bin/npx -y @modelcontextprotocol/server-filesystem /home/ponfertato/projects";
      Restart = "always";
    };
    wantedBy = [ "default.target" ];
  };
}

Option 3: Flake with custom MCP packages

# flake.nix
{
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";

  outputs = { self, nixpkgs }: {
    packages.x86_64-linux = let
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
    in {
      mcp-bundle = pkgs.buildEnv {
        name = "mcp-bundle";
        paths = with pkgs; [
          nodejs_22
          uv
          python312
        ];
      };
    };
  };
}

Ollama Integration

MCP is the transport protocol. Ollama is the LLM engine. Together they provide a local AI stack without internet or API keys.

Step 1. Run Ollama

ollama pull qwen2.5-coder:7b  # Optimal for tool calling on 16 GB RAM
ollama serve

Step 2. Configure client for Ollama

In Cursor (~/.cursor/mcp.json):

{
  "mcpServers": {
    "filesystem": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-filesystem", "/home"]
    },
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "..." }
    }
  }
}

In Cursor settings: Models → Ollama → qwen2.5-coder:7b.

In Open WebUI (via pipes): Manifold pipes are used (Naga, Pollinations, OpenRouter, Cloudflare) + __tools__ parameter.

Step 3. Test tool calling

# Test via curl
curl http://localhost:11434/api/chat -d '{
  "model": "qwen2.5-coder:7b",
  "messages": [{"role": "user", "content": "List files in /tmp"}],
  "tools": [...]
}'

Practical Scenarios

Scenario 1: GitOps assistant

Stack: github + filesystem + git MCP

  • Automatic PR review
  • Changelog generation from commits
  • Issue migration between repos

Scenario 2: DevOps helper

Stack: docker + ssh + postgres + shell MCP

  • Container monitoring
  • DB migration execution
  • Deployment via SSH

Scenario 3: Research agent

Stack: fetch + brave-search + memory + filesystem

  • Web information collection
  • Save to knowledge graph
  • Markdown report generation

Scenario 4: Personal secretary

Stack: notion + todoist + slack + memory

  • Task synchronization
  • Slack thread summarization
  • Day planning

Optimizations for 16 GB RAM:

  1. Use Q4_K_M quantizations (not fp16)
  2. Models: qwen2.5-coder:7b, llama3.1:8b, mistral:7b
  3. Don’t keep all MCP servers running - launch on demand
  4. Limit num_ctx in Ollama: OLLAMA_NUM_CTX=8192
  5. Close GUI clients when idle (Cursor uses 2+ GB)