SDKs & Integrations
Official Integrations
MCP (Model Context Protocol)
Connect AI assistants like Claude Desktop, Cursor, and Windsurf to PDFlys tools via MCP.
{
"mcpServers": {
"pdflys": {
"command": "npx",
"args": ["-y", "@anthropic-ai/mcp-remote", "https://mcp.pdflys.com/sse"],
"env": {
"PDFLYS_API_KEY": "pdf_live_your_api_key_here"
}
}
}
}
See the full MCP setup guide for detailed instructions.
Community Libraries
Note
These are community-maintained. PDFlys does not provide official SDKs yet. If you build one, let us know and we'll list it here.
JavaScript / TypeScript
npm install pdflys
import { PDFlys } from "pdflys";
const client = new PDFlys({ apiKey: process.env.PDFLYS_API_KEY });
// Check a PDF
const result = await client.accessibility.check("./document.pdf");
console.log(`Score: ${result.score}/100 (${result.grade})`);
// Fix issues
const fixed = await client.accessibility.fix("./document.pdf", {
tier: "tier2",
checkIds: ["2.1", "2.2"],
});
Python
pip install pdflys
from pdflys import PDFlys
client = PDFlys(api_key="your_api_key")
result = client.accessibility.check("document.pdf")
print(f"Score: {result.score}/100 ({result.grade})")
CI/CD Integrations
GitHub Actions
Add accessibility checking to your CI pipeline:
name: Accessibility Check
on: [push, pull_request]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check PDFs
uses: pdflys/accessibility-action@v1
with:
api-key: ${{ secrets.PDFLYS_API_KEY }}
files: "docs/**/*.pdf"
min-score: 70
standards: wcag21aa,pdfua1
The action will:
- Find all PDF files matching the glob pattern
- Check each file for accessibility compliance
- Fail the build if any file scores below
min-score - Post a summary comment on pull requests
GitLab CI
accessibility:
image: node:20-alpine
script:
- npx pdflys-cli check docs/**/*.pdf --min-score 70
variables:
PDFLYS_API_KEY: $PDFLYS_API_KEY
CLI Tool
A command-line tool for local development and scripting:
npx pdflys-cli check document.pdf
Score: 85/100 (B)
Passed: 25 Failed: 3 Warnings: 2
Failures:
[3.1] Images have alt text — 4 images on pages 2, 5, 8, 12
[5.5] Reading order defined — Structure tree missing order hints
[2.2] Font encoding correct — 2 fonts missing ToUnicode maps
Fixable: 2 issues (Tier 1), 1 issue (Tier 2)
Run: npx pdflys-cli fix document.pdf --tier1 --tier2
CLI Commands
| Command | Description |
|---|---|
check <file> |
Check a single PDF |
check <glob> |
Check multiple PDFs |
fix <file> |
Apply auto-fixes |
report <file> |
Generate PDF or JSON report |
batch <dir> |
Submit directory for batch processing |
Request Headers
All integrations should include a User-Agent header identifying the client:
User-Agent: pdflys-js/1.0.0
User-Agent: pdflys-python/1.0.0
User-Agent: pdflys-action/1.0.0
This helps us understand usage patterns and prioritize SDK improvements.