liunian321/Local_MCP_Server
3.1
If you are the rightful owner of Local_MCP_Server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
This is a lightweight, high-concurrency MCP server built with Rust and the Axum framework, compatible with the Model Context Protocol (MCP) 2025-06-18 standard.
Tools
6
Resources
0
Prompts
0
Local MCP Server
这是一个兼容 Model Context Protocol (MCP) 2025-06-18 标准,基于 Rust 和 Axum 框架构建的轻量级高并发 MCP 服务器, 支持 LM Studio 等 MCP 客户端。
快速开始
前置要求
- Rust 1.70+
- Cargo
安装步骤
-
配置服务器
cp config_example.yaml config.yaml # 编辑 config.yaml 文件,设置端口等参数 -
启动服务器
cargo run -
配置客户端
- 复制
mcp.json.example为mcp.json - 调整端口号配置
- 在 MCP 客户端中加载配置
- 复制
配置
配置文件 (config.yaml)
⚠️ 注意: 配置文件必须放在项目根目录下
# 服务器监听端口
listen_port: 3000
客户端配置 (mcp.json)
{
"mcpServers": {
"local_mcp_server": {
"url": "http://127.0.0.1:3000/"
}
}
}
工具列表
系统工具
- 系统信息获取
- 时间工具
- 文件读取
- 文件列表
网络工具
- Ping 测试
- 当前 IP 查询和域名 IP 查询
其他工具
- 随机字符串生成
开发
项目结构
src/
├── main.rs # 主程序入口
├── config/ # 配置管理
├── router/ # 路由处理
├── tools/ # 工具实现
│ ├── public/ # 公共工具
│ │ ├── network/ # 网络工具
│ │ └── system/ # 系统工具
│ └── handler.rs # 工具处理器
使用说明
- 执行命令,下载rust 和 cargo
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
复制 config_example.yaml 为 config.yaml
-
在项目目录执行
cargo run
-
在LM Studio中配置MCP服务器, 配置文件为mcp.json
-
在LM Studio中点击按钮启用 mcp 服务器.
许可证
本项目采用自定义许可证。任何修改、二次开发或商业使用都需要原作者明确许可。
详细条款请查看 文件。
支持
如有问题或建议,请提交 。
注意: 本项目仅供学习和个人使用。商业用途或二次开发请联系原作者。