1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! ``mcp-methods`` — pure-Rust primitives for building MCP servers.
//!
//! Zero PyO3 in this crate's source tree. Python bindings live in the
//! sibling `mcp-methods-py` crate, which depends on this rlib and adds
//! a `#[pymodule]` of PyO3 wrappers for the cdylib. Pure-Rust consumers
//! (kglite, any downstream Rust binary) depend on `mcp-methods`
//! directly and see no traces of Python in their dep tree or source.
//!
//! Public API surface — `use mcp_methods::<module>::<fn>;` from any
//! Rust crate:
//! - [`cache::ElementCache`] — drill-down cache for collapsed GitHub
//! discussion elements (code blocks, comments, patches, overflow).
//! - [`compact`] — text compaction utilities + adaptive budget-based
//! JSON discussion compaction.
//! - [`files::read_file`] — safe file reading with allowed-dir sandbox.
//! - [`git_refs`] — `org/repo` format validation + reference extraction.
//! - [`github`] — GitHub REST API client + issue/PR fetching with
//! smart compaction.
//! - [`grep`] — ripgrep-powered file + line search.
//! - [`html::html_to_text`] — lightweight HTML → markdown-flavoured text.
//! - [`json_grep::ripgrep_json_fields`] — extract fields from JSON text.
//! - [`list_dir::list_dir`] — tree-formatted directory listing.
//!
//! With `feature = "server"` (default-on), additionally:
//! - [`server`] — rmcp-backed MCP server framework (manifest parsing,
//! source/github tools, workspace mode, watch mode, etc.).