mcpField
M
Mcp Server Rust

Mcp Server Rust

Local
github.com/lotharschulzDeveloper Tools3Updated 81w ago

About Mcp Server Rust

Mcp Server Rust is a local MCP server that combines Rust functions with a JavaScript/TypeScript client setup. It is for users configuring the project in Claude Desktop and includes commands to build and test the Rust code.

Key features

  1. 01Rust functions compiled to WebAssembly
  2. 02JavaScript and TypeScript build steps
  3. 03Rust test and format checks
  4. 04Claude Desktop configuration

Use cases

  1. 01Building the Rust and WebAssembly output
  2. 02Connecting the local server in Claude Desktop
  3. 03Running Rust tests and formatting checks

MCP support

It connects Rust functions to an MCP client. The README shows how to configure the local server in Claude Desktop.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

A simple Rust function integrated with an MCP client.

Step 1: Relase the Rust & Javascript/TS code

Release
npm run build:wasm:release // release rust code
npm install // create javascript file and install all npm dependencies

Step 2: Claude Desktop Configuration

Create a configuration file at:

{
  "mcpServers": {
    "mcp-server": {
      "command": "node",
      "args": [
        "[your local path]/mcpserver/build/index.js"
      ]
    }
  }
}

locations:

Step 3: Claude Desktop

Start Claude Desktop

Claude Desktop Initial View please note the additional mcp server icon in the frontend

Agree to use the mcp server function:

Allow MCP server

Observe the mcp server function:

factorial function used

Video

Watch the video tutorial here: YouTube video

Misc

Test the rust code
npm run test:rust

or

cd src/lib/rust-functions-lib
cargo test && cargo fmt --all -- --check
Clean the output files and folders
npm run clean
Build the rust code - alternatives

npm

npm run build:wasm

Alternative approach using wasm tool

cd src/lib/rust-functions-lib
wasm-pack build --target bundler
Build only ts code (npm)
npm build
Copy build Rust code

manual copy to the correct location - included in npm run build:wasm:release

mkdir -p build/lib/rust-functions-lib/pkg && cp src/lib/rust-functions-lib/pkg/rust_funcations_lib.js build/lib/rust-functions-lib/pkg/rust_funcations_lib.js
Rust import failed

issue:

rust import failed

solution:

run npm run build:wasm:release to release the wasm-binding the factorial import depends on

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.