Skip to content

Commit 735c602

Browse files
committed
Improve readme.md to reflect the latest enhancements.
1 parent e24eb57 commit 735c602

File tree

1 file changed

+48
-23
lines changed

1 file changed

+48
-23
lines changed

README.md

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
1-
# MCP Server for REST APIs
1+
# MCP Server for Apache OFBiz®
22

3-
This project provides a prototype implementation of an MCP server that:
3+
This project provides a prototype implementation of a Model Context Protocol (MCP) server for Apache OFBiz® that:
4+
5+
- receives requests from an MCP client (usually hosted in a generative AI application such as Claude Desktop) and forwards those requests to a remote backend via RESTful API endpoints,
6+
- exposes a tamplate tool that invokes the findProductById OFBiz endpoint.
47

5-
- exposes specific tools,
6-
- receives requests from an MCP client (usually hosted in a generative AI application such as Claude Desktop),
7-
- forwards those requests to a remote backend via RESTful API endpoints,
8-
- implements authorization according to the MCP specifications (OAuth Authorization Code Flow with support for Metadata discovery, Dynamic Client Registration etc...).
9-
10-
The server enables generative AI applications to interact with backend systems that expose REST API endpoints, such as **Apache OFBiz** and **Moqui**.
8+
The server can enable generative AI applications to interact with any backend system that exposes REST API endpoints, such as [**Apache OFBiz**](https://ofbiz.apache.org) or [**Moqui**](https://www.moqui.org).
119

1210
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).
1311

14-
The project is implemented in **TypeScript**, uses the **Anthropic TypeScript SDK**, and requires:
12+
The project leverages the **Anthropic TypeScript SDK**, and requires:
1513

1614
- Node.js
1715
- npm
1816

