mcp-server-rust
by lotharschulz
A simple Rust function designed for integration with an MCP (Model Context Protocol) client, specifically for use with Claude Desktop. It allows you to extend Claude's capabilities with custom Rust-based functions.
Last updated: N/A
What is mcp-server-rust?
This is an MCP server implemented in Rust that provides a function (likely factorial, based on the screenshots) to be used within the Claude Desktop application. It leverages WebAssembly (WASM) to execute the Rust code in the JavaScript environment of Claude Desktop.
How to use mcp-server-rust?
- Build the Rust and JavaScript/TypeScript code using
npm run build:wasm:release
andnpm install
. 2. Configure Claude Desktop by adding a new entry to theclaude_desktop_config.json
file, specifying the command to run the server (e.g.,node
) and the path to theindex.js
file. 3. Start Claude Desktop and agree to use the MCP server function. The function should then be available within Claude Desktop.
Key features of mcp-server-rust
Rust-based function
WASM compilation
MCP integration
Claude Desktop compatibility
Use cases of mcp-server-rust
Extending Claude's functionality with custom logic
Performing calculations within Claude
Integrating external data sources with Claude
Automating tasks within Claude
FAQ from mcp-server-rust
How do I build the Rust code?
How do I build the Rust code?
Use the command npm run build:wasm:release
.
Where do I configure the MCP server in Claude Desktop?
Where do I configure the MCP server in Claude Desktop?
Create or modify the claude_desktop_config.json
file in the appropriate location for your operating system (macOS or Windows).
What if I get a 'rust import failed' error?
What if I get a 'rust import failed' error?
Run npm run build:wasm:release
to ensure the WASM binding is correctly built and available.
How do I test the Rust code?
How do I test the Rust code?
You can use npm run test:rust
or navigate to the src/lib/rust-functions-lib
directory and run cargo test && cargo fmt --all -- --check
.
How do I clean the output files?
How do I clean the output files?
Use the command npm run clean
.