
A Model Context Protocol (MCP) server platform for Apache OFBiz
概览
This project provides an implementation of a Model Context Protocol (MCP) server that runs custom tools to invoke remote services through API endpoints, based on requests from an MCP client (usually hosted in a generative AI application such as Claude Desktop). The project is implemented with the , and requires as runtime environment. By leveraging the sample configuration and tool files contained in the examples folder, the MCP server can be easly configured, e.g., to point to specific backend systems and to use OAuth2.0 authorization flows, and new tools can be developed to address specific use cases. In short, this project can be used as a platform to implement your own tools and enable generative AI applications to interact with any backend system that exposes API endpoints, such as or . This software is licensed under the Apache License, Version 2.0. Apache OFBiz® is a trademark of the Apache Software Foundation.
README
以下为原文 README 节选,完整内容请查看原文。
MCP Server for Apache OFBiz®
This project provides an implementation of a Model Context Protocol (MCP) server that runs custom tools to invoke remote services through API endpoints, based on requests from an MCP client (usually hosted in a generative AI application such as Claude Desktop).
The project is implemented with the Anthropic TypeScript SDK, and requires Node.js as runtime environment.
By leveraging the sample configuration and tool files contained in the examples folder, the MCP server can be easly configured, e.g., to point to specific backend systems and to use OAuth2.0 authorization flows, and new tools can be developed to address specific use cases.
In short, this project can be used as a platform to implement your own tools and enable generative AI applications to interact with any backend system that exposes API endpoints, such as Apache OFBiz® or Moqui.
This software is licensed under the Apache License, Version 2.0.
Apache OFBiz® is a trademark of the Apache Software Foundation.
Table of Contents
- Quick-start guide
- Features
- Configuration
- Project Structure
- Build the Project
- Test the Remote MCP Server
- Inspect the MCP server
- Containerization with Docker
Quick-start guide
> git clone https://github.com/jacopoc/mcp-server-for-apache-ofbiz.git mcp-server
> cd mcp-server
mcp-server> npm install
mcp-server> cd examples/tools
mcp-server/examples/tools> npm install
mcp-server/examples/tools> npm run build
mcp-server/examples/tools> cd ..
mcp-server/examples> ./get_api_access_token.sh admin ofbiz ./config/config.json
mcp-server/examples> cd ..
mcp-server> node build/server.js ./examples/config ./examples/tools
To test the MCP server, start the MCP Inspector from another shell:
> npx @modelcontextprotocol/inspector
This command will open a browser window for the Inspector application. Click Add Servers and select Add manually. Choose a Server ID, select streamable-http as the transport, and specify the MCP server URL as http://localhost:3000/mcp. Click Add, then connect to the server using the toggle in the top-right corner.
Once connected, you can execute the findProductById tool, which fetches data from one of the public demo instances of Apache OFBiz. Select the Tools tab at the top of the page, select findProductById, and enter a valid product ID, such as GZ-1000.
Features
The MCP server communicates with the MCP client via MCP Streamable HTTP transport.
The server dynamically discovers custom tools contained in a directory, whose path is specified as a command-line argument when the server is lauched.
安装
npx -y mcp-remote http://localhost:3000/mcp --allow-http配置
{
"mcpServers": {
"Apache OFBiz": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/mcp", "--allow-http"]
}
}
}