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.
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
-
Clone the repository git clone https://github.com/NERVsystems/cotlib.git cd cotlib
-
Initialize a Go module (if not already) go mod init github.com/NERVsystems/cotlib
-
Fetch dependencies and build go get ./... go build ./...
-
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
edumcp
EDUMCP is a protocol that integrates the Model Context Protocol (MCP) with applications in the education field, dedicated to achieving seamless interconnection and interoperability among different AI models, educational applications, smart hardware, and teaching AGENTs.
lihil
2X faster ASGI web framework for python, offering high-level development, low-level performance.
laravel-toon
TOON encoding for Laravel. Encode data for AI/LLMs with ~50% fewer tokens than JSON.
neurolink
Universal AI Development Platform with MCP server integration, multi-provider support, and professional CLI. Build, test, and deploy AI applications with multiple ai providers.
mcp-web-ui
MCP Web UI is a web-based user interface that serves as a Host within the Model Context Protocol (MCP) architecture. It provides a powerful and user-friendly interface for interacting with Large Language Models (LLMs) while managing context aggregation and coordination between clients and servers.
gtm
An MCP server for Google Tag Manager. Connect it to your LLM, authenticate once, and start managing GTM through natural language.