fms-odata-mcp 0.1.2 → 0.8.3-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +423 -35
- package/dist/bin/cli.d.ts +3 -0
- package/dist/bin/cli.d.ts.map +1 -0
- package/dist/bin/cli.js +11 -0
- package/dist/bin/cli.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +60 -9
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +55 -4
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +125 -16
- package/dist/connection.js.map +1 -1
- package/dist/fm-version.d.ts +63 -0
- package/dist/fm-version.d.ts.map +1 -0
- package/dist/fm-version.js +184 -0
- package/dist/fm-version.js.map +1 -0
- package/dist/http-server.d.ts +7 -0
- package/dist/http-server.d.ts.map +1 -0
- package/dist/http-server.js +57 -0
- package/dist/http-server.js.map +1 -0
- package/dist/http-transport.d.ts +17 -0
- package/dist/http-transport.d.ts.map +1 -0
- package/dist/http-transport.js +103 -0
- package/dist/http-transport.js.map +1 -0
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +41 -14
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +2 -2
- package/dist/logger.js.map +1 -1
- package/dist/odata-client.d.ts +171 -1
- package/dist/odata-client.d.ts.map +1 -1
- package/dist/odata-client.js +337 -22
- package/dist/odata-client.js.map +1 -1
- package/dist/odata-parser.d.ts +179 -4
- package/dist/odata-parser.d.ts.map +1 -1
- package/dist/odata-parser.js +334 -30
- package/dist/odata-parser.js.map +1 -1
- package/dist/simple-http-transport.d.ts +17 -0
- package/dist/simple-http-transport.d.ts.map +1 -0
- package/dist/simple-http-transport.js +150 -0
- package/dist/simple-http-transport.js.map +1 -0
- package/dist/tools/configuration.d.ts +6 -3
- package/dist/tools/configuration.d.ts.map +1 -1
- package/dist/tools/configuration.js +21 -4
- package/dist/tools/configuration.js.map +1 -1
- package/dist/tools/connection.d.ts +91 -0
- package/dist/tools/connection.d.ts.map +1 -1
- package/dist/tools/connection.js +457 -59
- package/dist/tools/connection.js.map +1 -1
- package/dist/tools/index.d.ts +631 -85
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +55 -22
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/odata.d.ts +258 -56
- package/dist/tools/odata.d.ts.map +1 -1
- package/dist/tools/odata.js +631 -57
- package/dist/tools/odata.js.map +1 -1
- package/dist/tools/schema.d.ts +213 -0
- package/dist/tools/schema.d.ts.map +1 -0
- package/dist/tools/schema.js +309 -0
- package/dist/tools/schema.js.map +1 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +10 -100
- package/dist/transport.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +36 -0
- package/dist/version.js.map +1 -0
- package/dist/working-http-transport.d.ts +24 -0
- package/dist/working-http-transport.d.ts.map +1 -0
- package/dist/working-http-transport.js +85 -0
- package/dist/working-http-transport.js.map +1 -0
- package/package.json +10 -6
package/README.md
CHANGED
|
@@ -3,16 +3,37 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/fms-odata-mcp)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
|
-
Model Context Protocol (MCP) server providing FileMaker Server OData 4.01 API integration
|
|
6
|
+
Model Context Protocol (MCP) server providing FileMaker Server OData 4.01 API integration
|
|
7
|
+
for AI assistants like Claude Desktop, Windsurf, Cursor, and Cline.
|
|
7
8
|
|
|
8
9
|
## Features
|
|
9
10
|
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
11
|
+
- **35 MCP Tools** for FileMaker database operations (29 standard + 6 optional schema editing)
|
|
12
|
+
- **Multi-File Support** - Connect to multiple databases simultaneously (`fm_odata_connect_multi`)
|
|
13
|
+
- **Session Management** - List and target active sessions per call
|
|
14
|
+
(`fm_odata_list_active_sessions`, per-call `connection` param)
|
|
15
|
+
- **Schema Discovery** - Merged schema across all active sessions (`fm_odata_describe_sessions`)
|
|
16
|
+
- **Database Discovery** - Explore tables, fields, and metadata
|
|
17
|
+
- **CRUD Operations** - Create, read, update, and delete records
|
|
18
|
+
- **Secure Connections** - SSL support for self-signed certificates
|
|
19
|
+
- **Connection Management** - Save and reuse database connections
|
|
20
|
+
- **OData 4.01 Standard** - Full query capabilities ($filter, $select, $orderby, $apply, etc.)
|
|
21
|
+
- **Password Redaction** - Credentials are scrubbed from debug logs
|
|
22
|
+
- **FileMaker 2025 Aggregation** - Server-side `$apply` via `fm_odata_aggregate` (v22.0.1+)
|
|
23
|
+
- **Type Casting & Parameterized Filters** - `fm_odata_cast` and `fm_odata_build_filter` (v21.1+)
|
|
24
|
+
- **Server Version Detection** - `fm_odata_get_server_version` reports the FM Server version
|
|
25
|
+
and a feature-compatibility map; version-gated tools fall back gracefully on older servers
|
|
26
|
+
- **FileMaker 2026 Metadata Comments** - Table/field comments and AI annotations extracted
|
|
27
|
+
from `$metadata` on v26+ servers (`fm_odata_list_tables` with `includeDetails`,
|
|
28
|
+
enriched `fm_odata_describe_sessions` output)
|
|
29
|
+
- **Automatic FMFID Resolution (v26+)** - Non-ASCII field names are automatically resolved
|
|
30
|
+
to stable internal `FMFID` IDs in `$filter` expressions, eliminating double-quote escaping
|
|
31
|
+
and preventing breakage on field renames. Falls back to auto-quoting on older servers.
|
|
32
|
+
- **Script Execution by FMSID (v26+)** - Run FileMaker scripts by stable internal `FMSID`
|
|
33
|
+
instead of script name, preventing integration breakage when scripts are renamed.
|
|
34
|
+
`fm_odata_list_scripts` exposes IDs so agents can prefer ID-based calls.
|
|
35
|
+
- **Schema Editing (DDL)** - Create/alter/delete tables, fields, and indexes via
|
|
36
|
+
FileMaker's OData schema endpoints (opt-in with `FM_ALLOW_SCHEMA_EDITS=true`)
|
|
16
37
|
|
|
17
38
|
## Quick Start
|
|
18
39
|
|
|
@@ -23,13 +44,24 @@ Model Context Protocol (MCP) server providing FileMaker Server OData 4.01 API in
|
|
|
23
44
|
npm install -g fms-odata-mcp
|
|
24
45
|
|
|
25
46
|
# Or local development
|
|
26
|
-
git clone https://github.com/fsans/
|
|
27
|
-
cd
|
|
47
|
+
git clone https://github.com/fsans/fms-odata-mcp.git
|
|
48
|
+
cd fms-odata-mcp
|
|
28
49
|
npm install
|
|
29
50
|
npm run build
|
|
30
51
|
```
|
|
31
52
|
|
|
32
|
-
|
|
53
|
+
> **Note:** This package was previously published as `filemaker-odata-mcp`. It has been
|
|
54
|
+
> renamed to `fms-odata-mcp` to align with the related `fms-*` repositories
|
|
55
|
+
> (`fms-odata-js`, `fms-odata-spec`). The old name is deprecated on npm; update your
|
|
56
|
+
> installs to `fms-odata-mcp`.
|
|
57
|
+
|
|
58
|
+
## Deployment Modes
|
|
59
|
+
|
|
60
|
+
### 1. MCP Server Mode (Default)
|
|
61
|
+
|
|
62
|
+
For use with AI assistants that support MCP (Claude Desktop, Windsurf, Cursor, Cline).
|
|
63
|
+
|
|
64
|
+
#### Setup for Claude Desktop
|
|
33
65
|
|
|
34
66
|
1. **Locate your Claude config file:**
|
|
35
67
|
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
@@ -40,7 +72,7 @@ npm run build
|
|
|
40
72
|
```json
|
|
41
73
|
{
|
|
42
74
|
"mcpServers": {
|
|
43
|
-
"filemaker": {
|
|
75
|
+
"filemaker-odata": {
|
|
44
76
|
"command": "npx",
|
|
45
77
|
"args": ["-y", "fms-odata-mcp"],
|
|
46
78
|
"env": {
|
|
@@ -48,22 +80,240 @@ npm run build
|
|
|
48
80
|
"FM_DATABASE": "YourDatabase",
|
|
49
81
|
"FM_USER": "your-username",
|
|
50
82
|
"FM_PASSWORD": "your-password",
|
|
51
|
-
"FM_VERIFY_SSL": "true"
|
|
83
|
+
"FM_VERIFY_SSL": "true",
|
|
84
|
+
"FM_ALLOW_SCHEMA_EDITS": "false"
|
|
52
85
|
}
|
|
53
86
|
}
|
|
54
87
|
}
|
|
55
88
|
}
|
|
56
89
|
```
|
|
57
90
|
|
|
91
|
+
> **Schema editing is disabled by default.** The 6 schema (DDL) tools (`fm_odata_create_table`,
|
|
92
|
+
> `fm_odata_add_fields`, `fm_odata_delete_table`, `fm_odata_delete_field`, `fm_odata_create_index`,
|
|
93
|
+
> `fm_odata_delete_index`) are **not registered** unless `FM_ALLOW_SCHEMA_EDITS` is set to `"true"`.
|
|
94
|
+
> When `"false"` (default), these tools are completely absent from the tool list and cannot be called.
|
|
95
|
+
> Set to `"true"` only if your FileMaker account has full-access (schema modification) privileges.
|
|
96
|
+
|
|
58
97
|
3. **For self-signed SSL certificates**, set `FM_VERIFY_SSL` to `"false"`
|
|
59
98
|
|
|
60
99
|
4. **Restart Claude Desktop**
|
|
61
100
|
|
|
101
|
+
#### Setup for Windsurf/Cursor
|
|
102
|
+
|
|
103
|
+
The server will be automatically detected when installed globally. For local development, add to your MCP config.
|
|
104
|
+
|
|
105
|
+
### 2. Standalone HTTP Server Mode
|
|
106
|
+
|
|
107
|
+
Run as a standalone HTTP server accessible from any application:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
# Set environment variables for HTTP mode
|
|
111
|
+
export MCP_TRANSPORT=http
|
|
112
|
+
export MCP_PORT=3333
|
|
113
|
+
export MCP_HOST=0.0.0.0 # Listen on all interfaces
|
|
114
|
+
|
|
115
|
+
# Run the server
|
|
116
|
+
fms-odata-mcp
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The server will start on `http://localhost:3333` with the following endpoints:
|
|
120
|
+
|
|
121
|
+
- **MCP endpoint**: `http://localhost:3333/mcp` (POST requests with JSON-RPC 2.0)
|
|
122
|
+
- **Health check**: `http://localhost:3333/health`
|
|
123
|
+
- **Server info**: `http://localhost:3333/mcp` (GET request)
|
|
124
|
+
|
|
125
|
+
#### Example HTTP Client Request
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
curl -X POST http://localhost:3333/mcp \
|
|
129
|
+
-H "Content-Type: application/json" \
|
|
130
|
+
-d '{
|
|
131
|
+
"jsonrpc": "2.0",
|
|
132
|
+
"id": 1,
|
|
133
|
+
"method": "tools/list",
|
|
134
|
+
"params": {}
|
|
135
|
+
}'
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### HTTPS Mode
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
export MCP_TRANSPORT=https
|
|
142
|
+
export MCP_PORT=3443
|
|
143
|
+
export MCP_CERT_PATH=/path/to/cert.pem
|
|
144
|
+
export MCP_KEY_PATH=/path/to/key.pem
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Integration Examples
|
|
148
|
+
|
|
149
|
+
**Python Example:**
|
|
150
|
+
|
|
151
|
+
```python
|
|
152
|
+
import requests
|
|
153
|
+
|
|
154
|
+
# List available tools
|
|
155
|
+
response = requests.post("http://localhost:3333/mcp", json={
|
|
156
|
+
"jsonrpc": "2.0",
|
|
157
|
+
"id": 1,
|
|
158
|
+
"method": "tools/list",
|
|
159
|
+
"params": {}
|
|
160
|
+
})
|
|
161
|
+
tools = response.json()
|
|
162
|
+
|
|
163
|
+
# Query records
|
|
164
|
+
response = requests.post("http://localhost:3333/mcp", json={
|
|
165
|
+
"jsonrpc": "2.0",
|
|
166
|
+
"id": 2,
|
|
167
|
+
"method": "tools/call",
|
|
168
|
+
"params": {
|
|
169
|
+
"name": "fm_odata_query_records",
|
|
170
|
+
"arguments": {
|
|
171
|
+
"table": "Contacts",
|
|
172
|
+
"filter": "City eq 'New York'"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**JavaScript Example:**
|
|
179
|
+
|
|
180
|
+
```javascript
|
|
181
|
+
// Connect to FileMaker
|
|
182
|
+
const response = await fetch('http://localhost:3333/mcp', {
|
|
183
|
+
method: 'POST',
|
|
184
|
+
headers: { 'Content-Type': 'application/json' },
|
|
185
|
+
body: JSON.stringify({
|
|
186
|
+
jsonrpc: '2.0',
|
|
187
|
+
id: 1,
|
|
188
|
+
method: 'tools/call',
|
|
189
|
+
params: {
|
|
190
|
+
name: 'fm_odata_connect',
|
|
191
|
+
arguments: {
|
|
192
|
+
server: 'https://your-server.com/fmi/odata/v4',
|
|
193
|
+
database: 'Contacts',
|
|
194
|
+
user: 'admin',
|
|
195
|
+
password: 'secret',
|
|
196
|
+
verifySsl: false
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
})
|
|
200
|
+
});
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 3. Docker Deployment
|
|
204
|
+
|
|
205
|
+
#### Option A: Using `start.sh` (Recommended)
|
|
206
|
+
|
|
207
|
+
The included `start.sh` script handles building, credential injection from `.env`, and container lifecycle:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
git clone https://github.com/fsans/fms-odata-mcp.git
|
|
211
|
+
cd fms-odata-mcp
|
|
212
|
+
cp .env.example .env
|
|
213
|
+
# Edit .env with your FileMaker credentials and set MCP_TRANSPORT=http, MCP_HOST=0.0.0.0
|
|
214
|
+
./start.sh
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The script will build TypeScript, build the Docker image, remove any existing container,
|
|
218
|
+
and start a fresh one. Logs are tailed automatically.
|
|
219
|
+
|
|
220
|
+
#### Option B: Using Docker Run
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
# Clone and build
|
|
224
|
+
git clone https://github.com/fsans/fms-odata-mcp.git
|
|
225
|
+
cd fms-odata-mcp
|
|
226
|
+
npm run build
|
|
227
|
+
docker build -t fms-odata-mcp:latest .
|
|
228
|
+
|
|
229
|
+
# Run the container
|
|
230
|
+
docker run -d \
|
|
231
|
+
--name fms-odata-mcp \
|
|
232
|
+
-p 3333:3333 \
|
|
233
|
+
-e FM_SERVER=https://your-filemaker-server.com \
|
|
234
|
+
-e FM_DATABASE=YourDatabase \
|
|
235
|
+
-e FM_USER=your-username \
|
|
236
|
+
-e FM_PASSWORD=your-password \
|
|
237
|
+
-e FM_VERIFY_SSL=false \
|
|
238
|
+
-e MCP_TRANSPORT=http \
|
|
239
|
+
-e MCP_HOST=0.0.0.0 \
|
|
240
|
+
-v ~/.fms-odata-mcp:/home/mcp/.fms-odata-mcp \
|
|
241
|
+
fms-odata-mcp:latest
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
> **Important:** Set `MCP_HOST=0.0.0.0` when running in a container. Using `localhost` binds only to the container's loopback interface and makes the port unreachable from outside.
|
|
245
|
+
|
|
246
|
+
#### Option C: Using Docker Compose
|
|
247
|
+
|
|
248
|
+
1. **Clone and build:**
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
git clone https://github.com/fsans/fms-odata-mcp.git
|
|
252
|
+
cd fms-odata-mcp
|
|
253
|
+
npm run build
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
2. **Configure environment:**
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
cp docker-compose.yml my-docker-compose.yml
|
|
260
|
+
# Edit my-docker-compose.yml with your FileMaker credentials
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
3. **Start the server:**
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
docker-compose -f my-docker-compose.yml up -d
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### Option D: Docker Compose with HTTPS
|
|
270
|
+
|
|
271
|
+
```bash
|
|
272
|
+
# Start with Nginx reverse proxy for HTTPS
|
|
273
|
+
docker-compose -f docker-compose.yml --profile https up -d
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
Place your SSL certificates in the `./ssl` directory:
|
|
277
|
+
- `ssl/cert.pem` - SSL certificate
|
|
278
|
+
- `ssl/key.pem` - SSL private key
|
|
279
|
+
|
|
280
|
+
#### Docker Features
|
|
281
|
+
|
|
282
|
+
- **Health checks** - Automatic monitoring of server status
|
|
283
|
+
- **Persistent connections** - Mount volume to save connection configurations
|
|
284
|
+
- **Non-root user** - Security best practices
|
|
285
|
+
- **Alpine Linux** - Small image size (~50MB)
|
|
286
|
+
- **Signal handling** - Graceful shutdown with dumb-init
|
|
287
|
+
|
|
288
|
+
#### Accessing the Server
|
|
289
|
+
|
|
290
|
+
Once running, access the server at:
|
|
291
|
+
- HTTP: `http://localhost:3333`
|
|
292
|
+
- HTTPS (with Nginx): `https://localhost`
|
|
293
|
+
|
|
294
|
+
Check the health endpoint:
|
|
295
|
+
|
|
296
|
+
```bash
|
|
297
|
+
curl http://localhost:3333/health
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 4. Dify Integration
|
|
301
|
+
|
|
302
|
+
To use this server as an MCP tool in [Dify](https://dify.ai):
|
|
303
|
+
|
|
304
|
+
1. Start the server in HTTP mode (see Docker Deployment above)
|
|
305
|
+
2. In Dify, add a new MCP tool with:
|
|
306
|
+
- **Transport:** `streamable_http`
|
|
307
|
+
- **URL:** `http://host.docker.internal:3333/mcp` (if Dify runs in Docker on the same host)
|
|
308
|
+
3. No authentication headers are required
|
|
309
|
+
|
|
310
|
+
> **Note:** If Dify returns a 403 error, check your SSRF proxy configuration. Dify uses a Squid proxy to prevent SSRF attacks — port 3333 must be added to the `Safe_ports` ACL in `squid.conf`.
|
|
311
|
+
|
|
62
312
|
### First Steps
|
|
63
313
|
|
|
64
314
|
Once connected, try these prompts in Claude:
|
|
65
315
|
|
|
66
|
-
```
|
|
316
|
+
```text
|
|
67
317
|
What tables are in my FileMaker database?
|
|
68
318
|
|
|
69
319
|
Show me the first 5 records from the Contacts table
|
|
@@ -76,19 +326,42 @@ Create a new contact with name "John Doe" and email "john@example.com"
|
|
|
76
326
|
## Documentation
|
|
77
327
|
|
|
78
328
|
- **[Quick Reference](./dev_stuf/QUICK_REFERENCE.md)** - One-page setup guide
|
|
79
|
-
- **[Prompt Examples](./dev_stuf/CLAUDE_DESKTOP_PROMPTS.md)** - Complete prompt reference
|
|
329
|
+
- **[Prompt Examples](./dev_stuf/CLAUDE_DESKTOP_PROMPTS.md)** - Complete prompt reference
|
|
80
330
|
- **[Claude Desktop Setup](./dev_stuf/CLAUDE_DESKTOP_SETUP.md)** - Detailed configuration
|
|
81
|
-
- **[
|
|
331
|
+
- **[Docker Deployment](./DOCKER.md)** - Complete Docker guide with production examples
|
|
332
|
+
- **[Roadmap](./ROADMAP.md)** - Planned features and version history
|
|
333
|
+
- **[Changelog](./CHANGELOG.md)** - Detailed release notes
|
|
82
334
|
|
|
83
335
|
## Available Tools
|
|
84
336
|
|
|
85
|
-
| Category
|
|
86
|
-
|
|
87
|
-
| **Discovery**
|
|
88
|
-
| **Queries**
|
|
89
|
-
| **CRUD**
|
|
90
|
-
| **
|
|
91
|
-
| **
|
|
337
|
+
| Category | Tools |
|
|
338
|
+
|-------------------|-----------------------------------------------------------------------|
|
|
339
|
+
| **Discovery** | `fm_odata_list_tables`, `fm_odata_get_metadata`, `fm_odata_get_service_document` |
|
|
340
|
+
| **Queries** | `fm_odata_query_records`, `fm_odata_get_record`, `fm_odata_get_records`, `fm_odata_count_records` |
|
|
341
|
+
| **CRUD** | `fm_odata_create_record`, `fm_odata_update_record`, `fm_odata_delete_record` |
|
|
342
|
+
| **FM 2024/2025+** | `fm_odata_aggregate`, `fm_odata_cast`, `fm_odata_build_filter` |
|
|
343
|
+
| **Connection** | `fm_odata_connect`, `fm_odata_connect_multi`, `fm_odata_set_connection`, `fm_odata_list_connections`, `fm_odata_get_current_connection` |
|
|
344
|
+
| **Sessions** | `fm_odata_list_active_sessions`, `fm_odata_describe_sessions` |
|
|
345
|
+
| **Diagnostics** | `fm_odata_get_server_version` |
|
|
346
|
+
| **Config** | `fm_odata_config_add_connection`, `fm_odata_config_remove_connection`, `fm_odata_config_list_connections`, `fm_odata_config_get_connection`, `fm_odata_config_set_default_connection` |
|
|
347
|
+
| **Schema (DDL)** | `fm_odata_create_table`, `fm_odata_add_fields`, `fm_odata_delete_table`, `fm_odata_delete_field`, `fm_odata_create_index`, `fm_odata_delete_index` |
|
|
348
|
+
|
|
349
|
+
> The **FM 2024/2025+** tools are connection-free expression builders. `fm_odata_cast` and
|
|
350
|
+
> `fm_odata_build_filter` require FileMaker Server v21.1+ (FileMaker 2024); `fm_odata_aggregate`
|
|
351
|
+
> requires FileMaker Server v22.0.1+ (FileMaker 2025).
|
|
352
|
+
>
|
|
353
|
+
> All connection-dependent OData tools (including the 6 schema DDL tools when enabled) accept
|
|
354
|
+
> an optional `connection` parameter to target a specific session without changing the active
|
|
355
|
+
> connection. Useful in multi-file solutions.
|
|
356
|
+
>
|
|
357
|
+
> `fm_odata_get_server_version` detects the connected FileMaker Server version from `$metadata`
|
|
358
|
+
> (cached per session) and returns a feature-compatibility report covering `basic_odata`,
|
|
359
|
+
> `cast`, `build_filter`, `aggregate`, and `metadata_comments` (v26+). On servers that do not
|
|
360
|
+
> support server-side `$apply`, `fm_odata_aggregate` automatically falls back to client-side
|
|
361
|
+
> computation (capped at 10 000 records) with a `[Compatibility]` advisory.
|
|
362
|
+
>
|
|
363
|
+
> The **Schema (DDL)** tools are hidden by default. Set `FM_ALLOW_SCHEMA_EDITS=true` to
|
|
364
|
+
> register them. See [Schema Editing](#schema-editing-ddl) below.
|
|
92
365
|
|
|
93
366
|
## Requirements
|
|
94
367
|
|
|
@@ -98,20 +371,33 @@ Create a new contact with name "John Doe" and email "john@example.com"
|
|
|
98
371
|
|
|
99
372
|
## Environment Variables
|
|
100
373
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
|
104
|
-
|
|
105
|
-
| `
|
|
106
|
-
| `
|
|
107
|
-
| `
|
|
108
|
-
| `
|
|
374
|
+
### FileMaker Connection
|
|
375
|
+
|
|
376
|
+
| Variable | Description | Required | Default |
|
|
377
|
+
|---------------|------------------------------------------------|----------|---------|
|
|
378
|
+
| `FM_SERVER` | FileMaker Server URL | Yes | - |
|
|
379
|
+
| `FM_DATABASE` | Database name | Yes | - |
|
|
380
|
+
| `FM_USER` | Username | Yes | - |
|
|
381
|
+
| `FM_PASSWORD` | Password | Yes | - |
|
|
382
|
+
| `FM_VERIFY_SSL`| Verify SSL certificates | No | `true` |
|
|
383
|
+
| `FM_TIMEOUT` | Request timeout (ms) | No | `30000` |
|
|
384
|
+
| `FM_ALLOW_SCHEMA_EDITS` | Enable schema (DDL) tools | No | `false` |
|
|
385
|
+
|
|
386
|
+
### HTTP/HTTPS Transport
|
|
387
|
+
|
|
388
|
+
| Variable | Description | Required | Default |
|
|
389
|
+
|-----------------|------------------------------------------------|----------|-----------------------------------|
|
|
390
|
+
| `MCP_TRANSPORT` | Transport type: `stdio`, `http`, or `https` | No | `stdio` |
|
|
391
|
+
| `MCP_PORT` | Port for HTTP/HTTPS server | No | `3333` (HTTP), `3443` (HTTPS) |
|
|
392
|
+
| `MCP_HOST` | Host to bind to | No | `localhost` |
|
|
393
|
+
| `MCP_CERT_PATH` | Path to SSL certificate (HTTPS only) | No | - |
|
|
394
|
+
| `MCP_KEY_PATH` | Path to SSL private key (HTTPS only) | No | - |
|
|
109
395
|
|
|
110
396
|
## OData Query Syntax
|
|
111
397
|
|
|
112
398
|
The server supports OData 4.01 query options:
|
|
113
399
|
|
|
114
|
-
```
|
|
400
|
+
```text
|
|
115
401
|
$filter - Filter records (e.g., "Age gt 18")
|
|
116
402
|
$select - Select specific fields
|
|
117
403
|
$orderby - Sort results
|
|
@@ -119,10 +405,12 @@ $top - Limit results
|
|
|
119
405
|
$skip - Skip records (pagination)
|
|
120
406
|
$expand - Include related records
|
|
121
407
|
$count - Include total count
|
|
408
|
+
$apply - Server-side aggregation (FileMaker Server v22.0.1+ / FileMaker 2025)
|
|
122
409
|
```
|
|
123
410
|
|
|
124
411
|
**Example prompts:**
|
|
125
|
-
|
|
412
|
+
|
|
413
|
+
```text
|
|
126
414
|
Get contacts where Age is greater than 18
|
|
127
415
|
|
|
128
416
|
Show only Name and Email fields from Contacts
|
|
@@ -132,6 +420,106 @@ Sort contacts by LastName in descending order
|
|
|
132
420
|
Get the first 10 contacts, skip the first 20
|
|
133
421
|
```
|
|
134
422
|
|
|
423
|
+
### FileMaker 2025 Advanced Features
|
|
424
|
+
|
|
425
|
+
Three additional tools provide expression-builder helpers for newer FileMaker Server capabilities.
|
|
426
|
+
They require no active connection and return strings ready to use in the standard query tools.
|
|
427
|
+
|
|
428
|
+
**`fm_odata_aggregate`** — server-side aggregation (FileMaker Server v22.0.1+ / FileMaker 2025):
|
|
429
|
+
|
|
430
|
+
```text
|
|
431
|
+
Sum invoice amounts grouped by customer:
|
|
432
|
+
table=Invoices, method=sum, field=Amount, alias=Total, groupBy=["Customer"]
|
|
433
|
+
|
|
434
|
+
Count open cases per user:
|
|
435
|
+
table=Cases, method=count, alias=OpenCount, filter="Status eq 'Open'", groupBy=["AssignedTo"]
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
**`fm_odata_cast`** — server-side type coercion (FileMaker Server v21.1+ / FileMaker 2024):
|
|
439
|
+
|
|
440
|
+
```text
|
|
441
|
+
Return StartDate as a number for arithmetic:
|
|
442
|
+
fields=[{field:"StartDate", type:"Int64"}], context="select"
|
|
443
|
+
→ use result as $select value in fm_odata_query_records
|
|
444
|
+
|
|
445
|
+
Cast Amount to String for text comparison in a filter:
|
|
446
|
+
fields=[{field:"Amount", type:"String"}], context="filter"
|
|
447
|
+
→ embed result in a $filter expression: Amount/Edm.String eq '100'
|
|
448
|
+
```
|
|
449
|
+
|
|
450
|
+
**`fm_odata_build_filter`** — parameterized filter builder (FileMaker Server v21.1+ / FileMaker 2024):
|
|
451
|
+
|
|
452
|
+
```text
|
|
453
|
+
Reusable filter with named placeholders:
|
|
454
|
+
template="Title eq @title and Age gt @minAge",
|
|
455
|
+
params={"@title":"Wizard of Oz","@minAge":18}
|
|
456
|
+
→ filter: "Title eq 'Wizard of Oz' and Age gt 18"
|
|
457
|
+
```
|
|
458
|
+
|
|
459
|
+
### FileMaker 2026 Metadata Comments
|
|
460
|
+
|
|
461
|
+
FileMaker Server 2026 (v26) exposes table and field comments — including AI annotations —
|
|
462
|
+
in the OData `$metadata` document. When connected to a v26+ server:
|
|
463
|
+
|
|
464
|
+
```text
|
|
465
|
+
List tables with their comments:
|
|
466
|
+
fm_odata_list_tables with includeDetails=true
|
|
467
|
+
→ contact — Contact table
|
|
468
|
+
|
|
469
|
+
Merged schema with field comments and AI annotations:
|
|
470
|
+
fm_odata_describe_sessions
|
|
471
|
+
→ tables include `comment`; fields include `comment` and `aiAnnotation`
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
On v25 and older servers these options are ignored safely — call
|
|
475
|
+
`fm_odata_get_server_version` first to check `metadata_comments` support.
|
|
476
|
+
|
|
477
|
+
## Schema Editing (DDL)
|
|
478
|
+
|
|
479
|
+
FileMaker Server exposes a proprietary OData schema extension through the
|
|
480
|
+
`FileMaker_Tables` and `FileMaker_Indexes` system endpoints. Six tools wrap it:
|
|
481
|
+
|
|
482
|
+
| Tool | Operation |
|
|
483
|
+
|------|-----------|
|
|
484
|
+
| `fm_odata_create_table` | Create a table with field definitions |
|
|
485
|
+
| `fm_odata_add_fields` | Add fields to an existing table |
|
|
486
|
+
| `fm_odata_delete_table` | Delete a table and ALL its records |
|
|
487
|
+
| `fm_odata_delete_field` | Delete a field and all its data |
|
|
488
|
+
| `fm_odata_create_index` | Create an index on a field |
|
|
489
|
+
| `fm_odata_delete_index` | Delete a field index (no data loss) |
|
|
490
|
+
|
|
491
|
+
**Safety model:**
|
|
492
|
+
|
|
493
|
+
- The tools are **not registered** unless the environment variable
|
|
494
|
+
`FM_ALLOW_SCHEMA_EDITS=true` is set on the MCP server.
|
|
495
|
+
- `fm_odata_delete_table` and `fm_odata_delete_field` are irreversible and require an
|
|
496
|
+
explicit `confirm: true` argument; without it they refuse and describe what would be deleted.
|
|
497
|
+
- The FileMaker account needs full access (schema modification) privileges. Claris recommends
|
|
498
|
+
a dedicated account for table deletion.
|
|
499
|
+
|
|
500
|
+
**Field definitions** use SQL-style types: `NUMERIC`, `DECIMAL`, `INT`, `DATE`, `TIME`,
|
|
501
|
+
`TIMESTAMP`, `VARCHAR(n)`, `BLOB`, etc. Repetitions in brackets (`INT[4]`). Optional flags:
|
|
502
|
+
`primary`, `unique`, `global`, `nullable`, `default` (keyword such as `CURRENT_USER` or
|
|
503
|
+
`CURRENT_TIMESTAMP`), and `externalSecurePath` for container fields.
|
|
504
|
+
|
|
505
|
+
```text
|
|
506
|
+
Create a Company table:
|
|
507
|
+
tableName="Company", fields=[
|
|
508
|
+
{name:"Company ID", type:"int", primary:true},
|
|
509
|
+
{name:"Company Name", type:"varchar(100)", nullable:false},
|
|
510
|
+
{name:"Notes", type:"varchar(2000)", global:true}
|
|
511
|
+
]
|
|
512
|
+
|
|
513
|
+
Add a phone field:
|
|
514
|
+
table="Company", fields=[{name:"Phone", type:"varchar(25)"}]
|
|
515
|
+
|
|
516
|
+
Index the State field:
|
|
517
|
+
table="Company", field="State"
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
> **Limitations:** relationships, layouts, scripts, value lists, and calculation/summary
|
|
521
|
+
> fields cannot be created via OData — only base tables, regular fields, and indexes.
|
|
522
|
+
|
|
135
523
|
## Contributing
|
|
136
524
|
|
|
137
525
|
See [CONTRIBUTING.md](./CONTRIBUTING.md) for development guidelines.
|
|
@@ -142,12 +530,12 @@ MIT License - see [LICENSE](./LICENSE) file for details.
|
|
|
142
530
|
|
|
143
531
|
## Support
|
|
144
532
|
|
|
145
|
-
- **Issues**: [GitHub Issues](https://github.com/fsans/
|
|
146
|
-
- **Discussions**: [GitHub Discussions](https://github.com/fsans/
|
|
533
|
+
- **Issues**: [GitHub Issues](https://github.com/fsans/fms-odata-mcp/issues)
|
|
534
|
+
- **Discussions**: [GitHub Discussions](https://github.com/fsans/fms-odata-mcp/discussions)
|
|
147
535
|
|
|
148
536
|
## Changelog
|
|
149
537
|
|
|
150
|
-
See [
|
|
538
|
+
See [CHANGELOG.md](./CHANGELOG.md) for detailed release notes.
|
|
151
539
|
|
|
152
540
|
---
|
|
153
541
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":""}
|
package/dist/bin/cli.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { FileMakerODataServer } from '../index.js';
|
|
3
|
+
async function main() {
|
|
4
|
+
const server = new FileMakerODataServer();
|
|
5
|
+
await server.run();
|
|
6
|
+
}
|
|
7
|
+
main().catch((error) => {
|
|
8
|
+
console.error('Server error:', error);
|
|
9
|
+
process.exit(1);
|
|
10
|
+
});
|
|
11
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/bin/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,KAAK,UAAU,IAAI;IACjB,MAAM,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC1C,MAAM,MAAM,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;IACtC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default transport ports. Keep in one place so `config.ts` and
|
|
3
|
+
* `transport.ts` cannot drift apart.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DEFAULT_HTTP_PORT = 3333;
|
|
6
|
+
export declare const DEFAULT_HTTPS_PORT = 3443;
|
|
1
7
|
export interface ServerConfig {
|
|
2
8
|
transport: "stdio" | "http" | "https";
|
|
3
9
|
port: number;
|
|
@@ -21,6 +27,7 @@ export interface Connection {
|
|
|
21
27
|
database: string;
|
|
22
28
|
user: string;
|
|
23
29
|
password: string;
|
|
30
|
+
verifySsl?: boolean;
|
|
24
31
|
}
|
|
25
32
|
export interface AppConfig {
|
|
26
33
|
server: ServerConfig;
|
|
@@ -81,6 +88,11 @@ export declare function getConnection(name: string): Connection | null;
|
|
|
81
88
|
* Add a connection to config file
|
|
82
89
|
*/
|
|
83
90
|
export declare function addConnection(name: string, connection: Connection): void;
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the effective verifySsl flag from possibly-undefined sources.
|
|
93
|
+
* Defaults to `true` unless explicitly set to `false`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function resolveVerifySsl(...sources: Array<boolean | undefined>): boolean;
|
|
84
96
|
/**
|
|
85
97
|
* Remove a connection from config file
|
|
86
98
|
*/
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CA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