MCP 服务器 (NestJS)
使用NestJS构建的健壮、可扩展且易于扩展的服务器端应用程序。该项目为帖子和用户提供了模型上下文协议 (MCP) 服务器实现、文件管理、身份验证和模块化 REST API。
目录
Related MCP server: Desktop Commander MCP Server
特征
MCP 服务器:实现文件操作等的模型上下文协议。
文件管理:通过 REST 端点上传、下载、列出和删除文件。
身份验证:基于 JWT 的本地策略身份验证。
用户和帖子模块:具有 DTO 和实体的用户和帖子的模块化结构。
Swagger 集成:开箱即用的 API 文档。
可扩展:轻松添加新模块和功能。
建筑学
NestJS :用于构建高效、可靠且可扩展的服务器端应用程序的渐进式 Node.js 框架。
MCP 集成:使用自定义 FileBrowserMCP 进行文件操作。
模块化设计:每个功能都封装在自己的模块中。
入门
先决条件
安装
# Clone the repository
$ git clone https://github.com/Cstannahill/mcp-server-nestjs.git
$ cd nestjs-mcp-server
# Install dependencies
$ npm install环境变量
在根目录中创建一个.env文件,用于保存任何机密或配置覆盖(可选)。
发展
运行服务器
# Start in development mode (with hot reload)
$ npm run start:dev
# Start in production mode
$ npm run start:prod有用的命令
# Compile TypeScript
$ npm run build
# Lint code
$ npm run lint测试
运行单元测试
$ npm run test运行端到端(e2e)测试
$ npm run test:e2e测试覆盖率
$ npm run test:cov部署
构建项目:
$ 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/中的控制器文件。
项目结构
src/
app.module.ts # Root module
main.ts # Entry point
auth/ # Authentication (JWT, guards, strategies)
file/ # File management (upload, download, delete)
mcps/ # Model Context Protocol integration
posts/ # Posts module
users/ # Users module
database/ # Database connection (if used)
uploads/ # Uploaded files (local dev)贡献
分叉存储库
创建你的功能分支(
git checkout -b feature/YourFeature)提交您的更改(
git commit -am 'Add some feature')推送到分支(
git push origin feature/YourFeature)打开拉取请求
编码标准
遵循现有的代码风格(参见 ESLint 配置)
为新功能编写单元测试和端到端测试
记录您的代码并根据需要更新 README
Git 设置
该项目使用 Git 进行版本控制。远程源设置为:
https://github.com/Cstannahill/mcp-server-nestjs.git执照
Nest 已获得 MIT 许可。
资源与支持
如有任何疑问、问题或功能请求,请打开问题或联系维护人员。
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Cstannahill/mcp-server-nestjs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
