pub struct McpConfig {
pub enabled: bool,
pub listen_address: String,
pub backend_host: String,
pub backend_port: u16,
pub backend_user: String,
pub backend_password: Option<String>,
pub backend_database: Option<String>,
pub read_only: bool,
pub contract: Option<String>,
pub auth_token: Option<String>,
}Expand description
MCP agent-gateway configuration. When enabled, the proxy exposes a native
MCP server so AI agents call query/list_tables/explain tools instead
of opening raw SQL connections — each call gated by the gateway’s policy
(read-only by default) and logged.
Fields§
§enabled: bool§listen_address: StringHTTP listen address for the MCP JSON-RPC endpoint.
backend_host: StringBackend the gateway runs tool SQL against.
backend_port: u16§backend_user: String§backend_password: Option<String>§backend_database: Option<String>§read_only: boolWhen true (default), the gateway refuses write/DDL statements — agents get a read-only database surface.
contract: Option<String>Name of an [[agent_contracts]] entry to enforce on every tool call
(scoped grants + repair hints). None = only the read_only guardrail.
auth_token: Option<String>Bearer token required on every MCP request. When set, a request without
Authorization: Bearer <token> is rejected. Absent (default) = open, so
set this for any non-loopback deployment — like the HTTP/GraphQL
gateways, MCP exposes SQL and must not be anonymous off localhost.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for McpConfig
impl<'de> Deserialize<'de> for McpConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for McpConfig
impl RefUnwindSafe for McpConfig
impl Send for McpConfig
impl Sync for McpConfig
impl Unpin for McpConfig
impl UnsafeUnpin for McpConfig
impl UnwindSafe for McpConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more