Skip to main content
Glama

cursor-rust-tools

by terhechte
dev-client.rs1.62 kB
// Not really an example. Instead, just a small client to test the MCP server. use anyhow::Result; use mcp_core::{ client::ClientBuilder, transport::ClientSseTransportBuilder, types::{ClientCapabilities, Implementation}, }; use serde_json::json; #[tokio::main] async fn main() -> Result<()> { let tool = std::env::args() .nth(1) .unwrap_or("symbol_references".to_string()); let client = ClientBuilder::new( ClientSseTransportBuilder::new("http://localhost:4000/sse".to_string()).build(), ) .build(); client.open().await?; client .initialize( Implementation { name: "echo".to_string(), version: "1.0".to_string(), }, ClientCapabilities::default(), ) .await?; let response = match tool.as_str() { "symbol_references" => { client .call_tool( "symbol_references", Some(json!({ "file": "/Users/terhechte/Developer/Rust/supatest/src/main.rs", "line": 26, "symbol": "ApiKey" })), ) .await? } "cargo_check" => { client .call_tool( "cargo_check", Some(json!({ "file": "/Users/terhechte/Developer/Rust/supatest/Cargo.toml", })), ) .await? } _ => todo!(), }; dbg!(&response); Ok(()) }

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/terhechte/cursor-rust-tools'

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