Skip to content

Commit 5490236

Browse files
committed
fix: add TOON response format support and documentation
- Added RESPONSE_FORMAT environment variable to configure default response format (json/toon) - Documented TOON format as AI-optimized responses with natural language descriptions - Added format priority documentation: params.format > arguments.format > default - Updated manifest.json with response_format configuration option - Added X-Response-Format header support in HTTP bridge - Bumped version to 1.1.9
1 parent 76afc4e commit 5490236

File tree

6 files changed

+110
-6
lines changed

6 files changed

+110
-6
lines changed

README.en.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ For other MCP clients (Cursor, Windsurf, Gemini CLI, etc.) or if you want to man
125125
"PROFFIX_PASSWORD": "your-password",
126126
"PROFFIX_URL": "https://your-proffix.com",
127127
"PROFFIX_PORT": "11011",
128-
"PROFFIX_DATABASE": "your-db"
128+
"PROFFIX_DATABASE": "your-db",
129+
"RESPONSE_FORMAT": "json"
129130
}
130131
}
131132
}
@@ -198,6 +199,45 @@ The pfx MCP Server implements the standardized Model Context Protocol via JSON-R
198199
- `proffix_describe_endpoint` - Endpoint documentation
199200
- All specific Proffix API endpoints (Addresses, Articles, Orders, etc.)
200201

202+
### Response Formats
203+
204+
The server supports two response formats:
205+
206+
- **JSON** (default) - Structured JSON responses directly from the Proffix API
207+
- **TOON** (AI-optimized) - Enhanced responses with natural language descriptions, optimized for AI processing
208+
209+
**Format Activation:**
210+
211+
1. **Global** (recommended) - Applies to all calls:
212+
```json
213+
{
214+
"name": "proffix_call_endpoint",
215+
"arguments": {
216+
"endpointId": 9,
217+
"format": "toon",
218+
"params": {
219+
"limit": 10
220+
}
221+
}
222+
}
223+
```
224+
225+
2. **Per-Call** - Overrides global setting:
226+
```json
227+
{
228+
"name": "proffix_call_endpoint",
229+
"arguments": {
230+
"endpointId": 9,
231+
"params": {
232+
"limit": 10,
233+
"format": "toon"
234+
}
235+
}
236+
}
237+
```
238+
239+
**Priority:** `params.format` > `arguments.format` > `"json"` (default)
240+
201241
**Server URL:** `https://mcp.pfx.ch/api/server`
202242

203243
[🔧 Test Examples & Debugging](https://mcp.pfx.ch/debug.html)

README.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ Für andere MCP-Clients (Cursor, Windsurf, Gemini CLI, etc.) oder wenn du die Ko
125125
"PROFFIX_PASSWORD": "dein-passwort",
126126
"PROFFIX_URL": "https://dein-proffix.com",
127127
"PROFFIX_PORT": "11011",
128-
"PROFFIX_DATABASE": "deine-db"
128+
"PROFFIX_DATABASE": "deine-db",
129+
"RESPONSE_FORMAT": "json"
129130
}
130131
}
131132
}
@@ -198,6 +199,45 @@ Der pfx MCP Server implementiert das standardisierte Model Context Protocol übe
198199
- `proffix_describe_endpoint` - Endpoint-Dokumentation
199200
- Alle spezifischen Proffix API Endpoints (Adressen, Artikel, Aufträge, etc.)
200201

202+
### Response Formate
203+
204+
Der Server unterstützt zwei Antwortformate:
205+
206+
- **JSON** (Standard) - Strukturierte JSON-Antworten direkt von der Proffix API
207+
- **TOON** (AI-optimiert) - Angereicherte Antworten mit natürlichsprachigen Beschreibungen, optimiert für AI-Verarbeitung
208+
209+
**Format-Aktivierung:**
210+
211+
1. **Global** (empfohlen) - Gilt für alle Aufrufe:
212+
```json
213+
{
214+
"name": "proffix_call_endpoint",
215+
"arguments": {
216+
"endpointId": 9,
217+
"format": "toon",
218+
"params": {
219+
"limit": 10
220+
}
221+
}
222+
}
223+
```
224+
225+
2. **Per-Call** - Überschreibt globale Einstellung:
226+
```json
227+
{
228+
"name": "proffix_call_endpoint",
229+
"arguments": {
230+
"endpointId": 9,
231+
"params": {
232+
"limit": 10,
233+
"format": "toon"
234+
}
235+
}
236+
}
237+
```
238+
239+
**Priorität:** `params.format` > `arguments.format` > `"json"` (Standard)
240+
201241
**Server URL:** `https://mcp.pfx.ch/api/server`
202242

