How fsans/fms-odata-mcp works
1. What this repository is
- This is a Node.js/TypeScript Model Context Protocol server that sits between AI clients and a FileMaker Server OData 4.01 endpoint.
- Its job is to translate MCP tool calls into FileMaker OData requests, then return structured results back to the AI client.
2. Top-level runtime shape
- The main runtime starts in src/index.ts, with a CLI entrypoint in src/bin/cli.ts.
- The server can run in three transport modes: MCP over stdio, plain HTTP, or HTTPS.
- Environment variables drive both the FileMaker connection and the transport binding, so deployment is mostly configuration-based.
3. Protocol boundary: MCP layer
- src/tools/ contains the MCP tool surface exposed to clients.
- The tool set is split by concern: discovery, records/query operations, connection management, and saved configuration management.
- These tools are the main external API of the server; everything else exists to support tool execution.
4. Transport abstraction
- src/transport.ts defines the transport boundary, with implementations in src/simple-http-transport.ts and src/working-http-transport.ts.
- src/http-server.ts likely hosts the HTTP/HTTPS MCP endpoint and health/info routes described in the README.
- This separation lets the same tool layer serve both IDE assistants via stdio and external apps via HTTP/HTTPS.
5. FileMaker integration core
- src/odata-client.ts is the main integration layer for FileMaker Server’s OData API.
- src/connection.ts manages connection state and credentials for the active FileMaker target.
- src/config.ts handles configuration defaults and environment-derived settings such as server URL, database, user/password, timeout, and SSL verification.
6. Request parsing and OData semantics
- src/odata-parser.ts is the query/response interpretation layer for OData-specific behavior.
- This is where OData 4.01 constructs like $filter, $select, $orderby, $top, $skip, $expand, and $count are likely normalized or parsed for use by the client and tools.
- It forms the translation boundary between generic MCP tool arguments and FileMaker-specific query syntax.
7. Tool execution flow
- A typical call path is: MCP client -> transport -> tool handler in src/tools/ -> connection/config lookup -> OData client -> FileMaker Server -> response back through parser/formatter -> MCP response.
- Connection-oriented tools (connect, set_connection, list_connections, get_current_connection) affect shared state, while query/CRUD tools operate against that selected target.
8. State and persistence
- Connection configuration can be saved and reused, which implies a small local persistence layer or file-backed storage under the user’s home directory.
- The README and Docker examples suggest persistent volume mounting is used to preserve connection state across restarts in containerized deployments.
- This persistence is operational, not business data storage; FileMaker remains the system of record.
9. Logging and operational concerns
- src/logger.ts centralizes logging, likely to keep MCP, HTTP transport, and OData client output consistent.
- The server also exposes a health endpoint in HTTP mode, which is important for container orchestration and reverse proxy setups.
10. Deployment packaging
- The repo supports direct Node execution, Docker image builds, Docker Compose, and an optional Nginx front end for HTTPS termination.
- Dockerfile, docker-compose.yml, nginx.conf, ssl/, and start.sh form the container/deployment layer.
- These are not core application logic, but they materially affect how the server is exposed and secured.
11. Testing structure
- Tests are split into unit tests under tests/unit/ and integration tests under tests/integration/.
- Unit tests focus on config, OData parsing, and the client boundary; integration tests cover the exposed tools and their end-to-end behavior.
- This mirrors the architecture: isolated pure logic in the parser/config layers, and integration coverage for the MCP tool surface.
12. Architecture boundary summary
- The cleanest diagram is: AI client or HTTP caller on one side, MCP transport and tool layer in the middle, and FileMaker OData API on the other side.
- Supporting subsystems around that core are configuration, connection persistence, logging, and deployment wrappers for Docker/HTTPS.
Main entry points: odata-client.ts OData client · index.ts Main · configuration.ts Config tools · connection.ts Connection tools
Components 25
Source
Runtime, transport, tool, and FileMaker integration code.
- CLI · Command-line entrypoint for starting the server.
src/bin/cli.ts - Main · Wires startup, transport selection, and server initialization.
src/index.ts - Transport · Abstract transport boundary shared by stdio and HTTP modes.
src/transport.ts - StdIO HTTP · HTTP transport implementation used for MCP-compatible request handling.
src/simple-http-transport.ts - Working HTTP · Alternative HTTP transport implementation for the MCP endpoint.
src/working-http-transport.ts - HTTP server · Hosts HTTP/HTTPS MCP endpoints and operational routes.
src/http-server.ts - Tools API · Exports the tool set exposed to AI clients.
src/tools/index.ts - Config tools · Saved configuration and connection-management tools.
src/tools/configuration.ts - Connection tools · Connect and inspect the active FileMaker target.
src/tools/connection.ts - OData tools · Query and data operation tools backed by FileMaker OData.
src/tools/odata.ts - Config · Environment-driven defaults and connection settings.
src/config.ts - Connection · Tracks active connection state and selected FileMaker target.
src/connection.ts - OData client · Core client for FileMaker Server OData requests.
src/odata-client.ts - OData parser · Interprets OData query and response semantics.
src/odata-parser.ts - Logger · Centralized logging for runtime and integrations.
src/logger.ts
Tests
Unit and integration coverage for core behavior.
- Config tests · Unit coverage for configuration behavior.
tests/unit/config.test.ts - Client tests · Unit coverage for the OData client boundary.
tests/unit/odata-client.test.ts - Parser tests · Unit coverage for OData parsing and normalization.
tests/unit/odata-parser.test.ts - Tool tests · End-to-end coverage for exposed MCP tools.
tests/integration/tools/odata.test.ts - Conn tests · Integration coverage for connection-related tools.
tests/integration/tools/connection.test.ts - Config integration · Integration coverage for configuration tools and persistence flow.
tests/integration/tools/configuration.test.ts
Deployment
Container, TLS, and runtime startup assets.
- Dockerfile · Container image definition for deployment.
Dockerfile - Compose · Local container orchestration and persistent volume setup.
docker-compose.yml - Nginx · Optional HTTPS termination and reverse proxy config.
nginx.conf - Start script · Container startup helper for launching the service.
start.sh
Connections 30
- CLI → Main: starts · CLI launches the main runtime.
- Main → Transport: selects · Runtime chooses MCP transport mode.
- Main → HTTP server: hosts · HTTP/HTTPS mode is served by the HTTP server.
- Transport → StdIO HTTP: impl · One transport implementation.
- Transport → Working HTTP: impl · Alternative transport implementation.
- HTTP server → Logger: logs · Server lifecycle and request handling are logged.
- Tools API → Config tools: exports · Tools index aggregates configuration tools.
- Tools API → Connection tools: exports · Tools index aggregates connection tools.
- Tools API → OData tools: exports · Tools index aggregates OData tools.
- Config tools → Config: reads · Configuration tools use persisted/default settings.
- Config tools → Connection: updates · Configuration tools can save or switch connection state.
- Connection tools → Connection: reads · Connection tools inspect active target state.
- Connection tools → OData client: uses · Connection tools rely on the FileMaker client.
- OData tools → OData client: uses · Query tools execute through the OData client.
- OData tools → OData parser: formats · OData tools normalize request and response semantics.
- OData client → Config: reads · Client configuration comes from environment and defaults.
- OData client → Connection: uses · Client uses the active connection target.
- OData client → Logger: logs · Client activity is centralized through logging.
- OData parser → Config: influences · Parser behavior can depend on configured limits or defaults.
- Config tests → Config: tests · Unit tests cover configuration logic.
- Client tests → OData client: tests · Unit tests cover the client boundary.
- Parser tests → OData parser: tests · Unit tests cover OData parsing.
- Tool tests → OData tools: tests · Integration tests exercise query tools.
- Conn tests → Connection tools: tests · Integration tests exercise connection tools.
- Config integration → Config tools: tests · Integration tests exercise configuration tools.
- Dockerfile → Start script: uses · Container image startup relies on the start script.
- Compose → Dockerfile: builds · Compose targets the container image.
- Compose → Nginx: proxies · Compose can pair with Nginx for HTTPS exposure.
- Start script → Main: runs · Startup script launches the Node runtime.
- Nginx → HTTP server: fronts · Nginx fronts the HTTP server in HTTPS deployments.