# 🚀 Quick Start Guide

Get your PDF MCP Server up and running in 5 minutes!

## Step 1: Install Dependencies

```bash
cd /Users/ramyalakhani/Documents/MCPs/pdf-mcp
npm install
```

This will install all required packages and build the project automatically.

## Step 2: Test the Server

Run the server to make sure it's working:

```bash
npm start
```

You should see output like:
```
🚀 Starting PDF MCP Server v1.0.0
📄 Registering PDF tools...
  ✓ Registered: count-pdf-pages
  ✓ Registered: extract-pdf-text
  ✓ Registered: extract-pdf-metadata
  ✓ Registered: summarize-pdf
  ✓ Registered: answer-pdf-question
✅ All tools registered successfully
🔌 Connecting server to stdio transport...
✅ PDF MCP Server is ready and listening
📡 Transport: stdio
🎯 Available tools: 5

Waiting for MCP client connections...
```

Press `Ctrl+C` to stop the server.

## Step 3: Configure Claude Desktop

1. **Find your config file location**:
   - macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
   - Windows: `%APPDATA%\Claude\claude_desktop_config.json`

2. **Add this configuration** (create the file if it doesn't exist):

```json
{
  "mcpServers": {
    "pdf-operations": {
      "command": "node",
      "args": [
        "/Users/ramyalakhani/Documents/MCPs/pdf-mcp/dist/index.js"
      ]
    }
  }
}
```

3. **Restart Claude Desktop completely** (quit and reopen)

## Step 4: Test with Claude

Open Claude Desktop and try these commands:

### Test 1: Count Pages (if you have a PDF file)
```
How many pages are in /path/to/your/document.pdf?
```

### Test 2: Extract Text
```
Extract the text from /path/to/your/document.pdf
```

### Test 3: Get Metadata
```
What's the metadata of /path/to/your/document.pdf?
```

### Test 4: Summarize (requires LLM sampling support)
```
Summarize the main points of /path/to/your/document.pdf
```

### Test 5: Ask Questions (requires LLM sampling support)
```
Based on /path/to/your/document.pdf, what is the main topic?
```

## Step 5: Configure VS Code Copilot (Optional)

1. **Open VS Code settings.json**:
   - Press `Cmd+,` (macOS) or `Ctrl+,` (Windows)
   - Click "Open Settings (JSON)" icon

2. **Add this configuration**:

```json
{
  "github.copilot.mcp.servers": {
    "pdf-operations": {
      "command": "node",
      "args": [
        "/Users/ramyalakhani/Documents/MCPs/pdf-mcp/dist/index.js"
      ]
    }
  }
}
```

3. **Reload VS Code**: `Cmd+Shift+P` → "Developer: Reload Window"

4. **Test in Copilot Chat**:
   ```
   @workspace Count pages in /path/to/document.pdf
   ```

## Troubleshooting

### "Server not found" in Claude
- ✅ Check the path is absolute and correct
- ✅ Make sure you ran `npm install` and the build succeeded
- ✅ Restart Claude Desktop completely

### "File not found" errors
- ✅ Use absolute paths to PDF files
- ✅ Check file exists: `ls /path/to/file.pdf`
- ✅ Check file permissions

### "Cannot parse PDF" errors
- ✅ Make sure the file is a valid PDF
- ✅ PDFs must not be password-protected
- ✅ File size must be under 50MB (default limit)

## Next Steps

📚 Read the full documentation:
- [README.md](README.md) - Complete documentation
- [CLAUDE_DESKTOP_CONFIG.md](CLAUDE_DESKTOP_CONFIG.md) - Claude Desktop setup
- [VSCODE_CONFIG.md](VSCODE_CONFIG.md) - VS Code Copilot setup

🔧 Customize the server:
- Modify file size limits in `src/utils/pdf-utils.ts`
- Add new PDF tools in `src/tools/`
- Update server metadata in `src/index.ts`

## Success! 🎉

You now have a fully functional PDF MCP server that works with Claude Desktop and VS Code Copilot!

Try asking Claude to:
- Count pages in research papers
- Extract text from invoices
- Get metadata from technical documents
- Summarize lengthy reports
- Answer questions about PDF manuals

---

**Need help?** Open an issue or check the main [README.md](README.md)
