Skip to main content
Glama

CodeGraph CLI MCP Server

by Jakedismo
balancers.rsโ€ข957 B
use codegraph_lb::*; use std::sync::Arc; fn sample_pool() -> EndpointPool { let cfg = PoolConfig { endpoints: vec![ EndpointConfig { uri: "http://localhost:3001".into(), weight: 1, health_check_path: None, }, EndpointConfig { uri: "http://localhost:3002".into(), weight: 3, health_check_path: None, }, ], }; EndpointPool::from_config(&cfg).unwrap() } #[test] fn rr_picks_some_endpoint() { let pool = Arc::new(sample_pool()); let rr = RoundRobin::new(); let e = rr.pick(&pool, None).unwrap(); assert!(e.is_healthy()); } #[test] fn hrw_sticky_key() { let pool = Arc::new(sample_pool()); let hrw = HrwHashing::new(); let a = hrw.pick(&pool, Some(b"user:1")).unwrap().id; let b = hrw.pick(&pool, Some(b"user:1")).unwrap().id; assert_eq!(a.0, b.0); }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jakedismo/codegraph-rust'

If you have feedback or need assistance with the MCP directory API, please join our Discord server