Skip to content

AIScientists-Dev/AI-Powered-PDF-Accessibility

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

MCP PDF/UA MIT License Python

AI-Powered PDF Accessibility

Make PDFs accessible to screen readers β€” automatically

Supports PDF and LaTeX input β€” outputs accessible PDF or modified LaTeX source.
Uses AI vision to generate alt-text for images, charts, and math formulas.
Adds semantic structure (headings, paragraphs, reading order) for screen reader navigation.
Validates against PDF/UA standard with a 0-100 accessibility score.

Turn hours of manual remediation into minutes.

Quick Start β€’ Features β€’ API Reference β€’ Deployment β€’ Contributing


About

This project was developed in collaboration with MorphMind.

Try it now β€” no setup required: agentlab.morphmind.ai (Free trial available)


πŸš€ Quick Start

Option 1: Use via MorphMind AgentLab (Recommended)

The easiest way β€” no setup required:

  1. Visit agentlab.morphmind.ai
  2. Find the PDF Accessibility Remediator agent
  3. Upload your PDF and get instant results

Free trial available β€” start remediating PDFs in seconds.

Option 2: Local Development

# Clone the repository
git clone https://github.com/AIScientists-Dev/AI-Powered-PDF-Accessibility.git
cd AI-Powered-PDF-Accessibility

# Create virtual environment
python3.11 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Install veraPDF (required for validation)
# macOS:
brew install verapdf
# Linux: Download from https://verapdf.org/software/

# Set up environment
echo "GEMINI_API_KEY=your_api_key_here" > .env

# Run the server
python -m uvicorn http_server:app --host 0.0.0.0 --port 8080

# Test it
curl http://localhost:8080/health

✨ Features

🎯 MorphMind Accessibility Score

Get an instant 0-100 score based on PDF/UA compliance, with letter grades and actionable insights.

{
  "score": 82,
  "grade": "B",
  "issues_by_severity": {
    "critical": 0,
    "serious": 3,
    "moderate": 1
  }
}

πŸ€– AI-Powered Alt-Text

Automatically generate descriptive alt-text for images and figures using Google Gemini vision AI.

πŸ“‹ 25 Specialized Tools

Category Tools
Analysis analyze_pdf, validate_pdfua, validate_pdfa, detect_headings
Remediation make_accessible, add_full_structure, add_alt_text, fix_link_alt_texts
Figures extract_figures, generate_alt_text, get_link_annotations
LaTeX analyze_latex, prepare_latex, make_latex_accessible
Education get_accessibility_tutorial

πŸ—οΈ Built on Standards

  • MCP (Model Context Protocol) - Open standard for AI tool integration
  • PDF/UA (ISO 14289) - International PDF accessibility standard
  • veraPDF - Industry-standard validation engine
  • WCAG 2.1 - Web Content Accessibility Guidelines alignment

πŸ“– API Reference

Agent-Optimized Endpoints

These endpoints return clean, structured JSON designed for AI agent consumption:

POST /agent/validate

Validate PDF against PDF/UA with MorphMind Score.

curl -X POST http://localhost:8080/agent/validate \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"pdf_path": "/path/to/file.pdf"}}'

Response:

{
  "success": true,
  "score": 82,
  "grade": "B",
  "compliant": false,
  "summary": {
    "passed_rules": 100,
    "failed_rules": 4
  },
  "issues_by_severity": {
    "critical": 0,
    "serious": 3,
    "moderate": 1,
    "minor": 0
  },
  "failures": [
    {
      "clause": "7.1",
      "test_number": "10",
      "description": "DisplayDocTitle key missing"
    }
  ]
}

POST /agent/make-accessible

Full remediation pipeline with AI alt-text generation.

curl -X POST http://localhost:8080/agent/make-accessible \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"pdf_path": "file_id", "document_type": "technical report"}}'

Response:

{
  "success": true,
  "output_file": "abc123_document_accessible.pdf",
  "figures_processed": 3,
  "structure_enhancements": {
    "headings_tagged": 15,
    "links_fixed": 8,
    "xmp_metadata_added": true
  }
}

Standard Endpoints

