Skip to content

Commit 6f8b726

Browse files
committed
Update README.md and config.json to enhance server configuration details
1 parent 7fafe24 commit 6f8b726

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

README.md

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,16 @@ The server:
5858

5959
Server configuration is managed via `config/config.json`, which defines:
6060

61-
- **`MCP_SERVER_BASE_URL`** — the base URL of the MCP server (Protected Resource Server in OAuth)
6261
- **`SERVER_PORT`** — the port on which the MCP server listens for client connections (required only for the remote server)
6362
- **`TLS_CERT_PATH`** — path to the file containing the certificate for TLS
6463
- **`TLS_KEY_PATH`** — path to the file containing the private key for TLS
6564
- **`TLS_KEY_PASSPHRASE`** — (optional) passphrase for the **`TLS_KEY_PATH`** file
6665
- **`MCP_SERVER_CORS_ORIGINS`** — CORS origin allowed
66+
- **`MCP_SERVER_DNS_REBINDING_PROTECTION_ALLOWED_HOSTS`** - list of allowed values for request header `Host` for DNS rebinding protection
67+
- **`MCP_SERVER_DNS_REBINDING_PROTECTION_ALLOWED_ORIGINS`** - list of allowed values for request header `Origin` for DNS rebinding protection
6768
- **`RATE_LIMIT_WINDOW_MS`** — time window in ms for the requests rate limiting feature
6869
- **`RATE_LIMIT_MAX_REQUESTS`** — max number of requests allowed in the time window
70+
- **`MCP_SERVER_BASE_URL`** — the base URL of the MCP server used to get OAuth metadata (Protected Resource Server in OAuth)
6971
- **`AUTHZ_SERVER_BASE_URL`** — the base URL of the Authorization (Authz) server (OAuth)
7072
- **`SCOPES_SUPPORTED`** — the scopes that the MCP client can request
7173
- **`BACKEND_API_BASE`** — the base URL for backend REST API calls
@@ -83,11 +85,7 @@ If either **`MCP_SERVER_BASE_URL`** or **`AUTHZ_SERVER_BASE_URL`** are not set,
8385

8486
If authorization is enabled, but either **`MCP_SERVER_CLIENT_ID`** or **`MCP_SERVER_CLIENT_SECRET`** are not set, token exchange is disabled.
8587

86-
If token exchange is not enabled, the access token for the OFBiz API can be set **`BACKEND_AUTH_TOKEN`** and can be easily generated and set by running the script:
87-
88-
`update_token.sh <user> <password>`
89-
90-
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`).
88+
If token exchange is not enabled, the access token for the OFBiz API can be set in **`BACKEND_AUTH_TOKEN`**.
9189

9290
---
9391

@@ -118,7 +116,16 @@ npm run build
118116

119117
## Test the MCP Server
120118

121-
Start the server:
119+
With the configuration file provided (`./config/config.json`) the MCP server operates over a plain HTTP connection at `http://localhost:3000/mcp`, with authorization and token exchange disabled, and invokes the APIs of one of the Apache OFBiz demo instances.
120+
121+
The access token required for the OFBiz APIs can be generated and set in **`BACKEND_AUTH_TOKEN`** by running the utility script
122+
123+
`update_token.sh <user> <password>`
124+
125+
with, e.g., `admin` and `ofbiz`, as user and password, respectively.
126+
This script retrieves a JWT for an OOTB OFBiz instance from `https://demo-stable.ofbiz.apache.org/rest/auth/token`, as specified in **`BACKEND_API_AUTH`**.
127+
128+
Start the server specifying the paths to the configuration and tools folders:
122129

123130
```sh
124131
node ./build/server.js ./config ./build/tools
@@ -144,6 +151,7 @@ Add your MCP server configuration:
144151
}
145152
}
146153
```
154+
147155
After updating the configuration file, launch Claude Desktop and try the following sample prompts:
148156

149157
- _"Can you provide some information about the product WG-1111?"_
@@ -153,9 +161,9 @@ After updating the configuration file, launch Claude Desktop and try the followi
153161
- _"Can you compare two products?"_
154162
(Claude will ask for two product IDs, invoke the tool twice, and then compare the results.)
155163

156-
## Inspect the MCP servers
164+
## Inspect the MCP server
157165

158-
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.
166+
You can use Anthropic’s **Inspector** to easily test interactions with the MCP server.
159167

160168
Run (and install) the Inspector with:
161169

@@ -167,36 +175,36 @@ This will open a browser window ready to test your MCP servers.
167175

