| Port details |
- lean-ctx Hybrid Context Optimizer: MCP Server, reduces LLM token consumption
- 3.5.25 misc
=0 2.8.2Version of this port present on the latest quarterly branch. - Maintainer: yuri@FreeBSD.org
 - Port Added: 2026-03-29 19:06:30
- Last Update: 2026-05-14 03:13:50
- Commit Hash: c27201e
- License: MIT
- WWW:
- https://leanctx.com
- https://github.com/yvgude/lean-ctx
- 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.
 ¦ ¦ ¦ ¦ 
- Manual pages:
- FreshPorts has no man page information for this port.
- pkg-plist: as obtained via:
make generate-plist - USE_RC_SUBR (Service Scripts)
-
- Dependency lines:
-
- To install the port:
- cd /usr/ports/misc/lean-ctx/ && make install clean
- To add the package, run one of these commands:
- pkg install misc/lean-ctx
- pkg install lean-ctx
NOTE: If this package has multiple flavors (see below), then use one of them instead of the name specified above.- PKGNAME: lean-ctx
- Flavors: there is no flavor information for this port.
- distinfo:
- TIMESTAMP = 1778728091
SHA256 (rust/crates/adler2-2.0.1.crate) = 320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa
SIZE (rust/crates/adler2-2.0.1.crate) = 13366
Packages (timestamps in pop-ups are UTC):
- Dependencies
- NOTE: FreshPorts displays only information on required and default dependencies. Optional dependencies are not covered.
- Build dependencies:
-
- gmake : devel/gmake
- rust>=1.95.0 : lang/rust
- cmake : devel/cmake-core
- pkgconf>=1.3.0_1 : devel/pkgconf
- Library dependencies:
-
- libzstd.so : archivers/zstd
- There are no ports dependent upon this port
Configuration Options:
- No options to configure
- Options name:
- misc_lean-ctx
- USES:
- cargo
- pkg-message:
- For install:
- 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
- Master Sites:
|
| Commit History - (may be incomplete: for full details, see links to repositories near top of page) |
| Commit | Credits | Log message |
3.5.25 14 May 2026 03:13:50
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.23 → 3.5.25 |
3.5.23 13 May 2026 16:16:51
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.21 → 3.5.23 |
3.5.21 13 May 2026 00:47:02
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.18 → 3.5.21 |
3.5.18 12 May 2026 08:42:36
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.14 → 3.5.18 |
3.5.14 11 May 2026 07:15:16
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.13 → 3.5.14
Reported by: portscout |
3.5.13 10 May 2026 07:48:03
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.8 → 3.5.13 |
3.5.8 09 May 2026 06:51:55
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.5.1 → 3.5.8
Reported by: portscout |
3.5.1 07 May 2026 08:01:05
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.7 → 3.5.1 |
3.4.7 02 May 2026 09:03:58
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.6 → 3.4.7 |
3.4.6 01 May 2026 04:29:25
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.5 → 3.4.6 |
3.4.5 29 Apr 2026 15:28:48
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.3 → 3.4.5 |
3.4.3 28 Apr 2026 05:32:46
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.2 → 3.4.3 |
3.4.2 27 Apr 2026 18:42:54
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.4.1 → 3.4.2 |
3.4.1_1 27 Apr 2026 12:26:47
    |
Mikael Urankar (mikael)  |
lang/rust: Bump revisions after 1.95.0
PR: 294615 |
3.4.1 26 Apr 2026 00:13:41
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.3.6 → 3.4.1 |
3.3.6 24 Apr 2026 08:33:35
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.3.5 → 3.3.6 |
3.3.5 24 Apr 2026 08:33:33
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.3.3 → 3.3.5
Reported by: portscout |
3.3.3 23 Apr 2026 03:45:30
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.3.2 → 3.3.3 |
3.3.2 22 Apr 2026 03:03:44
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.3.1 → 3.3.2 |
3.3.1 21 Apr 2026 18:42:58
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.2.9 → 3.3.1 |
3.2.9 21 Apr 2026 00:22:03
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.2.8 → 3.2.9 |
3.2.8 20 Apr 2026 03:57:19
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.2.7 → 3.2.8 |
3.2.7 19 Apr 2026 17:49:33
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.2.5 → 3.2.7 |
3.2.5 18 Apr 2026 20:58:23
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.2.3 → 3.2.5 |
3.2.3 18 Apr 2026 02:36:58
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.1.5 → 3.2.3 |
3.1.5 16 Apr 2026 06:57:19
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.1.2 → 3.1.5 |
3.1.2 15 Apr 2026 07:43:16
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.1.1 → 3.1.2 |
3.1.1 14 Apr 2026 19:40:41
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.0.3 → 3.1.1 |
3.0.3 13 Apr 2026 07:57:46
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.0.1 → 3.0.3 |
3.0.1 11 Apr 2026 20:37:59
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 3.0.0 → 3.0.1 |
3.0.0 10 Apr 2026 20:52:25
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 2.21.11 → 3.0.0 |
2.21.11 10 Apr 2026 09:40:52
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 2.20.0 → 2.21.11 |
2.20.0 08 Apr 2026 15:19:17
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 2.9.11 → 2.20.0 |
2.9.11 31 Mar 2026 09:46:52
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: update 2.8.2 → 2.9.11 |
2.8.2 29 Mar 2026 19:03:38
    |
Yuri Victorovich (yuri)  |
misc/lean-ctx: New port: Hybrid Context Optimizer: MCP Server, reduces LLM token
consumption |