Repository avatar
Other Tools
v1.0.0
active

webfleet-mcp

io.github.WYRE-AI/webfleet-mcp

Read-only MCP server for Bridgestone Webfleet (WEBFLEET.connect): vehicles, drivers, trips, events.

Documentation

Webfleet MCP Server

A read-only Model Context Protocol server for Bridgestone Webfleet's WEBFLEET.connect API. It gives an MSP a read view of a client's fleet: vehicles and their latest positions, drivers, trips and tracks, events, KPIs, addresses, and orders.

Every tool is a GET of a read-only report action against the fixed endpoint https://csv.webfleet.com/extern. Nothing here can insert, update, or delete data, send anything to a driver terminal, or consume a message queue. Parameters and limits follow the WEBFLEET.connect 1.76.0 Reference Guide.

Tools

ToolWEBFLEET.connect actionLimit
webfleet_statusnone (local configuration only; a tool error when credentials are missing or invalid)n/a
webfleet_objects_listshowObjectReportExtern6/min
webfleet_vehicles_listshowVehicleReportExtern10/min
webfleet_object_groups_listshowObjectGroups10/min
webfleet_object_group_objects_listshowObjectGroupObjects10/min
webfleet_nearest_vehiclesshowNearestVehicles10/min
webfleet_contracts_listshowContracts6/min
webfleet_object_featuresgetObjectFeatures10/min
webfleet_tripsshowTripReportExtern1/min
webfleet_trip_summaryshowTripSummaryReportExtern10/min
webfleet_tracksshowTracks (max 2 days)10/min
webfleet_logbookshowLogbook10/min
webfleet_standstillsshowStandStills6/min
webfleet_idle_exceptionsshowIdleExceptions10/min
webfleet_working_timesshowWorkingTimes6/min
webfleet_eventsshowEventReportExtern1/min
webfleet_speeding_eventsshowSpeedingEvents10/min
webfleet_acceleration_eventsshowAccelerationEvents10/min
webfleet_drivers_listshowDriverReportExtern10/min
webfleet_driver_groups_listshowDriverGroups10/min
webfleet_driver_group_drivers_listshowDriverGroupDrivers10/min
webfleet_object_kpisgetObjectKPIs10/min
webfleet_driver_kpisgetDriverKPIs10/min
webfleet_addresses_listshowAddressReportExtern6/min
webfleet_address_groups_listshowAddressGroupReportExtern900/hour
webfleet_address_group_addresses_listshowAddressGroupAddressReportExtern900/hour
webfleet_orders_listshowOrderReportExtern6/min
webfleet_order_waypointsshowOrderWaypoints10/min
webfleet_messages_listshowMessages (reads messages; does not touch the queue)10/min
webfleet_raw_requestany one of the actions above, with caller-supplied parameterssame

The catalog is one table in src/tools/catalog.ts; the action allowlist and limits are in src/actions.ts.

Date ranges. Report tools take the reference's date range filter: range_pattern (d0, d-1..d-6, w0..w-3, wf0..wf-3, m0..m-3, ud), or rangefrom_string + rangeto_string (ISO 8601, since every request sends useISO8601=true), or year (+ month, day). An explicit rangefrom_string + rangeto_string range is always sent with range_pattern=ud, as in the reference's example. webfleet_standstills requires range_pattern and does not take year/month/day. Trips accept tripid alone (continuous replication), the logbook accepts tripid alone (one trip), and orders accept orderid alone.

No paging. WEBFLEET.connect returns a full list per call and has no page parameter. tripid is passed through as given; the server never issues follow-up requests. Use columnfilter (every tool) and the filters to keep responses small. A response larger than WEBFLEET_MAX_RESPONSE_CHARS keeps as many leading rows as fit and adds truncated, returned_items, total_items, and a truncation_hint.

