contextgraph-host
The host runtime for the Context Graph Protocol: provider discovery, stdio + streamable-HTTP transports, capability negotiation, budget-honest fan-out routing, and egress consent gating.
A Context Graph Protocol host is the side of the protocol that asks for context. contextgraph-host
is a ready-made host you can embed in any Rust agent: register providers
(in-process, a child process over stdio, or a remote HTTP endpoint), fan a
query out to all of them concurrently, and get back frames that passed
consent, a timeout, and a budget-honesty audit — a provider that lies about
its token_cost has its frames dropped and reported, never silently trusted.
Depends only on contextgraph-types plus
ordinary async/transport crates (tokio, reqwest) — no dependency on
Stella or any of its other crates.
Example: query a stdio provider
use Host;
use ContextQuery;
# async
Example: implement a provider
Any type that implements ContextProvider can be host.register()-ed as
an in-process provider — no child process or network hop required:
use async_trait;
use ;
use ;
See Implementing a provider for the full guide, including the
stdio/HTTP transports (for providers written in any language, not just
Rust) and the consent-gating contract for egress providers.
Docs
- Protocol surface — the wire types this crate transports.
- Implementing a provider — the
ContextProvidertrait, the stdio/HTTP wire format, and the consent gate. - Running conformance — proving your provider is conformant
with
contextgraph-conformance. - Stability — the crate-semver vs. protocol-version relationship.
License
MIT OR Apache-2.0 — see LICENSE-MIT
/ LICENSE-APACHE
in the workspace root.