Expand description
Reusable building blocks for Rust-native MCP servers.
The mcp-server binary (in the sibling crates/mcp-server crate)
is a complete generic MCP server: source navigation, GitHub access
(issues + REST API with drill-down), workspace mode (github
clone-and-track or local directory bind), watch mode, and
manifest-driven Cypher / tool registration. Downstream crates that
want the same framework with domain-specific tools layered on top
depend on mcp-methods and call into the public modules below.
Typical layering pattern:
- Construct
server::ServerOptionsfrom a manifest, optionally binding source roots, a default repo, or a workspace handle. let mut server = server::McpServer::new(options);- Register your domain-specific tools with
server::McpServer::register_typed_tool— typed arg struct plus aFn(T) -> Stringhandler. (For lower-level control, useserver::McpServer::tool_router_mutand rmcp’sToolRoutedirectly.) server.serve(rmcp::transport::stdio()).await.
See kglite-mcp-server for a real example: it adds cypher_query,
graph_overview, and save_graph tools that close over an active
graph handle. Python authors running a FastMCP server can compose
tools via the mcp_methods.fastmcp helper submodule (Python-side).
Note: the legacy embedder: / tools[].python: extension hooks
that lived here in 0.3.25 have been removed. They required PyO3 in
the framework’s source, which violated the pure-Rust constraint of
this crate. Downstream Python-aware servers (kglite, etc.) implement
their equivalent via a thin pyo3 wrapper in their own cdylib.
Re-exports§
pub use manifest::find_sibling_manifest;pub use manifest::find_workspace_manifest;pub use manifest::load as load_manifest;pub use manifest::BuiltinsConfig;pub use manifest::EmbedderConfig;pub use manifest::Manifest;pub use manifest::ManifestError;pub use manifest::PythonTool;pub use manifest::SkillSource;pub use manifest::SkillsSource;pub use manifest::TempCleanup;pub use manifest::ToolSpec;pub use manifest::TrustConfig;pub use manifest::WorkspaceConfig;pub use manifest::WorkspaceKind;pub use runtime::init_tracing;pub use runtime::load_env_for_mode;pub use runtime::maybe_watch;pub use runtime::resolve_source_roots;pub use server::serve_prompts;pub use server::McpServer;pub use server::RepoProvider;pub use server::ServerOptions;pub use skills::library_bundled_skills;pub use skills::render_skill_template;pub use skills::write_skill_template;pub use skills::AppliesWhen;pub use skills::BundledSkill;pub use skills::GraphPropertyCheck;pub use skills::PredicateClause;pub use skills::PredicateOutcome;pub use skills::Registry as SkillRegistry;pub use skills::ResolvedRegistry;pub use skills::Skill;pub use skills::SkillActivation;pub use skills::SkillError;pub use skills::SkillFrontmatter;pub use skills::SkillPredicateEvaluator;pub use skills::SkillProvenance;pub use source::SourceRootsProvider;pub use watch::watch as watch_dir;pub use watch::ChangeHandler;pub use watch::WatchHandle;pub use workspace::PostActivateHook;pub use workspace::Workspace;
Modules§
- bundled_
skills_ index - Compile-time embedding of the framework’s bundled skills.
- cli
- Reusable helpers for skills-related CLI subcommands.
- env
.envdiscovery + loader.- manifest
- YAML manifest schema + loader.
- runtime
- Boot-time helpers shared by the framework binary and downstream
domain binaries (e.g.
kglite-mcp-server). - server
- MCP
ServerHandlerimplementation. - skills
- Skills-aware MCP — runtime types, frontmatter parsing, three-layer
resolution, and the
Registrybuilder downstream binaries consume to wire skills into their MCP server. - source
- Source-file tooling:
read_source/grep/list_source. - watch
- Filesystem-watcher subsystem for
--watch DIRmode. - workspace
- Workspace mode — two variants.