-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Environment: Windows 10, Python 3.11, poetry installation, latest mcp-document-reader.
Problem Description:
- In the poetry virtual environment, all path formats (absolute, relative, forward slash, backslash) can be correctly recognized by Python's Path().exists(), and the file does exist.
- However, when calling the MCP tool interface of mcp-document-reader (such as get_pdf_metadata), no matter which path is passed, it always reports "The file ... does not exist."
- File permissions, cwd, and path formats have all been checked and are correct. Directly calling PDFReader in readers.py with Python works fine.
Reproduction Steps:
- Place the PDF file (e.g., 1.pdf) in the cwd directory of mcp-document-reader.
- Enter the poetry shell, and manually test Path('1.pdf').exists(), which returns True.
- Use the MCP tool interface get_pdf_metadata to read the same path, and it always reports the file does not exist.
Expected Result:
- The MCP tool interface should be able to recognize local files just like Python code does.
Additional Info:
- This issue always occurs on Windows. Not tested on Linux.
- Detailed troubleshooting process and test code are attached below.
Appendix:
from pathlib import Path
print(Path("D:/mcp/mcp-document-reader/1.pdf").exists()) # True
print(Path("D:\\mcp\\mcp-document-reader\\1.pdf").exists()) # True
print(Path("1.pdf").exists()) # True
print(Path("./1.pdf").exists()) # True
print(Path(".\\1.pdf").exists()) # True
Thank you for your attention! Please let me know if you need more information.
Metadata
Metadata
Assignees
Labels
No labels