{
  "id": "art_wjVVZYSe8peT",
  "slug": "error-permission-denied-troubleshooting-guide",
  "author": "句芒（goumang）",
  "title": "Error: Permission Denied Troubleshooting Guide",
  "summary": "Complete troubleshooting workflow for MCP filesystem Permission denied error, including file permission checks, directory settings, and OS-level permission solutions.",
  "content": "# Error: Permission Denied Troubleshooting Guide\n\nWhen using MCP filesystem tool and encountering \"Permission denied\" error, OS-level permissions are insufficient.\n\n## Causes\n\n1. Insufficient file permissions\n2. Insufficient directory permissions\n3. File locked by another process\n4. OS security policy restrictions\n\n## Troubleshooting Steps\n\n### Step 1: Check File Permissions\n\n```bash\nls -la /path/to/file\n```\n\nPermission bits:\n- Position 1: File type\n- Positions 2-4: Owner (rwx)\n- Positions 5-7: Group\n- Positions 8-10: Others\n\n### Step 2: Check Directory Permissions\n\n```bash\nls -ld /path/to/directory\n```\n\nDirectories need execute (x) permission to enter.\n\n### Step 3: Fix File Permissions\n\n```bash\n# Add read permission\nchmod u+r /path/to/file\n\n# Add write permission\nchmod u+w /path/to/file\n\n# Standard permissions (644)\nchmod 644 /path/to/file\n```\n\n### Step 4: Fix Directory Permissions\n\n```bash\n# Set directory permissions (755)\nchmod 755 /path/to/directory\n\n# Recursive fix\nchmod -R 755 /path/to/project\n```\n\n### Step 5: Check File Locks\n\n```bash\nlsof | grep /path/to/file\nkill -9 <PID>\n```\n\n### Step 6: Check macOS Permissions\n\n**Full Disk Access:**\n- System Settings → Privacy & Security → Full Disk Access\n- Ensure Claude Code has permission\n\n## Permission Reference\n\n| Number | File | Directory |\n|--------|------|-----------|\n| 644 | rw-r--r-- | - |\n| 755 | rwxr-xr-x | rwxr-xr-x |\n| 600 | rw------- | - |\n| 777 | rwxrwxrwx | rwxrwxrwx |\n\n## FAQ\n\n**Q: Why still Permission denied after chmod?**\nA: Parent directory permissions, file locked, or need recursive fix.\n\n**Q: How to batch fix permissions?**\nA: Use find command:\n```bash\nfind /path/to/project -type f -exec chmod 644 {} \\;\nfind /path/to/project -type d -exec chmod 755 {} \\;\n```\n\n**Q: macOS \"Operation not permitted\"?**\nA: Grant Full Disk Access to Claude Code.\n\n## Verify Fix\n\n1. Check file permissions\n2. Check directory permissions\n3. Test reading file\n4. Restart Claude Code\n\n## Next Steps\n\n- [Filesystem Configuration](TOOL-FS-001)\n- [Path Not Allowed Error](TOOL-FS-002)",
  "lang": "en",
  "domain": "mcp",
  "tags": [
    "mcp",
    "filesystem",
    "error",
    "permission-denied"
  ],
  "keywords": [
    "mcp",
    "filesystem",
    "permission-denied",
    "chmod",
    "permissions"
  ],
  "verificationStatus": "verified",
  "confidenceScore": 98,
  "riskLevel": "low",
  "applicableVersions": [],
  "runtimeEnv": [],
  "codeBlocks": [],
  "qaPairs": [
    {
      "id": "qa_001",
      "question": "What does Permission denied mean?",
      "answer": "Current user lacks permission to access file or directory."
    },
    {
      "id": "qa_002",
      "question": "How to fix directory permissions?",
      "answer": "Use chmod 755 directory-path. Recursive: chmod -R 755 project-path."
    },
    {
      "id": "qa_003",
      "question": "What is the difference between chmod 644 and 755?",
      "answer": "644 for files, 755 for directories."
    }
  ],
  "verificationRecords": [
    {
      "id": "cmmnbgts70007ybmhziw3qbxk",
      "articleId": "art_wjVVZYSe8peT",
      "verifier": {
        "id": 7,
        "type": "human_expert",
        "name": "里林（lilin）"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "26.0.1"
      },
      "notes": "人类专家验证",
      "verifiedAt": "2026-03-12T10:20:04.423Z"
    },
    {
      "id": "cmmnbgn8u0005ybmhbkoa5qnx",
      "articleId": "art_wjVVZYSe8peT",
      "verifier": {
        "id": 5,
        "type": "official_bot",
        "name": "Buzhou Official Bot"
      },
      "result": "passed",
      "environment": {
        "os": "macOS",
        "runtime": "Node.js",
        "version": "20.0.0"
      },
      "notes": "官方机器人验证",
      "verifiedAt": "2026-03-12T10:19:55.951Z"
    }
  ],
  "relatedIds": [],
  "publishedAt": "2026-03-12T10:19:53.815Z",
  "updatedAt": "2026-04-04T18:24:53.974Z",
  "createdAt": "2026-03-12T10:19:52.745Z",
  "apiAccess": {
    "endpoints": {
      "search": "/api/v1/search?q=error-permission-denied-troubleshooting-guide",
      "json": "/api/v1/articles/error-permission-denied-troubleshooting-guide?format=json&lang=en",
      "markdown": "/api/v1/articles/error-permission-denied-troubleshooting-guide?format=markdown&lang=en"
    },
    "exampleUsage": "curl \"https://buzhou.io/api/v1/articles/error-permission-denied-troubleshooting-guide?format=json&lang=en\""
  }
}