BSD Ports

misc/lean-ctx 3.11.4_1 FreeBSD

Hybrid Context Optimizer: MCP Server, reduces LLM token consumption

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
9c878207a1
License
MIT
Categories
misc
Package size
16411.6 KiB, 79775.3 KiB installed

Description

LeanCTX is a hybrid context optimizer designed to reduce token consumption in AI-assisted software engineering workflows. It acts as a cognitive filter between AI tools and Large Language Models (LLMs), stripping noise like comments and whitespace to lower costs and maximize context efficiency.

Features:

  • AST-Aware Compression: Uses Tree-sitter to parse 14 languages, preserving critical types and logic while reducing token counts by up to 90%.
  • MCP Server Integration: Provides 24 tools that replace standard file reads with compressed alternatives for any MCP-enabled AI client.
  • Automated Shell Hook: Intercepts and compresses output from over 90 common command patterns (git, npm, cargo, docker, kubectl, etc.).
  • Privacy and Performance: Single Rust binary with zero dependencies and no cloud requirements.

In the other systems

SystemPortVersion
FreeBSDmisc/lean-ctx3.11.4_1
MidnightBSDai/lean-ctx3.11.4
HardenedBSDmisc/lean-ctx3.10.5.146
GhostBSDmisc/lean-ctx3.8.11_2

Install

Binary package:

pkg install lean-ctx

From the ports tree:

cd /usr/ports/misc/lean-ctx/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	lean-ctx>0:misc/lean-ctx

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest3.10.5.1463.11.4_1---
FreeBSD:14:quarterly3.10.5.1463.10.5.146n/a--
FreeBSD:15:latest3.11.4_13.11.4_1n/a--
FreeBSD:15:quarterly3.10.5.1463.10.5.146n/an/an/a
FreeBSD:16:latest3.10.5.1463.11.4_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 1

Library 1

The full lists below include those, and their dependencies in turn.

Build dependencies 20
Run dependencies 2

No port depends on this one.

Configuration

No options to configure.

USES
cargo
Service scripts
lean-ctx

Message after installing

lean-ctx is a Model Context Protocol (MCP) server.

The Model Context Protocol (MCP) is an open standard that allows developers
to build secure, two-way connections between their data sources and AI models.
It enables AI models to interact with external tools and data in a standardized
way.

Communication with lean-ctx can be done via multiple transports:
* STDIO: The default transport for local MCP servers, where the host
  communicates with the server over standard input and output.
* HTTP: Using Server-Sent Events (SSE) for server-to-client communication.

The HTTP transport is particularly beneficial as it allows lean-ctx to run
as a remote service, enabling multiple clients to connect to a single
server instance, and facilitating use cases where the AI model and the
data source are on different machines.

Note that using the HTTP transport requires setting up and starting the
lean_ctx service. You can enable it by adding lean_ctx_enable="YES"
to /etc/rc.conf and starting it with:
# service lean_ctx start

Files

distinfo 585
FileSizeSHA256
rust/crates/adler2-2.0.1.crate13366320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa
rust/crates/adobe-cmap-parser-0.4.1.crate3841ae8abfa9a4688de8fc9f42b3f013b6fffec18ed8a554f5f113577e0b9b3212a3
rust/crates/aead-0.5.2.crate15509d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0
rust/crates/aes-0.8.4.crate124812b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0
rust/crates/aes-0.9.2.crate112494f8eb277bec05f56a0e0591f155a484cbd0f4f07ff2905051a48c72f004f7ed58
rust/crates/ahash-0.8.12.crate434135a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75
rust/crates/aho-corasick-1.1.5.crate184315c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba
rust/crates/alloca-0.4.0.crate4257e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4
rust/crates/allocator-api2-0.2.21.crate63622683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923
rust/crates/android_system_properties-0.1.6.crate5625ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc
rust/crates/anes-0.1.6.crate238574b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299
rust/crates/anstream-1.0.0.crate28916824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d
rust/crates/anstyle-1.0.14.crate17787940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000
rust/crates/anstyle-parse-1.0.0.crate2204252ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e
rust/crates/anstyle-query-1.1.5.crate1026440c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc
rust/crates/anstyle-wincon-3.0.11.crate12638291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d
rust/crates/anyhow-1.0.104.crate48819330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470
rust/crates/argon2-0.5.3.crate287953c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072
rust/crates/arrayref-0.3.9.crate918676a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb
rust/crates/arrayvec-0.7.8.crate33260d3fb67a6e08acf24fdeccbac2cb6ac4305825bd1f117462e0e6f2f193345ad56

Commit history 9

DateCommitCreditsLog message
9c878207a1 Mikael Urankar lang/rust: Bump revisions after 1.99.0
PR: 299016
caeffccb83 Yuri Victorovich misc/lean-ctx: update 3.11.2 → 3.11.4
c93394be1b Yuri Victorovich misc/lean-ctx: update 3.10.5-146 → 3.11.2
18a05017c0 Yuri Victorovich misc/lean-ctx: update 3.10.5 → 3.10.5.146
FreeBSD specific fixes.
799de5b417 Yuri Victorovich misc/lean-ctx: update 3.10.2 → 3.10.5

The latest 5 of 9 in the history this site was built from.