17+
This software is licensed under the Apache License, Version 2.0.
18+
19+
Apache OFBiz® is a trademark of the [Apache Software Foundation](https://www.apache.org)
20+
21+
1922
---
2023

2124
## Table of Contents
@@ -36,9 +39,19 @@ The project includes two alternative MCP servers:
3639
- **Local MCP server** (`src/server-local.ts`) — communicates with the MCP client via stdio transport.
3740
- **Remote MCP server** (`src/server-remote.ts`) — communicates with the MCP client via MCP Streamable HTTP transport.
3841

39-
The servers are modular and dynamically discover MCP tools contained in the `tools` directory.
42+
The servers dynamically discover MCP tools contained in the `tools` directory.
43+
44+
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 product ID. This works with an out-of-the-box (OOTB) OFBiz instance with the `rest-api` plugin installed.
4045

41-
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.
46+
New tools can be published by simply including their definition files in the `tools` folder.
47+
48+
The remote server:
49+
- is compliant with the latest MCP specifications
50+
- supports authorization according to the MCP recommendations (OAuth Authorization Code Flow with support for Metadata discovery, Dynamic Client Registration, etc...)
51+
- supports the token exchange OAuth flow in order to obtain a valid token for the backend system
52+
- performs token validation with configurable scopes and audience verification
53+
- provides rate limiting features to protect the MCP server and the backend server from denial of service attacks
54+
- allows CORS restrictions
4255

4356
---
4457

@@ -47,38 +60,50 @@ Each tool is defined and implemented in its own file. For example, the sample to
4760
Server configuration is managed via `config/config.json`, which defines:
4861

4962
- **`MCP_SERVER_BASE_URL`** — the base URL of the MCP server (Protected Resource Server in OAuth)
50-
- **`AUTHZ_SERVER_BASE_URL`** — the base URL of the Authorization server (OAuth)
51-
- **`BACKEND_API_BASE`** — the base URL for backend REST API calls
52-
- **`BACKEND_API_AUTH`** - the URL to get the OFBiz APIs access token
53-
- **`BACKEND_AUTH_TOKEN`** — the token used to authorize backend API calls
5463
- **`SERVER_PORT`** — the port on which the MCP server listens for client connections (required only for the remote server)
64+
- **`MCP_SERVER_CORS_ORIGINS`** — CORS origin allowed
65+
- **`AUTHZ_SERVER_BASE_URL`** — the base URL of the Authorization (Authz) server (OAuth)
66+
- **`BACKEND_API_BASE`** — the base URL for backend REST API calls
67+
- **`MCP_SERVER_CLIENT_ID`** — Client ID required for token exchange, as registered in Authz server
68+
- **`MCP_SERVER_CLIENT_SECRET`** — the secret associated with **`MCP_SERVER_CLIENT_ID`**
69+
- **`SCOPES_SUPPORTED`** — the scopes that the MCP client can request
70+
- **`BACKEND_API_AUDIENCE`** — the OAuth audience paramenter for the backend system
71+
- **`BACKEND_API_RESOURCE`** — the OAuth resource parameter for the backend system
72+
- **`BACKEND_API_AUTH`** - the URL to get the OFBiz APIs access token used if token exchange is not enabled
73+
- **`BACKEND_AUTH_TOKEN`** — the token to authorize backend API calls used if token exchange is not enabled
74+
- **`RATE_LIMIT_WINDOW_MS`** — time window in ms for the requests rate limiting feature
75+
- **`RATE_LIMIT_MAX_REQUESTS`** — max number of requests allowed in the time window
76+
5577

5678
If either **`MCP_SERVER_BASE_URL`** or **`AUTHZ_SERVER_BASE_URL`** are not set, authorization is disabled and the MCP server is publicly accessible.
5779

58-
The authorization token for the OFBiz API can be easily generated and set up by running the script:
80+
If authorization is enabled, but either **`MCP_SERVER_CLIENT_ID`** or **`MCP_SERVER_CLIENT_SECRET`** are not set, token exchange is disabled.
81+
82+
If token exchange is not enabled, the access token for the OFBiz API can be easily generated and set up by running the script:
5983

6084
`update_token.sh <user> <password>`
6185

62-
This script retrieves a JWT for an OOTB OFBiz instance (e.g., `https://demo-stable.ofbiz.apache.org/rest/auth/token`).
86+
This script retrieves a JWT for an OOTB OFBiz instance, as specified by **`BACKEND_API_AUTH`** (e.g., `https://demo-stable.ofbiz.apache.org/rest/auth/token`).
6387

6488
---
6589

6690
## Project Structure
6791

6892
```text
69-
mcp-prototypes/
93+
mcp-server-for-apache-ofbiz/
7094
├── config/
7195
│ └── config.json # Server configuration (backend API base, auth token, etc.)
7296
├── src/
73-
│ ├── server-local.ts # Local MCP server (stdio transport)
97+
│ ├── server-local.ts # Local MCP server (stdio transport)
7498
│ ├── server-remote.ts # Remote MCP server (Streamable HTTP transport)
7599
│ ├── toolLoader.ts # Loader of tool definitions from "tools/"
76100
│ └── tools/
77101
│ └── findProductById.ts # Example tool calling an Apache OFBiz REST endpoint
78102
├── update_token.sh # Script to refresh backend auth token
79103
├── package.json
80104
├── tsconfig.json
81-
└── README.md
105+
└── README.md # This readme file
106+
└── LICENSE # Apache License, Version 2.0
82107
```
83108

84109
## Build the Project
@@ -90,7 +115,7 @@ npm run build
90115

91116
## Test the Local MCP Server
92117

93-
You can test the local MCP server with **Claude Desktop**.
118+
You can test the local MCP server with the free version of **Claude Desktop**.
94119

95120
Edit or create the Claude Desktop configuration file:
96121

@@ -103,7 +128,7 @@ Add your local MCP server configuration:
103128
"mcpServers": {
104129
"Apache OFBiz": {
105130
"command": "node",
106-
"args": ["PATH_TO/mcp-prototypes/build/server-local.js"]
131+
"args": ["PATH_TO/mcp-server-for-apache-ofbiz/build/server-local.js"]
107132
}
108133
}
109134
}
@@ -123,7 +148,7 @@ Start the server:
123148
node build/server-remote.js
124149
```
125150

126-
You can test the local MCP server with **Claude Desktop**.
151+
You can test the local MCP server with the free version of **Claude Desktop**.
127152

128153
Edit or create the Claude Desktop configuration file:
129154

0 commit comments

Comments
 (0)