MCP 服务器 - 用于构建 MCP 服务器的 Node In Layers 包
该库增加了使用 Node In Layers 轻松创建 MCP 服务器的功能。
它有一个名为“@node-in-layers/mcp-client”的配套库,用于创建 MCP 客户端。这两个库在定义模型和工具方面共享相同的功能。
新建图层
此库为系统添加了一个新层mcp
。它应放置在express
层之后。
用法
为了使用这个库,您必须对您的配置进行添加,以及从您的应用程序/域中创建和导出“mcp”层。
配置
将此应用/域名添加到您的配置文件中。您应该在将工具添加到 MCP 服务器的应用程序之前执行此操作。
然后使用以下内容配置mcp
app/domain:
创建 MCP 层
您可以通过从应用程序/域导出返回层的函数来创建 MCP 层。
添加模型
您可以使用 CRUDS 函数包装您的模型,并通过 mcp 层将它们添加到 MCP 服务器。注意:为了实现此功能,您的层必须同时包含服务层和功能层。(除了您的模型之外。)层中的节点会自动为您的模型创建一个 cruds 属性,您可以添加它们。
下面是一个逐个执行的示例。(通常不推荐,但可行)。
这里有一种方法,让你真正用煤气做饭。(强烈推荐)
另一种组织添加模型的方式是使用集中式 mcp 域。在所有其他域都加载完成后,将其作为最后一个域。
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Node In Layers 包简化了 MCP(模型控制协议)服务器的创建,并提供了用于定义模型、添加 CRUD 操作和与客户端交互的工具。
Related MCP Servers
- -securityAlicense-qualityNode.js server implementing Model Context Protocol (MCP) for filesystem operations.Last updated -41,92157,592TypeScriptMIT License
- AsecurityAlicenseAqualityA beginner-friendly Model Context Protocol (MCP) server that helps users understand MCP concepts, provides interactive examples, and lists available MCP servers. This server is designed to be a helpful companion for developers working with MCP. Also comes with a huge list of servers you can install.Last updated -3936JavaScriptApache 2.0
- AsecurityAlicenseAqualityAn MCP server enabling secure interaction with n8n workflows, executions, and settings via the Model Context Protocol, designed for integration with Large Language Models (LLMs).Last updated -336534TypeScriptMIT License
- AsecurityAlicenseAqualityA comprehensive Model Context Protocol server that provides advanced Node.js development tooling for automating project creation, component generation, package management, and documentation with AI-powered assistance.Last updated -72JavaScriptMIT License