Get the FREE Ultimate OpenClaw Setup Guide →

cotlib

cotlib is a secure, high-performance Go library for parsing, validating, and generating Cursor-on-Target (CoT) XML messages. It features a comprehensive, embedded type catalog with metadata and XSD catalogue, robust validation logic, and LLM/AI-friendly search APIs. Designed for reliability, composability, and security.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio nervsystems-cotlib docker run -i nervsystems/cotlib:latest \
  --env CGO_ENABLED="1" \
  --env LD_LIBRARY_PATH="/usr/lib:/usr/local/lib"

How to use

cotlib is a Go library for creating, validating, and manipulating Cursor-on-Target (CoT) events. It provides high-performance event creation, XML serialization/deserialization with security protections, and a full type catalog for CoT metadata. The library also supports advanced TAK/GeoChat extensions, predicate-based classification, and robust handling of detail extensions, including the TAK-specific schemas. To use cotlib in your application, import the library, construct CoT events with NewEvent or EventBuilder, enrich them with details such as Contact, Group, and Link, and then serialize to XML for transmission. The API is designed for zero-allocation style lookups and safe concurrent usage, making it suitable for high-throughput CoT processing pipelines.

You can rely on the sample snippets in the README to start quickly: creating a new event, populating detail fields, and converting to XML. The library also demonstrates parsing CoT XML back into event objects, validating extended TAK details, and handling unknown elements verbatim when needed. For advanced usage, you can leverage the built-in Shape, Chat, and Remarks support, along with the event builder pattern to chain configuration before finalizing the event.

How to install

--- Prerequisites

  • Go 1.17+ (modules enabled)
  • Git

--- Install from source

  1. Clone the repository git clone https://github.com/NERVsystems/cotlib.git cd cotlib

  2. Initialize a Go module (if not already) go mod init github.com/NERVsystems/cotlib

  3. Fetch dependencies and build go get ./... go build ./...

  4. Run a quick example (from the repository examples or your own main) go run ./examples/main.go

--- Notes

  • Schema validation relies on libxml2 and CGO-enabled builds. Ensure CGO is enabled when building if you plan to validate XML schema.
  • See MIGRATION.md in the repo for upgrade guidance between versions.

Additional notes

  • cotlib includes TAK-oriented extensions and validates many known TAK elements against embedded schemas during decoding and validation.
  • Unknown elements within the Detail section are preserved in Detail.Unknown and serialized back verbatim, but they are not validated.
  • GeoChat and Chat receipts are fully supported, with fallbacks to TAK schemas when required to maximize interoperability between ATAK/WinTAK clients.
  • When upgrading, pay attention to required CGO dependencies and the embedded TAK schema validations to avoid runtime validation errors.
  • If you plan to serialize custom Shape or other Detail extensions, you can embed raw XML fragments via the provided Raw field (e.g., Shape{Raw: []byte(<shape .../>)}).

Related MCP Servers

Sponsor this space

Reach thousands of developers