文件操作微服务协议

一个基于Ruby on Rails的微服务命令协议(MCP)服务器,提供文件操作功能如文件拼接,并具有RESTful API接口和全面的测试覆盖。

  • by arockwell
  • Ruby
  • 本地部署
  • 更新于
在 GitHub 查看 arockwell/mcp-commands

使用说明

MCP命令

一个Ruby on Rails应用程序,为微服务命令协议(MCP)服务器提供文件操作命令。

特性

  • 文件连接命令
  • RESTful API接口
  • 使用RSpec和FakeFS进行全面测试覆盖

入门指南

先决条件

  • Ruby(在.Ruby版本中指定的版本)
  • 轨道
  • 打包机

安装

  1. 克隆存储库:
git clone https://github.com/yourusername/mcp-commands.git
cd mcp-commands
  1. 安装依赖项:
bundle install
  1. 设置数据库:
rails db:create db:migrate

运行服务器

启动Rails服务器:

rails server

API文档

连接文件

将多个文件连接到一个输出文件中。

端点: POST /mcp/concatenate

请求正文:

{
  "files": ["/path/to/file1.txt", "/path/to/file2.txt"],
  "output_path": "/path/to/output.txt"
}

答复:

{
  "success": true,
  "output_path": "/path/to/output.txt"
}

测试

运行测试套件:

bundle exec rspec

贡献

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add some amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。