mcp-for-apache-ofbiz
A proof of concept MCP server for Apache OFBiz
README
MCP Server for REST APIs
This project provides a prototype implementation of an MCP server that:
- exposes specific tools,
- receives requests from an MCP client (usually hosted in a generative AI application such as Claude Desktop),
- forwards those requests to a remote backend via RESTful API endpoints,
- is implemented using the Anthropic SDK for TypeScript.
The server enables generative AI applications to interact with remote systems that expose REST API endpoints, such as Apache OFBiz and Moqui.
The server is implemented in two versions, one that runs as a local MCP server (stdio transport) and one that runs as a remote MCP server (Streamable HTTP transport).
The project is implemented in TypeScript, uses the Anthropic TypeScript SDK, and requires:
- Node.js
- npm
Table of Contents
- Features
- Configuration
- Project Structure
- Build the Project
- Test the Local MCP Server
- Test the Remote MCP Server
- Inspect the MCP servers
Features
The project includes two alternative MCP servers:
- Local MCP server (
src/server.ts) — communicates with the MCP client via stdio transport. - Remote MCP server (
src/server-remote.ts) — communicates with the MCP client via MCP Streamable HTTP transport.
The servers are modular and dynamically discover MCP tools contained in the tools directory.
Each tool is defined and implemented in its own file. For example, the sample tool tools/findProductById.ts invokes an endpoint in Apache OFBiz to retrieve product information for a given ID. This works with an out-of-the-box (OOTB) OFBiz instance with the rest-api plugin installed.
Configuration
Server configuration is managed via config/config.json, which defines:
BACKEND_API_BASE— the base URL for backend REST API callsBACKEND_API_AUTH- the URL to get the OFBiz APIs access tokenBACKEND_AUTH_TOKEN— the token used to authorize backend API callsSERVER_PORT— the port on which the MCP server listens for client connections (required only for the remote server)
The authorization token for the OFBiz API can be easily generated and set up by running the script:
update_token.sh <user> <password>
This script retrieves a JWT for an OOTB OFBiz instance (e.g., https://demo-stable.ofbiz.apache.org/rest/auth/token).
Project Structure
mcp-prototypes/
├── config/
│ └── config.json # Server configuration (backend API base, auth token, etc.)
├── src/
│ ├── server.ts # Local MCP server (stdio transport)
│ ├── server-remote.ts # Remote MCP server (Streamable HTTP transport)
│ ├── toolLoader.ts # Loader of tool definitions from "tools/"
│ └── tools/
│ └── findProductById.ts # Example tool calling an Apache OFBiz REST endpoint
├── update_token.sh # Script to refresh backend auth token
├── package.json
├── tsconfig.json
└── README.md
Build the Project
npm install
npm run build
Test the Local MCP Server
You can test the local MCP server with Claude Desktop.
Edit or create the Claude Desktop configuration file:
~/Library/Application\ Support/Claude/claude_desktop_config.json
Add your local MCP server configuration:
{
"mcpServers": {
"Apache OFBiz": {
"command": "node",
"args": ["PATH_TO/mcp-prototypes/build/server.js"]
}
}
}
After updating the configuration file, launch Claude Desktop and try the following sample prompts:
- "Can you provide some information about the product WG-1111?"
- "Can you provide some information about a product?"
(Claude will ask for a product ID before invoking the tool.) - "Can you compare two products?"
(Claude will ask for two product IDs, invoke the tool twice, and then compare the results.)
Test the Remote MCP Server
Start the server:
node build/server-remote.js
You can test the local MCP server with Claude Desktop.
Edit or create the Claude Desktop configuration file:
~/Library/Application\ Support/Claude/claude_desktop_config.json
Add your local MCP server configuration:
{
"mcpServers": {
"Apache OFBiz": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3000/mcp", "--allow-http"]
}
}
}
Inspect the MCP servers
You can use Anthropic’s Inspector to easily test interactions with the local and remote MCP servers. You can do this also when a remote server is executed in your local host or private network, without requiring valid certificates or deploying the server on a publicly accessible host.
Run (and install) the Inspector with:
npx @modelcontextprotocol/inspector
This will open a browser window ready to test your MCP servers.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.