2 releases
| 0.1.3 | Jan 3, 2026 |
|---|---|
| 0.1.2 | Jan 1, 2026 |
#5 in #enki
Used in enki-runtime
145KB
2.5K
SLoC
MCP (Model Context Protocol) integration module.
This module provides MCP support for Enki agents, enabling:
- Server mode: Expose Enki agents as MCP servers
- Client mode: Connect to external MCP servers and use their tools
Features
Enable MCP support by adding the mcp feature flag:
Enki-runtime = { version = "0.1", features = ["mcp"] }
Example: Using External MCP Tools
use enki_runtime::mcp::{McpClient, McpTransport};
use enki_runtime::LlmAgent;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
// Connect to an MCP server
let mcp_client = McpClient::connect(McpTransport::Stdio {
command: "npx".into(),
args: vec!["-y".into(), "@modelcontextprotocol/server-filesystem".into()],
}).await?;
// Create agent with MCP tools
let mut agent = LlmAgent::builder("my-agent", "ollama::gemma3:latest")
.build()?;
agent.with_mcp_tools(mcp_client).await?;
Ok(())
}
Dependencies
~22–40MB
~500K SLoC