Axum-HTTP-MCP-Server

Axum-HTTP-MCP-Server

site icon
2025.03.30 1
RustHTTP 服务器计数器其它
Axum-HTTP-MCP-Server 是一个基于 Rust 和 WasmEdge 的 HTTP 服务器,主要用于提供计数器功能。它支持通过 HTTP 请求对计数器进行增、减和查询操作。
View on GitHub

Overview

基本能力

产品定位

Axum-HTTP-MCP-Server 是一个轻量级的 HTTP 服务器,主要用于提供计数器功能。

核心功能

  1. 提供计数器功能,支持增、减和查询操作。
  2. 基于 Rust 和 WasmEdge 构建,具有高性能和跨平台特性。

适用场景

  1. 需要简单计数器功能的应用程序。
  2. 需要轻量级 HTTP 服务器的场景。

工具列表

  1. counter:提供计数器功能,支持增、减和查询操作。

常见问题解答

  1. 如何启动服务器?
  2. 安装 WasmEdge Runtime 后,使用 wasmedge --dir .:. ./target/wasm32-wasip1/release/axum-mcp-server.wasm 命令启动服务器。
  3. 如何测试服务器?
  4. 使用 curl 命令发送 HTTP 请求测试计数器功能。

使用教程

使用依赖

  1. 安装 WasmEdge Runtime bash curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- -v 0.14.1

安装教程

  1. 克隆仓库 bash git clone https://github.com/apepkuss/axum-http-mcp-server.git cd axum-http-mcp-server cargo build --release

调试方式

  1. 启动服务器 bash wasmedge --dir .:. ./target/wasm32-wasip1/release/axum-mcp-server.wasm
  2. 测试计数器功能
  3. 增加计数器 bash curl -X POST http://localhost:10086/api/counter \ --header "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "counter", "arguments": { "operation": "increment" } } }'
  4. 减少计数器 bash curl -X POST http://127.0.0.1:10086/api/counter \ --header "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "counter", "arguments": { "operation": "decrement" } } }'
  5. 查询计数器值 bash curl -X POST http://127.0.0.1:10086/api/counter \ --header "Content-Type: application/json" \ --data '{ "jsonrpc": "2.0", "id": 5, "method": "tools/call", "params": { "name": "counter", "arguments": { "operation": "get_value", } } }'

许可证

None