np_mdt installation
np_mdt connects a FiveM server to the MDT. It's one resource for every use case. Each use case is a module that you switch on in config/core.lua. Until 2026-10 it was called np_mdt-medic and only did the medical part.
Not yet tested on a live server
The resource is covered by unit tests (busted for the Lua, bun test for the NUI), but the acceptance run on a real FiveM server is still pending. Try it on a test server with a test guild first.
Requirements
Nothing. fxmanifest.lua has no dependency entries. What's running gets used, and anything missing is covered by a built-in fallback (see Bridges). The NUI is bundled and checked in, so there's no build step.
You need:
- An MDT instance (see Setup) and an API key for it.
- For any player-facing feature: players with a linked Discord account. The MDT identifies players by their Discord id.
Steps
- Copy the
np_mdtfolder into yourresources/and keep the name. - Add to
server.cfg, after your framework and other optional dependencies:cfgUseset np_mdt_url "https://mdt.npdev.eu" set np_mdt_api_key "stmp_…" ensure np_mdtset, notsetr: the key must never reach clients. The old convarsnp_medic_mdt_urlandnp_medic_api_keystill work when the new ones are missing. - Pick your modules in
config/core.lua(see Configuration). By default onlymedicanddispatchstart. - Restart and check the console. You should see the bridge line and any setup findings:
[np_mdt] bridge: db=oxmysql framework=esx_current inventory=ox target=ox ui=oxlib
The API key
The key belongs to exactly one guild, so a test key can't write into your real guild. Which kind you need depends on the modules you enable:
| Module | Needs |
|---|---|
medic | An unscoped key. The medic routes don't accept scoped keys |
dispatch | calls:call.report (plus calls:read for waypoints to assigned units) |
ranks | ranks:personal.ranks_set |
timeclock | timeclock:shift.ingame_clock |
funk | units:unit.ingame_status, employees:read, calls:call.report |
kiosk | facility:queue.ingame_ticket |
ausweis | employees:read |
tablet | sessions:ingame.tablet_login. Only scoped keys can have it; unscoped keys get 403 |
An unscoped key (from /apikey create) may do everything in its guild except the tablet login. Because the resource reads a single np_mdt_api_key, medic and tablet can't currently run on the same server. Scoped keys need capabilities:read so that the start-up check can see what they're allowed to do.
Checking the setup
At start the resource asks the MDT what its key may do and compares that with the enabled modules. Problems are printed to the console, for example:
[np_mdt] Einrichtung: Modul ranks: Scope fehlt: ranks:personal.ranks_set
[np_mdt] Einrichtung: Modul medic braucht einen Schluessel ohne Scopes; ...| Command | Where | Shows |
|---|---|---|
mdtstatus | Server console, or in game with the ACE command.mdtstatus | Environment, modules, chosen bridges, setup findings, medic queue and dispatch outbox |
medicstatus | Server console | Medic sync: connection, queue depth, dead letters |
Test mode
set np_mdt_environment "test"The start-up log says so loudly, and every call sent to dispatch gets [TEST] in its title. Use it with a test key for a test guild.
Troubleshooting
| Symptom | Fix |
|---|---|
Kein API-Schluessel gesetzt | np_mdt_api_key is empty. Set it with set in server.cfg |
MDT nicht erreichbar | Check np_mdt_url and that the server can reach it |
HTTP 401 | The key is invalid or was deleted. Create a new one |
Scope fehlt: … | The scoped key lacks a scope for an enabled module. Issue a new key or switch the module off |
| Players get Ohne verknüpftes Discord … | The player has no Discord identifier. Discord must be running and linked in FiveM |
| Wrong framework / inventory detected | Start dependencies before np_mdt, or pin them with Config.Bridge (see Bridges) |