203243
[🔧 Test-Beispiele & Debugging](https://mcp.pfx.ch/debug.html)

bundle/manifest.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"name": "pfx-mcp-server",
44
"display_name": "Proffix Px5 MCP Server",
55
"description": "Connect AI assistants to your Forterro Proffix Px5 ERP system via MCP protocol",
6-
"long_description": "The Proffix Px5 MCP Server enables AI assistants like Claude to communicate directly with your Proffix ERP system. Access addresses, articles, orders and other Proffix functions without leaving the ERP system. All data is securely transmitted via your own Proffix REST API.",
7-
"version": "1.1.8",
6+
"long_description": "The Proffix Px5 MCP Server enables AI assistants like Claude to communicate directly with your Proffix ERP system. Access addresses, articles, orders and other Proffix functions without leaving the ERP system. All data is securely transmitted via your own Proffix REST API. Supports both JSON and TOON (AI-optimized) response formats.",
7+
"version": "1.1.9",
88
"icon": "icon.png",
99
"author": {
1010
"name": "pfx.ch",
@@ -86,6 +86,14 @@
8686
"title": "Proffix Database",
8787
"description": "Your Proffix database name",
8888
"required": true
89+
},
90+
"response_format": {
91+
"type": "string",
92+
"title": "Response Format",
93+
"description": "Default response format: 'json' (standard) or 'toon' (AI-optimized with natural language descriptions). Can be overridden per call.",
94+
"required": false,
95+
"default": "json",
96+
"enum": ["json", "toon"]
8997
}
9098
},
9199
"localization": {

mcp-http-bridge.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@
1616
* PROFFIX_URL - Proffix server URL
1717
* PROFFIX_PORT - Proffix server port
1818
* PROFFIX_DATABASE - Proffix database name
19+
* RESPONSE_FORMAT - Default response format: 'json' or 'toon' (optional)
20+
*
21+
* Response Formats:
22+
* json - Standard JSON response (default)
23+
* toon - AI-optimized format with natural language descriptions
24+
*
25+
* Format can be set globally via RESPONSE_FORMAT env var or per-call via
26+
* the 'format' parameter in tool arguments or params.
1927
*/
2028

2129
const https = require('https');
@@ -38,6 +46,9 @@ const PROFFIX_DATABASE = process.env.PROFFIX_DATABASE || '';
3846
// API Key from environment (Authorization header)
3947
const HTTP_AUTHORIZATION = process.env.HTTP_AUTHORIZATION || '';
4048

49+
// Response format from environment (optional)
50+
const RESPONSE_FORMAT = process.env.RESPONSE_FORMAT || '';
51+
4152
// Setup file logging
4253
const LOG_FILE = path.join(os.tmpdir(), 'pfx-mcp-bridge.log');
4354
const logStream = fs.createWriteStream(LOG_FILE, { flags: 'a' });
@@ -91,6 +102,11 @@ function makeRequest(jsonRpcRequest, callback) {
91102
headers['Authorization'] = HTTP_AUTHORIZATION;
92103
}
93104

105+
// Add Response Format header if provided
106+
if (RESPONSE_FORMAT) {
107+
headers['X-Response-Format'] = RESPONSE_FORMAT;
108+
}
109+
94110
const options = {
95111
hostname: serverUrl.hostname,
96112
port: serverUrl.port || (isHttps ? 443 : 80),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pfx-mcp-server",
3-
"version": "1.1.8",
3+
"version": "1.1.9",
44
"description": "MCP Server for Forterro Proffix Px5 ERP",
55
"main": "mcp-http-bridge.js",
66
"bin": {

server.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"url": "https://github.com/pitwch/pfx-mcp-server",
88
"source": "github"
99
},
10-
"version": "1.1.8",
10+
"version": "1.1.9",
1111
"remotes": [
1212
{
1313
"type": "streamable-http",

0 commit comments

Comments
 (0)