Skip to main content

Crate agentstategraph_mcp

Crate agentstategraph_mcp 

Source
Expand description

Library surface of agentstategraph-mcp.

The binary (src/main.rs) re-uses these modules. Exposing them as a library lets integration tests under tests/ exercise the HTTP router, auth middleware, and rate-limit wiring directly against the same code paths the server runs in production.

Modules§

auth
Multi-tenant authentication middleware.
http
HTTP REST API for AgentStateGraph.
policy_signing
Adapter bridging agentstategraph_policy::SignatureVerifier to the agentstategraph_policy_sign::Ed25519Verifier + canonicalize primitives.
server
AgentStateGraph MCP Server — exposes AgentStateGraph operations as MCP tools.
store_gauges
The store gauges (DESIGN.md Plan H t-008): what’s in the store, sampled on a slow interval because counting reads every row’s key, and what the last garbage collection this server ran reclaimed.

Constants§

COMMIT_EVENTS_DIRECTIVE
The log filter directive that lets asg.commit events through whatever level the rest of the log runs at.

Functions§

commit_events_from_env
Whether each commit is logged as an asg.commit event (DESIGN.md Plan H t-010): only when ASG_COMMIT_EVENTS is 1, on, true or yes.
current_trace
The trace the current work belongs to, from oxtel’s current span context, as a commit links to it (DESIGN.md Plan H t-009). The server passes it to agentstategraph::link_commits_to_traces unless ASG_TRACE_LINKS is off.
trace_links_from_env
Whether commits are linked to their traces: yes, unless ASG_TRACE_LINKS is 0, off, false or no.
traces_filter
The server’s trace filter (DESIGN.md Plan H t-011). Spans at info, but not one per SQL statement: that cost a small read more than anything else telemetry does. ASG_SQL_SPANS=on adds them back, and RUST_LOG, when set, replaces the whole filter. db.client.operation.duration records either way.