AI-powered tools for extending ERPNext with MCP (Model Context Protocol) integration
Features β’ Installation β’ Architecture β’ API β’ Documentation
Assist is a comprehensive Frappe/ERPNext app that extends your ERP system with AI-powered automation, marketplace integrations, and Norwegian business tools. It bridges the gap between traditional ERP systems and modern AI capabilities through the Model Context Protocol (MCP).
- πΈ Smart Image Processing - AI-powered background removal and enhancement for product photography
- π§Ύ Intelligent Receipt Scanning - OCR and automatic item extraction from receipts
- πͺ Multi-Platform Marketplace - Seamlessly post to Facebook Marketplace, FINN.no, leid.no
- π° Price Intelligence - Real-time price comparison across vendors and Prisjakt.no
- π Smart Logistics - Optimized pickup route planning for marketplace orders
- π’ Norwegian Compliance - Skatteetaten, Kommune, and NS 4102 accounting integration
- π¦ Warehouse Discovery - Automated warehouse finding on FINN.no
- π€ AI Integration - Full MCP server for AI model interaction
- π Technical Standards - RDS 81346 and S1000D documentation generation
- π§ DevOps Integration - GitHub repository management as ERP assets
graph TB
subgraph "External Services"
AI[AI Models via MCP]
Marketplaces[Marketplaces<br/>FB β’ FINN β’ leid.no]
Norwegian[Norwegian Services<br/>Skatteetaten β’ Kommune]
ImageAPI[Image APIs<br/>rembg β’ altlokalt]
Prisjakt[Price Services<br/>Prisjakt.no]
end
subgraph "Assist App"
direction TB
API[API Layer<br/>assist/api.py]
MCP[MCP Server<br/>mcp_server/server.py]
Utils[Utilities<br/>Image Processing]
Doctypes[Custom Doctypes<br/>Tool Drafts β’ Listings]
API --> Utils
API --> MCP
MCP --> Utils
MCP --> Doctypes
end
subgraph "ERPNext Core"
Items[Items & Stock]
Assets[Assets]
Accounting[Accounting]
Warehouse[Warehouses]
end
subgraph "User Interfaces"
UI[ERPNext Desk UI]
Mobile[Mobile/Camera]
AIUI[AI Assistants]
end
UI --> API
Mobile --> API
AIUI --> MCP
API --> Items
API --> Assets
API --> Accounting
API --> Warehouse
MCP --> AI
API --> Marketplaces
API --> Norwegian
Utils --> ImageAPI
API --> Prisjakt
style Assist App fill:#e1f5ff
style ERPNext Core fill:#fff4e6
style External Services fill:#f3e5f5
style User Interfaces fill:#e8f5e9
sequenceDiagram
participant User
participant Mobile
participant API
participant ImageProc as Image Processing
participant AI as AI Service
participant ERPNext
User->>Mobile: Capture product photo
Mobile->>API: POST quick_add_item(image, warehouse)
API->>ImageProc: process_camera_image()
alt Use AI Background Removal
ImageProc->>AI: remove_background()
AI-->>ImageProc: cleaned image
end
ImageProc->>ImageProc: enhance_image()
ImageProc-->>API: processed image
API->>ERPNext: Create Item with image
ERPNext->>ERPNext: Attach to warehouse
ERPNext-->>API: Item created
API-->>Mobile: Success + Item details
Mobile-->>User: Show confirmation
-
AI Background Removal
- Local processing with rembg
- Cloud API via altlokalt.com
- Automatic fallback mechanism
-
Image Enhancement
- Brightness, contrast, sharpness adjustment
- Batch processing support
- Multiple format support (PNG, JPG, WebP)
-
Camera Stock Upload β NEW!
- Quick add items using phone camera
- Batch upload for multiple items at once
- Automatic background removal and enhancement
- Intuitive mobile-first interface
- Real-time processing status tracking
-
Receipt Scanning
- OCR text extraction
- Automatic item detection
- Line item parsing with prices
Supported Platforms:
- Facebook Marketplace
- FINN.no (Norway's leading classifieds)
- leid.no (rental marketplace)
- bruktdel.no (used car parts) β NEW!
- Custom marketplace support
Features:
- Automated listing creation
- Image optimization
- Price suggestion
- Listing synchronization
- Phone-control automation
-
- Google Maps Route Generation β NEW!
- Automatic route link generation for pickup locations
- Multi-listing route optimization
- Seller contact tracking
- Packaging Management β NEW!
- Track packaging status (Pending/In Progress/Completed)
- Packaging notes and requirements
- Auto Photoshoot β NEW!
- Automated multi-angle product photography
- Integration with camera batch upload
- Background removal and enhancement =======
- Car Parts Tracking - Monitor bruktdel.no for new car parts linked to owned vehicle assets
- Marketplace Hustle Routine β NEW!
- Automatic monitoring of saved marketplace searches
- Smart matching with Material Requests and Tasks
- Real-time notifications when needed items appear
- Tracks building materials, pallets, equipment, and more
- Scheduled hourly checks for new listings
-
Accounting Standards
- NS 4102 (private sector)
- DFΓ standard (government)
- Automatic chart of accounts import
-
Government Services
- Skatteetaten API integration
- Employee registration
- Tax report submission
- Deadline monitoring
-
Municipal Services
- Building permit applications
- Property upgrade requests
- Renovation permits
-
Norwegian Support Programs Index β NEW!
- Comprehensive database of grants and deductions (stΓΈtte og fradrag)
- Support for private persons, companies, housing, and farms
- Enova stΓΈtte programs (energy efficiency, solar, heat pumps)
- Kommune support and building permits (byggesΓΈknad)
- Tax deductions from Skatteetaten (BSU, etc.)
- Husbanken loans and grants
- Innovasjon Norge business support
- Agricultural support from Landsbruksdirektoratet
- Kommune newsletter tracking with highlighted news
- Search and filter by entity type, provider, category
- Detailed requirements and document lists
The MCP server exposes ERPNext operations to AI models:
Built-in Tools:
- Inventory queries (natural language)
- Item creation and management
- Receipt processing
- Price comparison
- Route optimization
- Marketplace posting
Dynamic Tools:
- Create custom tools via UI
- Non-programmer friendly
- Automatic registration
- Parameter validation
- RDS 81346 - Reference designation system
- S1000D Issue 6 - Technical publication standard
- GitHub Integration - Repository as asset management
- Frappe/ERPNext v15+
- Python 3.10+
- bench CLI tool
# Navigate to your bench directory
cd $PATH_TO_YOUR_BENCH
# Get the app
bench get-app https://github.com/minfuel/assist.git
# Install on your site
bench --site your-site-name install-app assist
# Install Python dependencies
cd apps/assist
pip install -r requirements.txt
# Restart services
bench restartInstall based on features you need:
# Image processing (background removal, enhancement)
pip install rembg pillow
# MCP server (AI integration)
pip install "mcp[cli]"
# OCR capabilities (receipt scanning)
pip install pytesseract
# All optional features
pip install -e ".[all]"# Check app is installed
bench --site your-site-name list-apps
# Run in console to test
bench --site your-site-name console
>>> import assist
>>> assist.__version__
'0.0.1'If you're upgrading from the old erpnext_assist app:
# 1. Backup your site (IMPORTANT!)
bench --site your-site-name backup --with-files
# 2. Uninstall old version
bench --site your-site-name uninstall-app erpnext_assist
# 3. Get new version
bench get-app https://github.com/minfuel/assist.git
# 4. Install new version
bench --site your-site-name install-app assist
# 5. Install dependencies
cd apps/assist
pip install -r requirements.txt
# 6. Restart services
bench restartβ
All custom doctypes and their data
β
Marketplace listings
β
Tool drafts
β
Configuration settings
- App name:
erpnext_assistβassist - Import paths updated
- Enhanced documentation
- Optional dependency structure
See MIGRATION.md for detailed migration guide.
All endpoints are whitelisted and accessible via REST API.
# Remove background from image
POST /api/method/assist.api.remove_image_background
{
"image_data": "base64_string",
"enhance": true,
"use_altlokalt_api": false
}
# Enhance image quality
POST /api/method/assist.api.enhance_image
{
"image_data": "base64_string",
"brightness": 1.1,
"contrast": 1.1,
"sharpness": 1.2
}# Quick add item with camera
POST /api/method/assist.api.quick_add_item
{
"image_data": "base64_string",
"warehouse": "Main Warehouse",
"item_group": "Products",
"valuation_rate": 100.00,
"remove_background": true,
"enhance_image_quality": true
}
# Scan receipt and add items
POST /api/method/assist.api.scan_receipt
{
"receipt_image": "base64_string",
"add_as": "stock",
"warehouse": "Main Warehouse"
}# Compare prices across vendors
POST /api/method/assist.api.compare_prices
{
"item_name": "Product Name",
"search_prisjakt": true
}
# Plan pickup route
POST /api/method/assist.api.plan_pickup_route
{
"listings": ["listing-1", "listing-2"],
"start_location": "Oslo",
"preferred_date": "2026-01-20"
}
# Generate Google Maps route for multiple listings β NEW!
POST /api/method/assist.api.generate_marketplace_route
{
"listing_ids": "[\"ML-00001\", \"ML-00002\", \"ML-00003\"]",
"start_location": "Oslo, Norway"
}
# Auto photoshoot for rental items β NEW!
POST /api/method/assist.api.auto_photoshoot_rental_item
{
"listing_id": "ML-00001",
"remove_background": true,
"enhance_image": true,
"num_angles": 4
}
# Run marketplace hustle routine (manual trigger)
POST /api/method/assist.api.run_marketplace_hustle_routine
{}
# Get marketplace hustle routine status
POST /api/method/assist.api.get_marketplace_hustle_status
{}# Import Norwegian chart of accounts
POST /api/method/assist.api.import_norwegian_accounts
{
"standard": "NS4102", # or "DFO"
"company": "Your Company"
}
# Interact with Skatteetaten
POST /api/method/assist.api.interact_with_skatteetaten
{
"action": "employee_registration",
"data": "{...}"
}
# Get Norwegian support programs
POST /api/method/assist.api.get_norwegian_support_programs
{
"entity_type": "private_person", # or "company", "housing", "farm"
"provider": "Enova",
"category": "Energi"
}
# Get Enova support programs
POST /api/method/assist.api.get_enova_support_programs
{}
# Search support programs
POST /api/method/assist.api.search_support_programs
{
"search_term": "varmepumpe"
}
# Get kommune newsletters
POST /api/method/assist.api.get_kommune_newsletters
{
"kommune": "Oslo",
"is_highlighted": true
}See assist/api.py for complete endpoint documentation.
Configure the app through ERPNext's hooks system in hooks.py:
# Example: Add custom scheduled tasks
scheduler_events = {
"daily": [
"assist.tasks.sync_marketplace_listings"
]
}
# Example: Add custom API overrides
override_whitelisted_methods = {
"frappe.desk.get_items": "assist.api.get_enhanced_items"
}Configure via Desk β Setup β System Settings or create custom settings doctypes.
The marketplace hustle routine automatically monitors marketplace listings and matches them with your needs:
-
Create Saved Searches:
- Navigate to Assist Tools β Saved Marketplace Search
- Create a new search with your query (e.g., "byggningsmaterialer", "paller")
- Select the marketplace (Facebook Marketplace or FINN.no)
- Choose search type:
- material_request: Matches against open Material Requests
- purchase_request: Also matches against open Material Requests
- Mark as active
-
The routine automatically:
- Runs every hour via scheduled task
- Fetches new items matching your saved searches
- Compares items with open Material Requests and Tasks
- Creates notifications when matches are found
- Adds comments to matched documents with item details and links
-
Manual Trigger:
- Use API endpoint:
assist.api.run_marketplace_hustle_routine - Or via MCP tools in AI assistants
- Use API endpoint:
-
Monitor Status:
- Use API endpoint:
assist.api.get_marketplace_hustle_status - View saved searches to see last checked time and results found
- Use API endpoint:
# Clone and setup
cd ~/frappe-bench/apps
git clone https://github.com/minfuel/assist.git
cd assist
# Install pre-commit hooks
pre-commit install
# Install in development mode
pip install -e ".[all]"Pre-commit runs these checks automatically:
- ruff - Fast Python linter and formatter
- eslint - JavaScript linting
- prettier - Code formatting
- pyupgrade - Python syntax modernization
# Run all tests
bench --site your-site-name run-tests --app assist
# Run specific test
bench --site your-site-name run-tests --app assist --module assist.tests.test_api# Development mode
cd apps/assist/assist/mcp_server
mcp dev server.py
# Production mode
mcp run server.pyassist/
βββ assist/ # Main app module
β βββ api.py # API endpoints (18 methods)
β βββ hooks.py # Frappe hooks configuration
β βββ assist_tools/ # Custom doctypes
β β βββ doctype/
β β βββ assist_tool_draft/
β β βββ marketplace_listing/
β β βββ ...
β βββ config/ # Desktop and module config
β βββ mcp_server/ # MCP server implementation
β βββ utils/ # Utility functions
β β βββ image_processing.py
β βββ public/ # Static assets
β βββ templates/ # Jinja templates
βββ pyproject.toml # Python package configuration
βββ requirements.txt # Python dependencies
βββ README.md # This file
-
MIGRATION.md - Detailed migration guide from v0
-
NORWEGIAN_SUPPORT_PROGRAMS.md - Norwegian support programs and grants index
-
STANDARDS_TOOLS.md - RDS 81346 and S1000D technical standards
-
BRUKTDEL_TRACKING.md - Guide for tracking car parts on bruktdel.no
-
API Documentation - Complete API reference with examples
-
Hooks Reference - Available hooks and configuration
We welcome contributions! Here's how:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run tests and linting (
pre-commit run --all-files) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow PEP 8 for Python code
- Use type hints where applicable
- Write docstrings for all public methods
- Add tests for new features
- Update documentation as needed
- Enhanced AI model integration
- Support for more marketplaces (eBay, Amazon)
- Advanced inventory forecasting
- Multi-language support
- Mobile app companion
- Real-time price tracking dashboard
- Automated vendor negotiations
- Image processing requires significant memory for large images
- Some Norwegian services may require additional authentication
- MCP server needs separate port for AI model communication
- Never commit API keys or credentials
- Use environment variables for sensitive data
- Follow ERPNext security best practices
- Regularly update dependencies
To report security vulnerabilities, email: kontakt@drivstoffapp.no
MIT License - see license.txt for details.
Current Maintainer: sm norge
Email: kontakt@drivstoffapp.no
Repository: https://github.com/minfuel/assist
Original Author (v0): samletnorge
Built With:
- Frappe Framework
- ERPNext
- Model Context Protocol
- rembg - AI Background Removal
- Pillow - Image Processing
Special Thanks:
- The Frappe/ERPNext community
- Contributors to the MCP specification
- Norwegian business standards organizations
Made with β€οΈ in Norway π³π΄