Kontext-Dev SDK
Rust SDK for accessing Kontext-Dev MCP servers.
Get Started
Add the SDK and runtime dependencies:
[]
= "0.1.0"
= { = "1", = ["macros", "rt-multi-thread"] }
Use the SDK:
use ;
async
Rust SDK for accessing Kontext-Dev MCP servers.
Add the SDK and runtime dependencies:
[dependencies]
kontext-dev = "0.1.0"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
Use the SDK:
use kontext_dev::{build_mcp_url, request_access_token, KontextDevConfig};
#[tokio::main]
async fn main() -> Result<(), kontext_dev::KontextDevError> {
let config = KontextDevConfig {
mcp_url: "https://mcp.example.com/mcp".to_string(),
token_url: "https://auth.example.com/oauth2/token".to_string(),
client_id: "client".to_string(),
client_secret: "secret".to_string(),
scope: kontext_dev::DEFAULT_SCOPE.to_string(),
server_name: kontext_dev::DEFAULT_SERVER_NAME.to_string(),
};
let token = request_access_token(&config).await?;
let url = build_mcp_url(&config, token.access_token.as_str())?;
println!("{url}");
Ok(())
}