This guide shows how to configure the MCP Document Converter (PDF and Word support) with Claude Code CLI.
ALWAYS use this pattern to run Python scripts in this project:
# From project root (/Users/wadearnold/Documents/GitHub/wadearnold/mcp-document-markdown):
cd /Users/wadearnold/Documents/GitHub/wadearnold/mcp-document-markdown && venv/bin/python python/<script_name>.py <args>
# Example:
cd /Users/wadearnold/Documents/GitHub/wadearnold/mcp-document-markdown && venv/bin/python python/debug_pdf_extraction.py sample_document.pdfDO NOT try these incorrect variations:
- ❌
source venv/bin/activate && python ...(shell builtin issues) - ❌
./venv/bin/python ...(path resolution issues) - ❌
python3 ...(wrong Python environment) - ❌ Changing directories then running (path confusion)
-
Install Claude Code CLI (if not already installed)
-
Setup the MCP server:
cd /path/to/mcp-document-markdown make setup -
Get configuration details:
make run
This will show you the exact command and args paths to use in the next step. Copy these values for configuration.
Copy the Command and Args values from make run output and use them like this:
# Template (replace with your actual paths from 'make run'):
claude mcp add document-markdown -- "COMMAND_PATH" "ARGS_PATH"
# Real example:
claude mcp add document-markdown -- "/Users/username/Documents/mcp-document-markdown/venv/bin/python" "/Users/username/Documents/mcp-document-markdown/mcp_document_markdown.py"📋 Copy-Paste Steps:
- Run
make runand copy the Command path - Copy the Args path
- Use both in quotes as shown above
claude mcp add document-markdown --env OUTPUT_DIR=./docs -- "COMMAND_PATH" "ARGS_PATH"Create or edit your MCP configuration file using the paths from make run:
{
"mcpServers": {
"document-markdown": {
"command": "[COMMAND_FROM_MAKE_RUN]",
"args": ["[ARGS_FROM_MAKE_RUN]"],
"env": {
"OUTPUT_DIR": "./docs"
}
}
}
}# List configured MCP servers
claude mcp list
# Get server details
claude mcp get document-markdown
# Remove the server
claude mcp remove document-markdown- Local: Private to current project
- Project: Shared via
.mcp.jsonfile - User: Available across all projects
Once configured, you can use these prompts in Claude Code:
PDF Examples:
Convert the PDF at ./documents/manual.pdf to markdown
Analyze the structure of ./pdfs/research-paper.pdf
Word Document Examples:
Convert the Word document at ./documents/report.docx to markdown
Analyze the structure of ./proposals/project-plan.docx
Multi-format:
Convert ./reports/quarterly.pdf and save to ./analysis/
- Claude Code automatically starts the Python MCP server when needed
- Files are saved relative to your current working directory (defaults to
./docs) - You can override the output directory in prompts: "Convert PDF to ./my-project/docs/"
- Multiple projects can use the same MCP server with different output locations
Server not found?
- Verify the Python script exists:
ls -la /path/to/mcp-document-markdown/mcp_document_markdown.py - Always use absolute paths - relative paths will fail
- Check the exact path with
pwdwhen in the repository directory
Python errors?
- Verify Python dependencies:
make setup - Test the server directly:
make run
Virtual environment errors?
- Recreate virtual environment:
make clean && make setup - Test imports:
./venv/bin/python -c "import pypdf, pdfplumber, fitz, mcp"
For more details, see the Claude Code MCP documentation.