Skip to main content

Crate mcp_execution_server

Crate mcp_execution_server 

Source
Expand description

MCP server library for progressive loading generation.

This crate provides an MCP server that helps generate progressive loading TypeScript files for other MCP servers. It leverages Claude’s natural language understanding for tool categorization - no separate LLM API needed.

§Architecture

The server implements three main tools:

  1. introspect_server - Connect to a target MCP server and discover its tools
  2. save_categorized_tools - Generate TypeScript files with Claude’s categorization
  3. list_generated_servers - List all servers with generated files

§Workflow

  1. User asks Claude to generate progressive loading for an MCP server
  2. Claude calls introspect_server to discover tools
  3. Claude analyzes tool metadata and assigns categories, keywords, descriptions
  4. Claude calls save_categorized_tools with categorization
  5. Server generates TypeScript files with discovery headers

§Examples

use mcp_execution_server::service::GeneratorService;
use rmcp::transport::stdio;
use rmcp::ServiceExt;

// Create and run the service
let service = GeneratorService::new().serve(stdio()).await?;
service.waiting().await?;

§State Management

The server maintains temporary session state between introspect_server and save_categorized_tools calls. Sessions expire after 30 minutes and are cleaned up lazily.

§Key Benefits

  • No LLM API: Claude (the conversation LLM) does categorization
  • Human-in-the-loop: User can review and adjust categories
  • Progressive loading: 98% token savings (30,000 → 500-1,500 tokens)
  • Type-safe: Full TypeScript types from MCP schemas
  • Discoverable: grep-friendly headers for tool discovery

Re-exports§

pub use service::GeneratorService;
pub use state::StateManager;
pub use types::CategorizedTool;
pub use types::GeneratedServerInfo;
pub use types::IntrospectServerParams;
pub use types::IntrospectServerResult;
pub use types::ListGeneratedServersParams;
pub use types::ListGeneratedServersResult;
pub use types::PendingGeneration;
pub use types::SaveCategorizedToolsParams;
pub use types::SaveCategorizedToolsResult;
pub use types::ToolGenerationError;
pub use types::ToolMetadata;

Modules§

service
MCP server implementation for progressive loading generation.
state
State management for pending generation sessions.
types
Type definitions for MCP server tools.

Structs§

GenerateSkillParams
Parameters for generating a skill.
GenerateSkillResult
Result from generate_skill tool.
SaveSkillParams
Parameters for saving a skill.
SaveSkillResult
Result from saving a skill.
SkillCategory
A category of tools for the skill.
SkillMetadata
Metadata extracted from saved skill.
SkillTool
Tool information for skill generation.
ToolExample
Example tool usage for documentation.