Integrates with Express web framework, allowing the MCP server to be placed after the Express layer in the application stack and leverage Express for HTTP connections.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MCP Serveradd a CRUD tool for my User model"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Server - A Node In Layers Package for building MCP Servers
This library adds the ability to easily create MCP servers with Node In Layers.
It has a companion library called '@node-in-layers/mcp-client' which is used for creating MCP clients. These two libraries share the same functions for defining models and tools.
New Layer
This library adds a new layer mcp to the system. It should be placed after the express layer.
Related MCP server: Node Omnibus MCP Server
Usage
In order to use this library, you must make additions to your config, as well as create and export "mcp" layers from your apps/domains.
Config
you add this app/domain to your config file. You should do this before your apps which will add tools to the MCP server.
You then configure the mcp app/domain with the following:
Creating an MCP Layer
You can create an MCP layer by exporting a function from your app/domain that returns a layer.
Adding Models
You can wrap your models with CRUDS functions and add them to the MCP server with the mcp layer. NOTE: In order for this to work your layer must have both a services and a features layer. (In addition to your models.) Node in layers will automatically create a cruds property for you with your models, and you can add them.
Here is an example of doing it one at a time. (Not generally recommended, but doable).
Here is a way that you can really cook with gas. (Highly recommended)
Another way to organize adding models is from a centralized mcp domain. Put this as your very last domain after all your other domains have been loaded.