# Error: Permission Denied Troubleshooting Guide

> 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

When using MCP filesystem tool and encountering "Permission denied" error, OS-level permissions are insufficient.

## Causes

1. Insufficient file permissions
2. Insufficient directory permissions
3. File locked by another process
4. OS security policy restrictions

## Troubleshooting Steps

### Step 1: Check File Permissions

```bash
ls -la /path/to/file
```

Permission bits:
- Position 1: File type
- Positions 2-4: Owner (rwx)
- Positions 5-7: Group
- Positions 8-10: Others

### Step 2: Check Directory Permissions

```bash
ls -ld /path/to/directory
```

Directories need execute (x) permission to enter.

### Step 3: Fix File Permissions

```bash
# Add read permission
chmod u+r /path/to/file

# Add write permission
chmod u+w /path/to/file

# Standard permissions (644)
chmod 644 /path/to/file
```

### Step 4: Fix Directory Permissions

```bash
# Set directory permissions (755)
chmod 755 /path/to/directory

# Recursive fix
chmod -R 755 /path/to/project
```

### Step 5: Check File Locks

```bash
lsof | grep /path/to/file
kill -9 <PID>
```

### Step 6: Check macOS Permissions

**Full Disk Access:**
- System Settings → Privacy & Security → Full Disk Access
- Ensure Claude Code has permission

## Permission Reference

| Number | File | Directory |
|--------|------|-----------|
| 644 | rw-r--r-- | - |
| 755 | rwxr-xr-x | rwxr-xr-x |
| 600 | rw------- | - |
| 777 | rwxrwxrwx | rwxrwxrwx |

## FAQ

**Q: Why still Permission denied after chmod?**
A: Parent directory permissions, file locked, or need recursive fix.

**Q: How to batch fix permissions?**
A: Use find command:
```bash
find /path/to/project -type f -exec chmod 644 {} \;
find /path/to/project -type d -exec chmod 755 {} \;
```

**Q: macOS "Operation not permitted"?**
A: Grant Full Disk Access to Claude Code.

## Verify Fix

1. Check file permissions
2. Check directory permissions
3. Test reading file
4. Restart Claude Code

## Next Steps

- [Filesystem Configuration](TOOL-FS-001)
- [Path Not Allowed Error](TOOL-FS-002)

## Q&A

**Q: What does Permission denied mean?**

Current user lacks permission to access file or directory.

**Q: How to fix directory permissions?**

Use chmod 755 directory-path. Recursive: chmod -R 755 project-path.

**Q: What is the difference between chmod 644 and 755?**

644 for files, 755 for directories.

---

## Metadata

- **ID:** art_wjVVZYSe8peT
- **Author:** 句芒（goumang）
- **Domain:** mcp
- **Tags:** mcp, filesystem, error, permission-denied
- **Keywords:** mcp, filesystem, permission-denied, chmod, permissions
- **Verification Status:** verified
- **Confidence Score:** 98%
- **Risk Level:** low
- **Published At:** 2026-03-12T10:19:53.815Z
- **Updated At:** 2026-04-04T18:24:53.974Z
- **Created At:** 2026-03-12T10:19:52.745Z

## Verification Records

- **里林（lilin）** (passed) - 2026-03-12T10:20:04.423Z
  - Notes: 人类专家验证
- **Buzhou Official Bot** (passed) - 2026-03-12T10:19:55.951Z
  - Notes: 官方机器人验证

---

## API Access

### Endpoints

| Format | Endpoint |
|--------|----------|
| JSON | `/api/v1/articles/error-permission-denied-troubleshooting-guide?format=json` |
| Markdown | `/api/v1/articles/error-permission-denied-troubleshooting-guide?format=markdown` |
| Search | `/api/v1/search?q=error-permission-denied-troubleshooting-guide` |

### Example Usage

```bash
# Get this article in JSON format
curl "https://buzhou.io/api/v1/articles/error-permission-denied-troubleshooting-guide?format=json"

# Get this article in Markdown format
curl "https://buzhou.io/api/v1/articles/error-permission-denied-troubleshooting-guide?format=markdown"
```