Endpoint Method Description
/health GET Health check
/tools GET List all available tools
/tools/{name} POST Execute any tool by name
/upload POST Upload PDF file, returns file_id
/download/{file_id} GET Download processed file
/batch POST Execute multiple tools in sequence

πŸ›οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Your Application                         β”‚
β”‚                  (AgentLab, MCP Clients, etc.)                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                β”‚
                                β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Accessibility Agent Backend                   β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚  HTTP API (Port 8080)   β”‚  β”‚  MCP Transport (Port 8081)  β”‚  β”‚
β”‚  β”‚  β€’ /agent/validate      β”‚  β”‚  β€’ Streamable HTTP          β”‚  β”‚
β”‚  β”‚  β€’ /agent/make-accessibleβ”‚  β”‚  β€’ API Key authenticated    β”‚  β”‚
β”‚  β”‚  β€’ /upload, /download   β”‚  β”‚                             β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚              β”‚                            β”‚                     β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                     β”‚
β”‚                         β–Ό                                       β”‚
β”‚              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                       β”‚
β”‚              β”‚   src/mcp_server.py     β”‚                       β”‚
β”‚              β”‚   25 Accessibility Tools β”‚                       β”‚
β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                       β”‚
β”‚                          β”‚                                      β”‚
β”‚    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”               β”‚
β”‚    β–Ό                     β–Ό                     β–Ό               β”‚
β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”          β”‚
β”‚ β”‚ veraPDF  β”‚      β”‚  Gemini AI β”‚      β”‚  pikepdf   β”‚          β”‚
β”‚ β”‚Validationβ”‚      β”‚  Alt-text  β”‚      β”‚PDF Editing β”‚          β”‚
β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜          β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🚒 Deployment

Self-Hosted Deployment

Deploy on any cloud provider (AWS, GCP, Azure) or on-premises:

# Clone and setup
git clone https://github.com/AIScientists-Dev/AI-Powered-PDF-Accessibility.git
cd AI-Powered-PDF-Accessibility

# Configure environment
cp .env.example .env
# Edit .env with your GEMINI_API_KEY

# Run with systemd (see deploy/ folder for service files)
./deploy/update-ec2.sh

CI/CD: Push to main triggers GitHub Actions deployment.

Environment Variables

Variable Description Required
GEMINI_API_KEY Google Gemini API key for alt-text generation Yes
PORT HTTP server port (default: 8080) No
HOST Bind address (default: 0.0.0.0) No
MCP_API_KEYS Comma-separated API keys for MCP transport No

🀝 Contributing

We welcome contributions! This project is open source under the MIT License.

Areas Where Help is Needed

  • 🌍 Internationalization - Support for more languages
  • πŸ“Š Table remediation - Improve complex table handling
  • πŸ“ Math accessibility - Better equation support
  • πŸ§ͺ Testing - More diverse PDF test cases
  • πŸ“š Documentation - Tutorials and guides

Development Setup

# Fork and clone
git clone https://github.com/YOUR_USERNAME/AI-Powered-PDF-Accessibility.git

# Install dev dependencies
pip install -r requirements.txt
pip install pytest black flake8

# Run tests
pytest

# Format code
black .

πŸ“Š Why Accessibility Matters

  • 1 billion+ people worldwide have disabilities (WHO)
  • 90%+ of PDFs lack proper accessibility features
  • Legal requirements in most countries (ADA, Section 508, EU Directive)
  • 2-4 hours β†’ 2-4 minutes: Time savings with AI automation

Built-in Educational Content

Ask the agent about accessibility:

curl -X POST http://localhost:8080/tools/get_accessibility_tutorial \
  -H "Content-Type: application/json" \
  -d '{"arguments": {"topic": "what_is_accessibility"}}'

Topics available:

  • what_is_accessibility - Introduction to PDF accessibility
  • common_struggles - Challenges people face
  • how_we_help - How AI agents solve these problems
  • getting_started - Quick start guide
  • about_project - About this project

πŸ“œ License

MIT License - Use freely, contribute back if you can.


πŸ”— Links


Built with ❀️ by MorphMind

About

AI-powered PDF accessibility remediation using MCP. Automatically fix PDF/UA compliance issues with alt-text generation, structure tagging, and heading detection.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors