qcdm-mcp
Provides tools for interacting with Qualcomm DIAG/QCDM protocol over a serial port, enabling modem version queries, NV item read/write, memory peek/poke, and EFS file transfer operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@qcdm-mcpread NV item 550 from the modem"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
qcdm-mcp
ALPHA — NOT TESTED ON REAL HARDWARE
This is an untested, best-effort implementation. The packet layouts were derived from public documentation and open-source MIT/GPL projects, but this server has not been run against a real Qualcomm modem. Some fields are marked inferred, unverified. Writing to a device (NV, memory, EFS) can crash the modem or brick it. Use at your own risk, on hardware you can afford to lose, and always back up NV/EFS first.
A single-file Python MCP (Model Context Protocol) server that speaks the
Qualcomm DIAG / QCDM protocol ("Diag", "Diagnostic Monitor") over a serial
diag port. It is the sibling project to sahara-mcp and mirrors its style.
Related MCP server: mcp-uart
Features
Exposes the following tools (all under the diag_ prefix):
Tool | Purpose |
| Enumerate serial ports (name, description, hwid) |
| Modem version/build string via |
| Read a single NV item (hex payload) |
| Write a single NV item (WARNING: can corrupt/brick) |
| Read modem memory via |
| Write modem memory via |
| List an EFS2 directory |
| Copy a modem EFS file to the host |
| Push a host file into modem EFS + read-back verify (WARNING) |
The server talks over a serial port at 115200 baud using HDLC-style framing.
How to expose a DIAG port
Rooted Android phone —
/dev/diag(requires root). To re-enumerate the phone with a usb diag port exposed (with adb still available):adb shell su -c 'setprop sys.usb.config diag,serial_cdev,rmnet,adb'It re-enumerates as a Qualcomm DIAG device (
05c6:9091). On Linux, bind it with theoptiondriver (sudo modprobe option;echo 05c6 9091 | sudo tee /sys/bus/usb-serial/drivers/option1/new_id). Only one of the serial nodes is the DIAG port; pass it explicitly or let the server probe.USB modem / dongle — many Qualcomm modems expose a diag pseudo-serial port either directly or after sending the vendor command
AT$QCDMG. This is commonly/dev/ttyUSB*(Linux) /COMx(Windows).Windows COM ports — use Device Manager to find the diag port. If it is hidden, enable View → Show hidden devices. The server enumerates ports via
serial.tools.list_portsand can auto-probe.
If port is left empty, the server probes every enumerated serial port with a
DIAG_VERSION_F request and uses the first that answers (so you don't have to
guess which ttyUSB*/COMx is the diag one).
Install
Requires Python 3.8+ and the pyproject.toml dependencies:
pip install pyserial
pip install "mcp" # or: pip install -e .Usage
Run the server (stdio transport, consumed by an MCP client):
python qcdm_mcp_server.pyExample tool invocations an agent might make:
diag_version(port="COM3")
diag_version(port="") # auto-detect
diag_nv_read(port="COM3", item_id=550) # NV_UE_IMEI_I
diag_efs_list(port="COM3", path="/policyman")
diag_efs_pull(port="COM3", remote_path="/policyman/band_set_01.xml",
local_path="band_set_01.xml")
diag_efs_push(port="COM3", local_path="band_set_01.xml",
remote_path="/policyman/band_set_01.xml")
diag_memory_peek(port="COM3", address=0x40000000, length=16)Protocol notes and corrections (verified against references)
On-wire framing — HDLC-like: payload + CRC-16, trailer
0x7e;0x7eescaped as0x7d 0x5e,0x7das0x7d 0x5d. CRC is the reflected FCS-16 (poly0x8408, init0xFFFF, complemented) — verified against the CRC-16/X-25 check value.Command codes (
diagcmd.hlineage):DIAG_VERSION_F = 0x00,DIAG_EXT_BUILD_ID_F = 0x7c,DIAG_NV_READ_F = 0x26,DIAG_NV_WRITE_F = 0x27,DIAG_PEEKB/POKEB = 0x02/0x05,DIAG_SUBSYS_CMD_F = 0x4b, errors0x13/0x14/0x15.Corrections to common guesses: NV read/write are
0x26/0x27, not0x27/0x28;DIAG_SUBSYS_CMD_Fis0x4b, not0x54; EFS subcommands are the 0-based0..15ids (HELLO=0, OPENDIR=11, READDIR=12, STAT=15, …), not the0x2011+offset family that appears in some older documentation. Seeqcdm_mcp_server.pycomments.Length limits — legacy serial DIAG frames are capped around 4 KB (
DIAG_MAX_PKT_LEN); larger payloads are split into small chunks (EFS transfers use 1 KB chunks, the negotiated window is 1 MiB). Newer transports add amulti_pktwrapper for large frames; this server stays on the serial/HDLC path and does not use it.Inferred/unverified: the exact split of the NV read payload between data and trailing status byte, the memory-poke response layout, and the variables inside the
readdirresponse.
References and licensing
P1sec QCSuper — The Diag protocol writeup. GPL-3.0. Consulted for protocol facts only; no GPL code is imported or copied. https://github.com/P1sec/QCSuper
grmrgecko/qcdm-efs2 — MIT (Copyright (c) 2026 Mr. Gecko's Media). Source of the EFS2 envelope/subcommand response offsets. https://github.com/grmrgecko/qcdm-efs2
JohnBel/EfsTools — packet layouts and opcodes (behavioral reference). https://github.com/JohnBel/EfsTools
Wireshark
packet-qcdiag/ osmo-qcdiag / quectel QLog —diagcmd.hcommand-code lineage (facts).
This project is licensed under the GPL-3.0 license. See LICENSE.
Copyright (c) 2026 libertyrights. Our own code is GPL-3.0; the references
above were used for protocol facts only and retain their own licenses.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to interact with physical serial port devices across platforms (Windows COM/Linux tty) with support for asynchronous communication, URC pattern recognition, and structured logging.1
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to communicate with UART/serial devices, offering tools for port management, data read/write, and protocol handling.MIT
- AlicenseAqualityDmaintenanceEnables AI agents to control serial port devices (modems, instruments, embedded boards) via MCP tools for listing ports, connecting, and sending/receiving commands.31MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM agents to interact directly with Qualcomm EDL devices over USB, including device enumeration, Sahara protocol handshake, SoC identity queries, Firehose programmer upload, command-mode execution, and device reset.GPL 3.0
Related MCP Connectors
Production-grade cryptography toolkit with 31 MCP tools for classical, PQC, and KMS workflows.
Generate IDs, QR codes, and hashes, encode values, geolocate IPs, plus gated host diagnostics.
Create and manage CodeQR short links, QR codes, and analytics from any MCP client.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/libertyrights/qcdm-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server