Since your Express server is running locally, Claude Code can interact with it directly:
# Start your server first
npm start
# Then in Claude Code, I can make requests like:
curl -X POST http://localhost:3001/api/fill-url \
-H "Content-Type: application/json" \
-d '{
"file_url": "https://example.com/form.pdf",
"fields": {"name": "John Doe", "date": "2024-01-15"}
}'Claude Code can use MCP tools if they're configured. Add this to your MCP settings:
chmod +x mcp-server.jsCreate or edit ~/.config/mcp/settings.json:
{
"mcpServers": {
"pdf-form-engine": {
"command": "node",
"args": ["/Users/nickbianchi/mcp-server.js"],
"env": {
"PDF_ENGINE_URL": "http://localhost:3001"
}
}
}
}Create a custom command for Claude Code:
# Create claude-code command
mkdir -p ~/.claude-code/commands
cat > ~/.claude-code/commands/pdf-tools.md << 'EOF'
---
name: pdf-tools
description: PDF form extraction and filling tools
---
## Available PDF Commands
### Extract PDF Fields
```bash
curl -X POST http://localhost:3001/api/upload \
-F "pdf=@path/to/file.pdf"curl -X POST http://localhost:3001/api/fill-url \
-H "Content-Type: application/json" \
-d '{
"file_url": "PDF_URL_HERE",
"fields": {
"firstName": "VALUE",
"lastName": "VALUE"
}
}'curl -X POST http://localhost:3001/api/compare-templates \
-H "Content-Type: application/json" \
-d '{
"templateA": "template1",
"templateB": "template2"
}'EOF
Then use in Claude Code with: `/pdf-tools`
## Option 4: Direct Function Integration
For the most seamless experience, Claude Code can use the WebFetch tool:
```javascript
// In Claude Code, I can do:
const result = await WebFetch({
url: "http://localhost:3001/api/fill-url",
prompt: "Fill this PDF with the provided data",
method: "POST",
body: {
file_url: "https://example.com/form.pdf",
fields: {
name: "John Doe",
email: "john@example.com"
}
}
});
Ask me to:
- "Extract fields from this PDF: [URL]"
- "Fill out this form with my data: [provide JSON]"
- "Compare these two PDF templates"
I'll use the appropriate method to interact with your PDF Form Engine!