| Crates.io | mcp-execution-core |
| lib.rs | mcp-execution-core |
| version | 0.6.4 |
| created_at | 2026-01-04 00:18:12.587052+00 |
| updated_at | 2026-01-04 01:00:43.808674+00 |
| description | Core types, traits, and error handling for MCP execution |
| homepage | https://github.com/bug-ops/mcp-execution |
| repository | https://github.com/bug-ops/mcp-execution |
| max_upload_size | |
| id | 2021011 |
| size | 106,709 |
Foundation types, traits, and error handling for MCP Code Execution.
[dependencies]
mcp-execution-core = "0.6"
Or with cargo-add:
cargo add mcp-execution-core
[!IMPORTANT] Requires Rust 1.89 or later.
use mcp_execution_core::{ServerConfig, ServerId};
let config = ServerConfig::builder()
.command("docker".to_string())
.arg("run".to_string())
.arg("-i".to_string())
.arg("--rm".to_string())
.arg("ghcr.io/org/mcp-execution-server".to_string())
.env("LOG_LEVEL".to_string(), "debug".to_string())
.build();
let server_id = ServerId::new("github");
use mcp_execution_core::{ServerId, ToolName};
// Type-safe identifiers prevent mixing up strings
let server = ServerId::new("github");
let tool = ToolName::new("create_issue");
assert_eq!(server.as_str(), "github");
assert_eq!(tool.as_str(), "create_issue");
[!TIP] Strong types prevent accidentally passing a
ToolNamewhere aServerIdis expected.
use mcp_execution_core::{Error, Result};
fn process_server(id: &str) -> Result<()> {
if id.is_empty() {
return Err(Error::InvalidConfiguration {
message: "Server ID cannot be empty".to_string(),
});
}
Ok(())
}
use mcp_execution_core::{ServerConfig, validate_server_config};
let config = ServerConfig::builder()
.command("npx".to_string())
.arg("-y".to_string())
.arg("@modelcontextprotocol/server-github".to_string())
.build();
// Validates against command injection
validate_server_config(&config)?;
[!WARNING] Always validate server configurations before execution to prevent command injection attacks.
ServerId, ToolName instead of raw stringsthiserrorSend + Syncunsafe code blocks| Type | Description |
|---|---|
ServerId |
Unique server identifier (newtype over String) |
ToolName |
MCP tool name (newtype over String) |
ServerConfig |
Server configuration with command, args, env |
TransportType |
Transport type enum (Stdio, Http, Sse) |
Error |
Error type with contextual information |
Result<T> |
Alias for std::result::Result<T, Error> |
This crate is part of the mcp-execution workspace:
mcp-execution-introspector - MCP server analysismcp-execution-codegen - TypeScript code generationmcp-execution-files - Virtual filesystemmcp-execution-skill - SKILL.md generationmcp-execution-server - MCP server implementationmcp-execution-cli - Command-line interfaceMinimum Supported Rust Version: 1.89
MSRV increases are considered minor version bumps.
Licensed under either of Apache License 2.0 or MIT license at your option.