jbarn080/agentic-ai-n8n-ocr
If you are the rightful owner of agentic-ai-n8n-ocr and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Model Context Protocol (MCP) server is a powerful tool designed to enhance AI capabilities by providing a structured environment for model interaction and context management.
Agentic AI Agent with n8n, OCR, and MCP Server
A powerful agentic AI system that combines n8n workflow automation, OCR capabilities, Model Context Protocol (MCP) server integration, and Airtable database with a modern frontend form interface.
🌟 Features
- Agentic AI Workflows: Autonomous AI agent powered by n8n
- OCR Processing: Extract text from images and documents using Tesseract OCR
- MCP Server Integration: Connect to Model Context Protocol servers for enhanced AI capabilities
- Airtable Database: Robust data storage and management
- Frontend Form: User-friendly interface for document submission
- Docker Support: Easy deployment with Docker Compose
🏗️ Architecture
┌─────────────────┐
│ Frontend Form │
│ (React/HTML) │
└────────┬────────┘
│
▼
┌─────────────────┐
│ n8n Workflow │
│ (Orchestrator) │
└────┬───┬───┬────┘
│ │ │
▼ ▼ ▼
┌────┴┐ ┌┴───┐ ┌┴─────────┐
│ OCR │ │MCP │ │ Airtable │
│Tool │ │Srv │ │ DB │
└─────┘ └────┘ └──────────┘
📋 Prerequisites
- Docker and Docker Compose
- Node.js 18+ (for local development)
- Airtable account and API key
- Claude API key (for MCP server)
🚀 Quick Start
1. Clone the Repository
git clone https://github.com/yourusername/agentic-ai-n8n-ocr.git
cd agentic-ai-n8n-ocr
2. Configure Environment Variables
cp .env.example .env
Edit .env with your credentials:
# n8n Configuration
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=your_password
# Airtable Configuration
AIRTABLE_API_KEY=your_airtable_api_key
AIRTABLE_BASE_ID=your_base_id
# Claude API (for MCP)
ANTHROPIC_API_KEY=your_anthropic_api_key
# MCP Server
MCP_SERVER_PORT=3001
# Frontend
FRONTEND_PORT=3000
3. Start with Docker Compose
docker-compose up -d
This will start:
- n8n workflow engine (http://localhost:5678)
- MCP server (http://localhost:3001)
- Frontend application (http://localhost:3000)
- Tesseract OCR service
4. Import n8n Workflows
- Open n8n at http://localhost:5678
- Go to Workflows → Import
- Import the workflows from
n8n-workflows/directory
📁 Project Structure
agentic-ai-n8n-ocr/
├── README.md
├── docker-compose.yml
├── .env.example
├── n8n-workflows/
│ ├── ocr-processing-workflow.json
│ ├── agentic-ai-workflow.json
│ └── mcp-integration-workflow.json
├── mcp-server/
│ ├── package.json
│ ├── server.js
│ ├── tools/
│ └── prompts/
├── frontend/
│ ├── index.html
│ ├── app.js
│ ├── styles.css
│ └── package.json
├── docker/
│ ├── Dockerfile.mcp
│ ├── Dockerfile.ocr
│ └── Dockerfile.frontend
└── docs/
├── SETUP.md
├── WORKFLOWS.md
└── API.md
🔧 Configuration
Airtable Setup
- Create a new Airtable base
- Create tables:
- Documents: Store uploaded documents
- Fields:
Document ID,Filename,Upload Date,Status,OCR Text
- Fields:
- OCR Results: Store OCR processing results
- Fields:
Result ID,Document ID,Extracted Text,Confidence,Timestamp
- Fields:
- AI Responses: Store agent responses
- Fields:
Response ID,Document ID,Query,Response,Timestamp
- Fields:
- Documents: Store uploaded documents
n8n Workflow Configuration
The system includes three main workflows:
- OCR Processing Workflow: Handles document upload and OCR extraction
- Agentic AI Workflow: Processes requests with AI agent capabilities
- MCP Integration Workflow: Connects to MCP servers for enhanced AI features
🎯 Use Cases
- Document Processing: Upload documents, extract text via OCR, store in Airtable
- Intelligent Document Analysis: AI agent analyzes OCR results and provides insights
- Automated Data Entry: Extract information from forms and populate databases
- Content Summarization: Process large documents and generate summaries
- Multi-modal AI Queries: Combine text and image understanding
🔌 API Endpoints
Frontend Form Submission
POST /api/upload
Content-Type: multipart/form-data
MCP Server
POST /mcp/query
Content-Type: application/json
Body: { "prompt": "string", "context": {} }
n8n Webhook
POST /webhook/process-document
Content-Type: application/json
Body: { "documentId": "string", "action": "ocr|analyze|summarize" }
🛠️ Development
Running Locally
MCP Server
cd mcp-server
npm install
npm run dev
Frontend
cd frontend
npm install
npm start
Testing
# Test OCR processing
curl -X POST http://localhost:5678/webhook/process-document \
-F "file=@test-image.png"
# Test MCP server
curl -X POST http://localhost:3001/mcp/query \
-H "Content-Type: application/json" \
-d '{"prompt": "Analyze this document", "context": {}}'
📊 Monitoring
- n8n Executions: http://localhost:5678/executions
- MCP Server Logs:
docker-compose logs -f mcp-server - Airtable Dashboard: Your Airtable base URL
🔒 Security
- All API keys should be stored in environment variables
- Use HTTPS in production
- Enable n8n basic authentication
- Implement rate limiting on public endpoints
- Validate and sanitize all inputs
🤝 Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📝 License
This project is licensed under the MIT License - see the file for details.
🙏 Acknowledgments
- n8n - Workflow automation
- Tesseract OCR - OCR engine
- Anthropic MCP - Model Context Protocol
- Airtable - Database platform
📞 Support
For issues and questions:
- GitHub Issues: Create an issue
- Documentation: Check the
docs/folder - Email: support@yourproject.com
🗺️ Roadmap
- Add support for multiple OCR engines
- Implement real-time collaboration features
- Add support for more document formats
- Create mobile app
- Add analytics dashboard
- Implement webhook notifications
- Add multi-language support
Made with ❤️ for the AI automation community