Get the FREE Ultimate OpenClaw Setup Guide →

anet

🚀 A high-performance Rust server for Model Control Protocol (MCP) with JSON-RPC 2.0, NATS messaging, async support, and pluggable AI tools.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio marekkucak-anet-mcp-server cargo run --example basic_server

How to use

anet MCP Server is a Rust-based implementation of the Model Control Protocol (MCP). It enables clients and AI models to communicate over a standardized, JSON-RPC 2.0 compatible API using a NATS transport layer. The server is designed for building AI agent systems, orchestrating tools, and exposing JSON-RPC based services that can be composed into microservices or toolchains. Core capabilities include managing tools, prompts, and resources, while providing asynchronous request handling via Tokio for scalable operation. You can connect to a locally running or network-accessible NATS server, register tools, and then issue initialize, listTools, callTool, listResources, readResource, listPrompts, and getPrompt RPC calls to interact with the server and its tooling ecosystem.

To use the server, start a NATS server locally, then run the example server provided by the project or integrate your own tool implementations by implementing the Tool trait. Once running, clients can enumerate available tools, invoke tools with structured input, fetch resources or prompts, and receive JSON-RPC responses containing results or content payloads. The example demonstrates setting up a NATS transport to the mcp.requests subject and building a Server with a configurable set of capabilities, which can be extended with your own tools and resources.

How to install

Prerequisites:\n- Rust 1.70+ (stable)\n- NATS server (nats-server) running locally or accessible over the network\n\n1) Install Rust tooling if you haven't already:\n\n - Install Rust: https://www.rust-lang.org/tools/install\n\n2) Build or run the example server:\n\n - Ensure a NATS server is running (in another terminal):\n\n nats-server\n\n - Run the example server provided by the crate:\n\n cargo run --example basic_server\n\n3) Optional: Run the test client to verify functionality:\n\n cargo run --example test_client\n\n4) Integrate or implement your own tools by following the example Tool trait usage and wiring them into the ServerBuilder as shown in the README.

Additional notes

Tips and common considerations:\n- Ensure your NATS server is reachable at the address you configure in the transport (default in examples is nats://localhost:4222).\n- The server exposes a modular architecture: server, transport (NATS), tools, and types. You can implement your own Tool to extend capabilities.\n- For production, consider configuring TLS/secure NATS transports and authentication as part of the transport layer.\n- If you modify tools or resources, ensure the JSON schemas match the input/output expectations defined by the Tool trait and the MCP JSON-RPC methods.\n- The example uses the basic_server example to demonstrate core functionality; adapt the setup for your specific tooling and orchestration needs.

Related MCP Servers

Sponsor this space

Reach thousands of developers