Describe the Bug
AI Agent Filesystem API “Access Denied” in Allowed Directory (Path Resolution Bug)
Steps to Reproduce
The AI agent’s filesystem API (e.g., mcp_filesystem_write_file, edit_file) returns an “Access denied - path outside allowed directories” error when attempting to write to files within the allowed project directory, even though shell/manual operations work as expected. This blocks all AI-driven file editing/creation in legitimate project subdirectories.
- Environment
Platform: Cursor (or specify your IDE/AI agent platform)
Operating System: Windows 10 (or your OS version)
Project Root: C:\Development\HISCore\NR3\cobol
AI Model: auto
API Used: mcp_filesystem_write_file, edit_file, etc.
1.Open a workspace in Cursor with the root at C:\Development\HISCore\NR3\cobol.
2.Use the AI agent to create or write to a file in a subdirectory (e.g., HYGCTKF.Chemotherapy/docs/current_test_enhance.md).
3.Observe the error:
Error: Access denied - path outside allowed directories:
C:\Users\yourname\HYGCTKF.Chemotherapy\docs\current_test_enhance.md not in c:\Development\HISCore\NR3\cobol
- Try the same operation in the shell (e.g., echo test > current_test_enhance.md)—it works as expected.
Expected Behavior
The AI agent should be able to create and write files in any subdirectory of the allowed root, as long as the shell and manual operations can do so.
Screenshots / Screen Recordings
Operating System
Windows 10/11
Current Cursor Version (Menu → About Cursor → Copy)
版本: 1.2.2 (user setup)
認可: 1.99.3
日期: faa03b17cce93e8a80b7d62d57f5eda6bb6ab9f0
Electron: 2025-07-07T06:19:13.016Z
ElectronBuildId: 34.5.1
Chromium: undefined
Node.js: 132.0.6834.210
V8: 20.19.0
OS: 13.2.152.41-electron.0