Errors. Vendor errors come back as tool errors (isError: true) with the HTTP status, the WEBFLEET.connect response code (X-Webfleet-Errorcode or the body's error id), the vendor message, and a hint for the codes an operator can act on (1101/1106 wrong credentials, 8014 missing access right or API key, 8011 quota, 8015 overlapping request). WEBFLEET.connect does not return a request id. "No data" (codes 63 and 9198) is returned as an empty list, not an error.

Request limits

Webfleet blocks an action once its limit is exceeded and keeps blocking until no request arrives for a full window; repeated overload can get a client's limits lowered or its access revoked. This server therefore:

  • throttles each action per tenant account and its API key (account + apiKey + action) to its documented limit and refuses locally (Not sent: ... Retry in Ns) instead of sending a request that would be rejected. Users of one account share its budget. A budget is never shared across accounts, even when they use the same (partner) API key, and never keyed on the account name alone. A request Webfleet rejects as authentication or access failure (401/403 or codes 1101/1105/1106/8014/45) refunds its slot, so a wrong password cannot spend another user's budget;
  • serialises requests per exact credential set, which covers the reference's per account/username rule (error 8015 otherwise), with a pending-call depth cap per identity so the queue cannot grow without limit;
  • backs off for 10 s after a request times out or is cancelled: Webfleet may still be running it and would answer the next request for that user with 8015, so the next call for the same credentials is refused locally until then;
  • caches successful responses per exact credential set and request for one limit interval (60 s for a 1/min action, 10 s for 6/min, 6 s for 10/min), so a repeated identical call is answered locally.

The state is per process and bounded (expired throttle keys and back-off holds are swept, every map is capped, and each cache entry is charged at least 1 KiB). With more than one replica, each replica keeps its own budget; run one replica per gateway cell or lower the limits.

Authentication

A connection is four values: account name, username, password, and a 36-character API key. account and apikey go on the query string, as the reference requires. Username and password are sent only as HTTP Basic Auth (Authorization: Basic base64(username:password)); they never appear in the URL, and username/password parameters are refused.

ModeWhere the connection comes from
stdioWEBFLEET_ACCOUNT, WEBFLEET_USERNAME, WEBFLEET_PASSWORD, WEBFLEET_API_KEY
HTTP, AUTH_MODE=envthe same variables (startup refuses missing or malformed values)
HTTP, AUTH_MODE=gateway (container default)the X-Webfleet-Account, X-Webfleet-Username, X-Webfleet-Password, and X-Webfleet-Api-Key headers on each request, only. All four are required (401 otherwise). The environment is never read, and the process stays locked to gateway mode once started.

Use a dedicated integration user with the WEBFLEET.connect access right and only the report rights it needs, never an admin. Calls run with that user's rights, which can include live vehicle positions and driver personal data.

Every upstream request sends Authorization, accept: application/json, and user-agent: webfleet-mcp/<version>, plus the common parameters lang=en, account, apikey, action, outputformat=json, useUTF8=true, and useISO8601=true.

Tool tiers

Every tool declares a read, write, or admin tier. This server ships only read tools (30). The default is WEBFLEET_TOOL_TIERS=read, so write and admin stay off unless explicitly configured. Conduit's X-Conduit-Tool-Tiers header can only narrow the set, and a present-but-empty header exposes zero tools.

Configuration

VariableDefaultDescription
WEBFLEET_ACCOUNT, WEBFLEET_USERNAME, WEBFLEET_PASSWORD, WEBFLEET_API_KEYunsetConnection for stdio and AUTH_MODE=env. Ignored in gateway mode.
WEBFLEET_TOOL_TIERSreadComma-separated tiers (read, write, admin). Default is read only; admin stays off unless listed.
MCP_TRANSPORTstdiostdio or http. The image sets http.
AUTH_MODEenvenv or gateway. The image sets gateway.
MCP_HTTP_HOST127.0.0.1HTTP bind address. The image sets 0.0.0.0.
MCP_HTTP_PORT8080HTTP port.
MCP_ALLOWED_HOSTSunsetOptional Host header allowlist for /mcp.
CONDUIT_S2S_SECRETunsetRequired for HTTP. 32+ characters, not a placeholder (openssl rand -hex 32). Never logged.
MCP_ALLOW_INSECURE_DEVunset1 = local development without S2S; binds 127.0.0.1 only.
WEBFLEET_REQUEST_TIMEOUT_MS300000Upstream timeout (default and max 300000, the reference's recommendation). After a timeout the same credentials are held back for 10 s (Webfleet may still be running the request and would answer 8015).
WEBFLEET_MAX_RESPONSE_CHARS60000Tool output cap (redacted first, then measured).
WEBFLEET_MAX_UPSTREAM_BYTES4194304 (4 MiB)Upstream body cap, enforced while streaming (max 128 MiB).
LOG_LEVELinfodebug, info, warn, error. Logs go to stderr and are redacted.

See .env.example.

Running

stdio

npm ci --ignore-scripts && npm run build
WEBFLEET_ACCOUNT=... WEBFLEET_USERNAME=... WEBFLEET_PASSWORD=... WEBFLEET_API_KEY=... node dist/index.js

HTTP behind the Conduit gateway

export CONDUIT_S2S_SECRET="$(openssl rand -hex 32)"
docker compose up --build

GET /health is unauthenticated liveness only and reads no credentials. POST /mcp requires a valid X-Gateway-S2S header and, in gateway mode, all four X-Webfleet-* headers. The password travels in a header, so any gateway-to-server hop that leaves the host must run over TLS.

Security

  • Fixed upstream endpoint; no base-URL or host override exists, and the built URL is checked to stay on https://csv.webfleet.com/extern.
  • A fixed allowlist of read actions; insert*, update*, delete*, send*, pop*/ack*/createQueue*, and everything else is refused, including through webfleet_raw_request.
  • Redirects are never followed; any 3xx is an error.
  • The API key must be exactly 36 visible ASCII characters; the username may not contain :; control characters are refused in every credential and argument.
  • The password, API key, and Basic Auth token are redacted from tool output, tool errors, and logs. Unexpected internal errors are reported generically.
  • HTTP fails closed without a real CONDUIT_S2S_SECRET; S2S verification is the fleet's shared s2s-verify.ts.
  • Only arguments declared in a tool's schema reach the handler.

There is no public sandbox. Testing against a live account must be read-only, with a dedicated integration user.

Development

npm ci --ignore-scripts
npm run build
npm test
npm run lint
npm run lint:destructive
npm run typecheck
npm run smoke

Tests mock fetch; nothing calls a Webfleet host. npm run smoke starts the built stdio server and checks the 30-tool read-only surface and the local refusals without any network call.

License

MIT