Expand description
MCP server introspection using rmcp official SDK.
This crate provides functionality to discover MCP server capabilities, tools, resources, and prompts using the official rmcp SDK. It enables automatic extraction of tool schemas for code generation.
§Architecture
The introspector connects to MCP servers via stdio transport and uses rmcp’s
ServiceExt trait to query server capabilities. Discovered information is
stored locally for subsequent code generation phases.
§Examples
use mcp_execution_introspector::Introspector;
use mcp_execution_core::{ServerId, ServerConfig};
let mut introspector = Introspector::new();
// Connect to github server
let server_id = ServerId::new("github");
let config = ServerConfig::builder()
.command("github-server".to_string())
.build();
let info = introspector
.discover_server(server_id, &config)
.await?;
println!("Server: {} v{}", info.name, info.version);
println!("Tools found: {}", info.tools.len());
for tool in &info.tools {
println!(" - {}: {}", tool.name, tool.description);
}Structs§
- Introspector
- MCP server introspector.
- Server
Capabilities - Server capabilities.
- Server
Info - Information about an MCP server.
- Tool
Info - Information about an MCP tool.