Get the FREE Ultimate OpenClaw Setup Guide →

mcp -rust

Rust MCP Local Server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio lotharschulz-mcp-server-rust node [your local path]/mcpserver/build/index.js

How to use

This MCP server wraps a simple Rust function and exposes it to an MCP client via a Node.js entry point. The project integrates Rust-compiled logic (via wasm) with a JavaScript/TypeScript wrapper, allowing you to call the Rust function through the MCP protocol. In Claude Desktop, you point a local build output (the index.js file) to the MCP server entry, enabling Claude to request the function and receive results. The typical flow is to build the Rust wasm bindings, install dependencies, and run the node-based server that serves the WASM-backed function to your MCP client.

To use the tools, configure Claude Desktop to load the local mcpserver build index.js as shown in the configuration example. When you start Claude Desktop with this MCP server enabled, you will see the MCP server function icon in the frontend and can grant permission to use the function. The Rust function implemented in this repository is exposed through the MCP client, so you can invoke it by sending an MCP request to the server and reading back the computed result (e.g., factorial or other test functions implemented in the Rust code). The development workflow emphasizes building the WASM bindings, installing dependencies, and then running the Node server that serves the function to clients.

If you are testing locally, you can run the provided npm scripts to build and verify the Rust/WASM integration, then test calls against the server. The README mentions commands to release the wasm bindings, run tests, and verify imports, which are part of validating that the MCP server correctly exposes the Rust function to clients.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Rust toolchain installed (rustc, cargo)
  • Optional: wasm-pack if you are building WebAssembly bindings separately

Step-by-step installation:

  1. Install dependencies
npm install
  1. Build the Rust WASM bindings for release (produces the wasm and JS glue)
npm run build:wasm:release
  1. Build the JavaScript/TypeScript wrapper and prepare the package (as described in the release steps)
npm install
  1. (Optional) Run tests for the Rust code to ensure correctness
npm run test:rust
  1. Start or configure your MCP server entry point (see README for exact path to index.js used by Claude Desktop)

Notes:

  • The configuration example shows a Node.js based server at a local path: [your local path]/mcpserver/build/index.js
  • Ensure the build output path matches what your mcp_config references
  • For Claude Desktop, ensure the configuration file is placed in the correct user data/location per your OS (as shown in the README)

Additional notes

Tips and common issues:

  • If the Rust import fails, run npm run build:wasm:release to rebuild the wasm binding that the factorial import depends on.
  • Ensure the path in the mcp_config matches the actual location of your built index.js file used by the MCP server.
  • The Claude Desktop configuration uses a simple JSON with an mcpServers entry; adjust the server name if you have multiple MCP servers.
  • Rust testing can be run via npm run test:rust or via cargo test in src/lib/rust-functions-lib, depending on your workspace setup.
  • If you see permission prompts in Claude Desktop, grant access to the mcp server function to enable integration.

Related MCP Servers

Sponsor this space

Reach thousands of developers