{
  "$schema": "https://promptfoo.tech/schemas/workflow-template.json",
  "name": "MCP Filesystem Server for Local Coding Agents",
  "slug": "mcp-filesystem-server-for-coding",
  "platform": "MCP",
  "category": "mcp-servers",
  "difficulty": "Intermediate",
  "tags": [
    "mcp",
    "claude",
    "coding",
    "agents"
  ],
  "summary": "Give Claude Desktop or any MCP client safe, scoped access to a project directory so an agent can read, edit, and run tests without you copy-pasting.",
  "overview": "Model Context Protocol (MCP) lets local AI clients call tools. The official filesystem server is the fastest way to give an assistant real read/write access to a repo, without exposing the rest of your machine. This guide covers installation, safe scoping, and a review-first workflow.",
  "variables": {
    "ANTHROPIC_API_KEY": "sk-ant-..."
  },
  "steps": [
    {
      "order": 1,
      "name": "Install the server",
      "description": "Run: npx -y @modelcontextprotocol/server-filesystem <allowed-dir>. Verify it starts and prints tool schemas."
    },
    {
      "order": 2,
      "name": "Configure Claude Desktop",
      "description": "Edit claude_desktop_config.json and add the server under mcpServers with the args array pointing at your project."
    },
    {
      "order": 3,
      "name": "Scope tightly",
      "description": "Never point the server at your home directory. Use one project root, ideally a git worktree so you can diff its output."
    },
    {
      "order": 4,
      "name": "Set an approval policy",
      "description": "Start with per-call approval. Once you trust the workflow, move to per-session for read tools only; keep write tools per-call."
    },
    {
      "order": 5,
      "name": "Add a review gate",
      "description": "After any write batch, ask the assistant to summarize changes and run git diff before you commit."
    }
  ],
  "howItWorks": [
    "Install the MCP filesystem server via npm or a prebuilt binary.",
    "Configure your MCP client with a list of allowed directories.",
    "The client (Claude Desktop, Cursor, etc.) sees new tools: read_file, write_file, list_directory, search_files.",
    "You approve tool calls per session or per call, depending on client policy."
  ],
  "benefits": [
    "No more paste-the-file-then-paste-the-diff dance.",
    "Scoped by directory — the model can only touch what you allow.",
    "Works across any MCP-compatible client, not just one vendor."
  ],
  "useCases": [
    "Refactoring a module with an assistant that can actually see it.",
    "Generating tests from source files without copy-paste.",
    "Automated code review of a diff before you commit."
  ],
  "example": null,
  "faqs": [
    {
      "q": "Is this safe to run against my whole machine?",
      "a": "No. Always scope to a specific project directory. The server enforces the allow-list but you set it."
    },
    {
      "q": "Does it work in a browser client?",
      "a": "MCP is designed for local clients. Browser assistants generally need a hosted equivalent or a bridge."
    },
    {
      "q": "Can I add my own tools?",
      "a": "Yes — write your own MCP server. The filesystem server is one of many reference implementations."
    }
  ],
  "source": "https://promptfoo.tech/workflows/mcp-filesystem-server-for-coding",
  "updated": "2025-05-28",
  "license": "CC-BY-4.0"
}