Transform Your ERP into an AI-Powered Command Center
Moqui MCP bridges the gap between cutting-edge AI and enterprise operations, enabling intelligent agents to interact directly with your business systems through the Model Context Protocol (MCP). Built on the robust Moqui Framework, this solution brings autonomous decision-making to every corner of your organization.
Enterprise-Grade Security: This powerful platform requires careful access control and proper authorization. Built on Moqui's proven security model, it ensures AI capabilities are deployed responsibly with full auditability.
- Smart Procurement: AI agents that analyze inventory, predict demand, and optimize purchasing decisions
- Dynamic Market Response: Real-time pricing adjustments based on supply chain data and market conditions
- Workforce Optimization: Intelligent scheduling and resource allocation powered by financial modeling
- Supply Chain Excellence: Automated coordination across global logistics networks
- Strategic Insights: AI-powered analysis of real sales trends and operational metrics
- Predictive Analytics: Financial forecasting grounded in actual business performance
- Proactive Risk Management: Continuous monitoring for anomalies, opportunities, and optimization
- Automated Compliance: Intelligent enforcement of business rules and regulatory requirements
- Collaborative AI Teams: Coordinated agents across Sales, Operations, Finance, and more
- Event-Driven Intelligence: Automated responses through Moqui's ECA/SECA framework
- Inter-Enterprise Coordination: AI agents that communicate and transact across organizational boundaries
- Digital Twin Simulations: Test and optimize strategies in a live business environment
Harness the Power of Agentic Architecture: Enterprise Resource Planning systems are naturally designed for role-based operations—HR, Sales, Production, Accounting each with distinct responsibilities and workflows. Moqui MCP transforms this organizational structure into an intelligent framework where AI agents assume authentic business personas, collaborate within established processes, and make decisions with real accountability. Your corporate hierarchy becomes the foundation for scalable AI automation.
From passive data systems to active business partners—AI that doesn't just analyze, but acts.
Moqui MCP creates a seamless bridge between AI assistants and your enterprise systems, transforming how intelligent agents interact with business operations. By implementing the Model Context Protocol (MCP), we've unlocked direct, secure access to Moqui's comprehensive service layer and entity model—giving AI the ability to not just read data, but to execute real business processes.
Imagine AI that can:
- Execute Business Logic: Create orders, process invoices, manage inventory—all through natural conversation
- Query Any Data: Access your complete entity model with intelligent schema discovery
- Work Securely: Every action respects Moqui's battle-tested authorization system
- Scale Naturally: From simple queries to complex multi-step business workflows
1. Service Tools: Business Operations as AI Functions
Moqui services become callable tools for AI agents. When you expose mantle.order.OrderServices.create#Order, the AI receives a complete JSON Schema definition including all parameters, types, and constraints. The agent can then create orders just like your application code does—with full validation, security checks, and business rule enforcement.
Example: An AI agent can analyze inventory levels, identify low stock items, find the best suppliers, and automatically generate purchase orders—all by calling exposed Moqui services.
2. Entity Resources: Your Data Model, Discoverable
Every entity in your Moqui system becomes an MCP resource. AI agents can:
- Discover what entities exist (
resources/list) - Learn entity schemas—fields, types, relationships (
resources/read) - Query data using Moqui's powerful entity engine
- Understand your business domain model automatically
Example: Ask "What customer fields are available?" and the AI reads the mantle.party.Party and mantle.party.Person schemas to understand your customer data structure.
The Result: AI agents that understand your business domain and can operate within it—like hiring an infinitely patient, perfectly compliant employee who never needs training.
The protocol gateway—handles JSON-RPC 2.0 communication between MCP clients (like Claude Desktop) and your Moqui instance. Manages WebSocket connections, session lifecycle, and message routing with full integration into Moqui's Visit tracking system.
The intelligence layer that makes everything work:
mcp#Initialize: Negotiates MCP protocol capabilities, establishes secure sessionsmcp#ToolList: Dynamically discovers authorized services and generates tool definitions with complete JSON schemas. Includes smart filtering (like theforClaudeparameter) to handle client-specific constraintsmcp#ResourceList: Exposes your entity model as discoverable resourcesmcp#ResourceRead: Returns detailed entity schemas including fields, relationships, and indexesmcp#CallTool: Routes tool calls to actual Moqui services, handling parameter transformation and result packaging
This is where Moqui's artifact authorization system shines. Every service call, every entity query goes through the same security checks your applications use. If a user can't access mantle.account.PaymentServices through your UI, they can't access it through MCP either. Zero compromise on security.
Moqui services can have complex parameter structures—nested Maps, Lists of objects, conditional requirements. Our schema generator recursively analyzes service definitions to produce accurate JSON Schema, including:
- Proper type mapping (Moqui types → JSON Schema types)
- Required vs optional parameters
- Nested object structures
- Array item types
- Enum values for status fields
🔧 Automatic Service Discovery Point the system at your component, and it finds all services the current user can access. No manual API definitions, no maintenance burden. As you add services, they automatically become available to AI agents (subject to authorization).
📚 Entity-as-Resource Pattern Following MCP's resource model, entities aren't just data—they're discoverable knowledge. AI agents can explore your schema, understand relationships, and learn your business domain organically.
🎯 Claude Desktop Ready
Some AI clients (looking at you, Claude) have tool name length limits. The forClaude parameter intelligently filters the tool list to stay within constraints while maximizing available functionality.
🔒 Security-First Design Built on Moqui's proven artifact authorization system. Every exposed service, every entity query, every tool call is subject to the same security rules that protect your web applications and APIs.
⚡ Session Continuity MCP sessions integrate with Moqui's Visit system, maintaining context across multiple interactions. The AI "remembers" what it's working on, just like a user session in your web app.
Moqui's service-oriented architecture is uniquely suited for AI integration:
- Self-Documenting: Service definitions include parameter metadata that generates perfect API schemas
- Transaction-Safe: Every service call runs in Moqui's transaction management system
- Event-Driven: SECA rules fire on AI actions just like user actions—full business logic preservation
- Multi-Tenant Ready: Organization filtering and data isolation work automatically
- Auditable: Every AI action flows through Moqui's audit logging system
-
Clone into your Moqui runtime:
cd runtime/component git clone https://github.com/yourusername/moqui-mcp.git -
Configure your MCP client:
For Claude Desktop (requires mcp-remote as Claude only supports stdio mode):
Add to your Claude Desktop MCP settings (
~/Library/Application Support/Claude/claude_desktop_config.jsonon macOS):{ "mcpServers": { "moqui-mcp": { "command": "npx", "args": [ "-y", "mcp-remote@latest", "http://localhost:8080/mcp/", "--allow-http", "--header", "Authorization:Basic ${AUTH_TOKEN}", "--header", "Content-Type:application/json", "--header", "Accept:application/json" ], "env": { "AUTH_TOKEN": "<your-base64-token>" } } } }Note: The
AUTH_TOKENis the Base64 encoding ofusername:password. Generate yours with:echo -n "your-username:your-password" | base64
For GitHub Copilot:
Add to your Copilot MCP settings:
{ "servers": { "moqui-mcp": { "type": "http", "url": "http://localhost:8080/mcp/", "requestInit": { "headers": { "Authorization": "Basic <your-base64-token>" } } } } }Replace
<your-base64-token>with your Base64-encodedusername:password. -
Start exploring:
- Ask AI to list available tools: "What services can you access?"
- Query your data model: "Show me the Order entity schema"
- Execute business operations: "Create a test order for customer ACME"
The component includes a comprehensive test suite in test/. Contributions are welcome! If you're building new features or fixing bugs, please add tests.
AI agents can look up orders, check shipment status, process returns, and update customer information—all through natural language while respecting your security policies.
Agents monitor inventory levels, analyze supplier performance, and generate purchase orders when stock falls below thresholds—operating within your defined business rules.
From invoice processing to payment reconciliation, AI can handle routine financial tasks while maintaining full audit trails and compliance requirements.
Instead of building custom dashboards, let AI query your entity model directly to answer business questions: "Which products had the highest returns last quarter?"
This project is released into the public domain under CC0 1.0 Universal plus a Grant of Patent License, maintaining consistency with the Moqui Framework licensing philosophy. Use it freely, modify it as needed, build commercial products with it—no strings attached.
- Moqui Framework - The foundation this builds upon. If you're new to Moqui, start here.
- MCP Specification - Understand the protocol that enables AI integration
- Mantle Business Artifacts - The business service layer that powers most MCP tools
- MarbleERP - Full ERP component for Moqui, pairs perfectly with MCP for AI-powered ERP
- SimpleScreens - UI components that can be enhanced with AI capabilities
- Moqui Documentation - Comprehensive guides to Moqui concepts
- Moqui Forum - Active community support and discussions
- MCP Documentation - Deep dive into Model Context Protocol
Community Support:
- Moqui Forum - MCP Discussion - Active discussion thread for MCP implementation
- Review Test Examples - Check
test/directory for working examples of tool calls and entity queries - Server Logs - Enable debug logging to see detailed protocol communication and service execution
Documentation:
- Moqui service definitions in your components
- Entity definitions (
.xmlfiles) - MCP protocol messages in server logs
We welcome contributions! Areas where help is especially valuable:
- Test Coverage: More test scenarios for complex service calls
- Documentation: Usage examples, best practices, integration guides
- Features: Enhanced schema generation, performance optimizations
- Bug Fixes: Edge cases in parameter mapping or security checks
Development Guidelines:
- Follow Moqui coding conventions
- Add tests for new features
- Update README with new capabilities
- Ensure security implications are considered
When reporting bugs or requesting features:
- Include Moqui version and component versions
- Provide example service definitions or entity schemas
- Share relevant server logs (with sensitive data removed)
- Describe expected vs actual behavior
The future of AI-powered enterprise systems is just beginning:
- Multi-Agent Orchestration: Multiple AI agents coordinating across business functions
- Autonomous Workflows: AI-driven approval chains and process automation
- Cross-System Integration: AI agents communicating between different Moqui instances
- Learning Systems: AI that improves business processes based on historical data
This is your foundation for building the intelligent enterprise. Start simple, experiment boldly, and share what you discover with the community.
Built with ❤️ for the Moqui and AI communities