2dc86743 by Ean Schuessler

Implement clean Moqui-centric MCP v2.0 using built-in JSON-RPC

- Replace custom REST API with Moqui's native /rpc/json endpoint
- Implement MCP methods as standard Moqui services with allow-remote='true'
- Remove unnecessary custom layers (webapp, screens, custom JSON-RPC handler)
- Direct service-to-tool mapping for maximum simplicity
- Leverage Moqui's built-in authentication, permissions, and audit logging
- Comprehensive client examples for Python, JavaScript, and cURL
- Complete documentation with architecture overview and usage patterns

Key Changes:
- service/McpServices.xml: MCP methods as standard Moqui services
- component.xml: Minimal configuration, no custom webapp
- AGENTS.md: Updated for Moqui-centric approach
- entity/, data/: Minimal extensions, leverage built-in entities
- Removed: mcp.rest.xml, screen/ directory (unnecessary complexity)

This demonstrates the power of Moqui's built-in JSON-RPC support
for clean, maintainable MCP integration.
1 parent 8ad686a8
This diff is collapsed. Click to expand it.
<?xml version="1.0" encoding="UTF-8"?>
<!-- This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<https://creativecommons.org/publicdomain/zero/1.0/>. -->
<component xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/component-definition-3.xsd">
<!-- No dependencies - uses only core framework -->
<entity-factory load-path="entity/" />
<service-factory load-path="service/" />
<!-- Load seed data -->
<entity-factory load-data="data/McpSecuritySeedData.xml" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<https://creativecommons.org/publicdomain/zero/1.0/>. -->
<entity-facade-xml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/entity-facade-3.xsd">
<!-- MCP User Group -->
<moqui.security.UserGroup userGroupId="McpUser" description="MCP Server Users"/>
<!-- MCP Artifact Groups -->
<moqui.security.ArtifactGroup artifactGroupId="McpRestPaths" description="MCP REST Paths"/>
<moqui.security.ArtifactGroup artifactGroupId="McpServices" description="MCP Services"/>
<!-- MCP Artifact Group Members -->
<moqui.security.ArtifactGroupMember artifactGroupId="McpRestPaths" artifactName="/rest/s1/mcp-2" artifactTypeEnumId="AT_REST_PATH"/>
<moqui.security.ArtifactGroupMember artifactGroupId="McpServices" artifactName="org.moqui.mcp.*" artifactTypeEnumId="AT_SERVICE"/>
<!-- MCP Artifact Authz -->
<moqui.security.ArtifactAuthz userGroupId="McpUser" artifactGroupId="McpRestPaths" authzTypeEnumId="AUTHZT_ALLOW" authzActionEnumId="AUTHZA_ALL"/>
<moqui.security.ArtifactAuthz userGroupId="McpUser" artifactGroupId="McpServices" authzTypeEnumId="AUTHZT_ALLOW" authzActionEnumId="AUTHZA_ALL"/>
<!-- Add admin user to MCP user group for testing -->
<moqui.security.UserGroupMember userGroupId="McpUser" userId="ADMIN" fromDate="2025-01-01 00:00:00.000"/>
</entity-facade-xml>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!-- This software is in the public domain under CC0 1.0 Universal plus a
Grant of Patent License.
To the extent possible under law, the author(s) have dedicated all
copyright and related and neighboring rights to this software to the
public domain worldwide. This software is distributed without any warranty.
You should have received a copy of the CC0 Public Domain Dedication
along with this software (see the LICENSE.md file). If not, see
<https://creativecommons.org/publicdomain/zero/1.0/>. -->
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/entity-definition-3.xsd">
<!-- No custom entities needed - use Moqui's built-in entities directly -->
<!-- MCP uses standard Moqui authentication, audit logging, and permissions -->
</entities>
\ No newline at end of file