1212// See the License for the specific language governing permissions and
1313// limitations under the License.
1414
15+ #![ cfg_attr( docsrs, feature( doc_cfg) ) ]
16+ //! RustFS MCP server library.
17+ //!
18+ //! This crate exposes a Model Context Protocol (MCP) server that provides
19+ //! S3-compatible storage operations, plus reusable configuration and client
20+ //! primitives for embedding into other Rust applications.
21+ //!
22+ //! # Optional features
23+ //!
24+ //! - `io-uring`: Enables Tokio's `io-uring` integration. This requires building
25+ //! with `RUSTFLAGS="--cfg tokio_unstable"`.
26+
27+ #[ cfg( all( feature = "io-uring" , not( tokio_unstable) ) ) ]
28+ compile_error ! (
29+ "feature `io-uring` requires cfg `tokio_unstable` (set RUSTFLAGS/RUSTDOCFLAGS to \" --cfg tokio_unstable\" )"
30+ ) ;
31+
32+ /// Command-line and environment configuration parsing/validation.
1533pub mod config;
34+ /// S3 client wrapper and operation/result data types.
1635pub mod s3_client;
36+ /// MCP server and tool handlers.
1737pub mod server;
1838
39+ /// Runtime configuration for the server.
1940pub use config:: Config ;
41+ /// Bucket metadata and async S3 client wrapper.
2042pub use s3_client:: { BucketInfo , S3Client } ;
43+ /// MCP service implementation.
2144pub use server:: RustfsMcpServer ;
2245
2346use anyhow:: { Context , Result } ;
2447use rmcp:: ServiceExt ;
2548use tokio:: io:: { stdin, stdout} ;
2649use tracing:: info;
2750
28- /// Run the MCP server with the provided configuration
51+ /// Start the MCP server with an explicit [`Config`].
2952pub async fn run_server_with_config ( config : Config ) -> Result < ( ) > {
3053 info ! ( "Starting RustFS MCP Server with provided configuration" ) ;
3154
@@ -49,15 +72,17 @@ pub async fn run_server_with_config(config: Config) -> Result<()> {
4972 Ok ( ( ) )
5073}
5174
52- /// Run the MCP server with default configuration (from environment variables)
75+ /// Start the MCP server with [`Config:: default`].
5376pub async fn run_server ( ) -> Result < ( ) > {
5477 info ! ( "Starting RustFS MCP Server with default configuration" ) ;
5578
5679 let config = Config :: default ( ) ;
5780 run_server_with_config ( config) . await
5881}
5982
60- /// Validate environment configuration (legacy function for backward compatibility)
83+ /// Validate required AWS credentials in environment variables.
84+ ///
85+ /// This function is kept for backward compatibility.
6186pub fn validate_environment ( ) -> Result < ( ) > {
6287 use std:: env;
6388
0 commit comments