MCP 服务器 (NestJS)
使用NestJS构建的健壮、可扩展且易于扩展的服务器端应用程序。该项目为帖子和用户提供了模型上下文协议 (MCP) 服务器实现、文件管理、身份验证和模块化 REST API。
目录
特征
MCP 服务器:实现文件操作等的模型上下文协议。
文件管理:通过 REST 端点上传、下载、列出和删除文件。
身份验证:基于 JWT 的本地策略身份验证。
用户和帖子模块:具有 DTO 和实体的用户和帖子的模块化结构。
Swagger 集成:开箱即用的 API 文档。
可扩展:轻松添加新模块和功能。
建筑学
NestJS :用于构建高效、可靠且可扩展的服务器端应用程序的渐进式 Node.js 框架。
MCP 集成:使用自定义 FileBrowserMCP 进行文件操作。
模块化设计:每个功能都封装在自己的模块中。
入门
先决条件
安装
环境变量
在根目录中创建一个.env
文件,用于保存任何机密或配置覆盖(可选)。
发展
运行服务器
有用的命令
测试
运行单元测试
运行端到端(e2e)测试
测试覆盖率
部署
构建项目:
$ npm run build启动服务器:
$ npm run start:prod对于高级部署(Docker、云等),请参阅NestJS 部署文档。
API 参考
当服务器运行时,Swagger UI 可在
/api
上使用(如果启用)。主要终点:
POST /auth/login
— 验证并接收 JWTPOST /files/upload
— 上传文件GET /files/:id
— 下载文件DELETE /files/:id
— 删除文件GET /files
— 列出文件POST /users
— 创建用户POST /posts
— 创建帖子
有关更多详细信息,请参阅src/
中的控制器文件。
项目结构
贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/YourFeature
)提交您的更改(
git commit -am 'Add some feature'
)推送到分支(
git push origin feature/YourFeature
)打开拉取请求
编码标准
遵循现有的代码风格(参见 ESLint 配置)
为新功能编写单元测试和端到端测试
记录您的代码并根据需要更新 README
Git 设置
该项目使用 Git 进行版本控制。远程源设置为:
执照
Nest 已获得 MIT 许可。
资源与支持
如有任何疑问、问题或功能请求,请打开问题或联系维护人员。
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个强大的服务器端应用程序,它为文件操作实现模型上下文协议 (MCP),为管理文件、用户和帖子提供身份验证和模块化 REST API。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that provides file system operations, analysis, and manipulation capabilities through a standardized tool interface.Last updated -5MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that enables enhanced file system operations including reading, writing, copying, moving files with streaming capabilities, directory management, file watching, and change tracking.Last updated -17MIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that allows AI models to safely access and interact with local file systems, enabling reading file contents, listing directories, and retrieving file metadata.Last updated -610MIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides secure and intelligent interaction with files and filesystems, offering smart context management and token-efficient operations for working with large files and complex directory structures.Last updated -2148MIT License