osmp_encode
Encode structured fields into a SAL instruction frame.
Compress agent instructions into a dictionary-decoded format small enough for a LoRa packet.
LABSCO SUMMARY
Small payloads matter on a radio link, but the sharper property is that decoding requires no inference — a constrained node recovers the instruction by dictionary lookup, which means no model, no tokenizer and no ambiguity at the receiving end. That makes this interesting for mesh, satellite and embedded contexts and largely irrelevant if every hop in your system is a cloud API call. The validator is where the safety lives: it rejects hallucinated opcodes and missing consequence classes before anything is transmitted.
An encoding standard for agent instructions, with an MCP server in front of it. Instead of JSON over HTTP, instructions are written in a compact grammar that decodes by dictionary lookup rather than inference — so a receiving node recovers the structured instruction without running a model.
osmp_compose turns natural-language instructions into the encoded form, or returns NL_PASSTHROUGH when no opcode matchesosmp://system_prompt resource the agent reads on connect — the README puts it at roughly 390 tokens — teaching it the grammar, dictionary and composition rulesosmp_macro_invoke resolves pre-validated multi-opcode templates, with 16 Meshtastic macros bundledosmp_resolve, osmp_batch_resolve and osmp_discover look codes up in the bundled domain corpora — ICD-10-CM, ISO 20022 message definitions, and MITRE ATT&CKpip install osmp-mcp for the server, published as osmp-mcp version 1.3.4 over stdio; claude mcp add osmp -- osmp-mcp registers it. The SDK is separate and available per language — pip install osmp, npm install osmp-protocol, cargo add osmp, or the Go module. No account and no key. If you use the SDK path rather than MCP, the documented approach is to add the usage doctrine to your model's system prompt and wire encode, decode and validate into your own agent loop.
One command — pip install osmp-mcp
USE CASES
Compose the instruction in the compact form so it fits a single low-bandwidth packet.
Validate against the grammar and dictionary before transmitting, so bad opcodes fail at composition time.
Look up a code in the bundled corpora without a network call.
Invoke a pre-validated macro instead of composing the whole instruction chain each time.
Listed in project code.
osmp_encodeEncode structured fields into a SAL instruction frame.
osmp_decodeDecode a SAL instruction string to structured fields and natural language. Handles compound instructions with operators (→ ∧ ∨ ; ∥ ↔).
osmp_compound_decodeAnalyze DAG topology and loss tolerance behavior of a compound SAL instruction.
osmp_lookupSearch the ASD opcode dictionary by namespace and/or keyword. Returns matching opcodes with definitions.
osmp_resolveResolve a single domain code from a D:PACK/BLK corpus to its description.
osmp_batch_resolveResolve multiple domain codes in one call. Codes are comma-separated.
osmp_discoverSearch a domain corpus by keyword and/or code prefix when you do not know the exact code.
osmp_benchmarkRun the canonical conformance test suite (55 vectors). Returns per-vector byte reduction and overall conformance status.
osmp_validateValidate a composed SAL instruction against all eight composition rules before emission.
osmp_composeCompose valid SAL from natural language.
osmp_macro_listList all registered macros.
osmp_macro_invokeInvoke a registered macro by ID with slot values.
osmp_bridge_registerRegister a non-OSMP peer with the SAL bridge.
osmp_bridge_sendSend a SAL instruction through the bridge to a peer.
osmp_bridge_receiveProcess an inbound message from a peer through the bridge.
osmp_bridge_statusGet bridge status and acquisition metrics.
osmp_bridge_comparisonGet side-by-side SAL vs NL byte comparison for all bridged messages to a peer.
osmp_eml_evaluateEvaluate a pre-built EML corpus chain at given input value(s).
osmp_eml_corpus_lookupLook up an EML corpus chain by name, or list all available chains.
BEFORE YOU INSTALL
19 tools registered in the project's code.
The documented client runs the server on your machine.
INSTALLATION
pip install osmp-mcpclaude mcp add osmp -- osmp-mcp