168176
## Containerization with Docker
169177

170-
The following instructions describe how to containerize the application using Docker.
178+
The following instructions describe how to containerize the MCP server using Docker and the Dockerfile provided.
171179

172-
First, build a Docker image:
180+
First, build a Docker image named, e.g., `mcp4ofbiz-image`:
173181

174182
```sh
175-
docker build -t mcp-server-for-apache-ofbiz .
183+
docker build -t mcp4ofbiz-image .
176184
```
177185

178186
If your target environment uses a different CPU architecture than your development machine (for example, if you're working on an Apple M1 but deploying to an amd64 platform), make sure to build the image for the correct target architecture:
179187

180188
```sh
181-
docker build --platform=linux/amd64 -t mcp-server-for-apache-ofbiz .
189+
docker build --platform=linux/amd64 -t mcp4ofbiz-image .
182190
```
183191

184-
After building the image, create a container
192+
After building the image, create a container, e.g., named `mcp4ofbiz-container`
185193

186194
```sh
187-
docker create --name my-mcp-server-for-apache-ofbiz -p 3000:3000 -v ${PWD}/config:/usr/src/app/config -v ${PWD}/build/tools:/usr/src/app/build/tools test1 ./config ./build/tools
195+
docker create --name mcp4ofbiz-container -p 3000:3000 -v ${PWD}/config:/usr/src/app/config -v ${PWD}/build/tools:/usr/src/app/build/tools mcp4ofbiz-image ./config ./build/tools
188196
```
189197

190198
and run it
191199

192200
```sh
193-
docker start my-mcp-server-for-apache-ofbiz
201+
docker start mcp4ofbiz-container
194202
```
195203

196204
The MCP server will be available at http://localhost:3000/mcp.
197205

198206
If you wish, you can push the image to your registry by running
199207

200208
```sh
201-
docker push myregistry.com/apache-ofbiz-mcp-server
209+
docker push myregistry.com/mcp4ofbiz-image
202210
```

config/config.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
2-
"BACKEND_API_BASE": "https://demo-stable.ofbiz.apache.org",
3-
"BACKEND_API_AUDIENCE": "https://demo-stable.ofbiz.apache.org",
4-
"BACKEND_API_RESOURCE": "https://demo-stable.ofbiz.apache.org",
5-
"BACKEND_API_AUTH": "https://demo-stable.ofbiz.apache.org/rest/auth/token",
6-
"BACKEND_ACCESS_TOKEN": "",
7-
"AUTHZ_SERVER_BASE_URL": "",
8-
"MCP_SERVER_BASE_URL": "",
92
"SERVER_PORT": 3000,
10-
"RATE_LIMIT_WINDOW_MS": 60000,
11-
"RATE_LIMIT_MAX_REQUESTS": 100,
12-
"TLS_KEY_PATH": "",
133
"TLS_CERT_PATH": "",
4+
"TLS_KEY_PATH": "",
145
"TLS_KEY_PASSPHRASE": "",
156
"MCP_SERVER_CORS_ORIGINS": ["*"],
167
"MCP_SERVER_DNS_REBINDING_PROTECTION_ALLOWED_HOSTS": [],
178
"MCP_SERVER_DNS_REBINDING_PROTECTION_ALLOWED_ORIGINS": [],
9+
"RATE_LIMIT_WINDOW_MS": 60000,
10+
"RATE_LIMIT_MAX_REQUESTS": 100,
11+
"MCP_SERVER_BASE_URL": "",
12+
"AUTHZ_SERVER_BASE_URL": "",
1813
"SCOPES_SUPPORTED": ["mcp:call-tools"],
14+
"BACKEND_API_BASE": "https://demo-stable.ofbiz.apache.org",
1915
"MCP_SERVER_CLIENT_ID": "",
2016
"MCP_SERVER_CLIENT_SECRET": "",
21-
"TOKEN_EXCHANGE_SCOPE": ["ofbiz:use-api"]
17+
"BACKEND_API_AUDIENCE": "https://demo-stable.ofbiz.apache.org",
18+
"BACKEND_API_RESOURCE": "https://demo-stable.ofbiz.apache.org",
19+
"TOKEN_EXCHANGE_SCOPE": ["ofbiz:use-api"],
20+
"BACKEND_API_AUTH": "https://demo-stable.ofbiz.apache.org/rest/auth/token",
21+
"BACKEND_ACCESS_TOKEN": ""
2222
}

0 commit comments

Comments
 (0)