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
A Node In Layers package for building MCP servers. It exposes your domains, features, and model CRUDs as MCP tools so an AI can discover and call them. Companion library: @node-in-layers/mcp-client (shared protocols for features, models, and tools).
This system is self-describing and automatically organizes tools into an optimized and efficient system, that reduces the total number of tools. This system also automatically includes prompting and examples that greatly increase AI tool selection and formatting accuracy in systems, to include in systems with hundreds, if not thousands of tools.
How To Use This
1. Install
2. Configure
3. What's Now Available
Features are automatically exposed (unless specifically hidden)
Model CRUDS are automatically exposed (unless specifically hidden)
An
mcplayer is now available to features, and includes additional capabilities in the namespace:McpNamespace. (Explained later)
4. Run The Server
You can very easily run the server in a simple script by doing the following:
Example with ./bin/mcp_server.mts file (feel free to copy paste)
Related MCP server: Node Omnibus MCP Server
Background and How This Works
MCP interface (domains, features, models)
The MCP tool surface is organized by domain, then features and models:
Domains — The AI can list domains (
list_domains), then for each domain list features (list_features) and (if present) list models. Only domains that have features or models exposed will be shown.Features — For a given domain/feature, the AI can get the schema (
describe_feature) and run it (execute_feature).Models — For a given domain/model, the AI can get the schema and run save, retrieve, delete, search, bulkInsert, bulkDelete.
The documentation returned to the AI (including what START_HERE returns) is configurable. By default the server provides instructions so the AI will:
List domains.
List features (and models) within a domain.
Describe a feature or model when it needs the schema.
Execute features and model CRUD operations with the right arguments.
So the AI learns the shape of the system from the configurable “start here” and default system entries, then uses the tools to list/describe/execute as needed.
Hiding components
You can restrict what is visible (as well as executable) to callers (e.g. certain domains, features, or all model CRUDs) so only the intended surface is exposed.
Configure hideComponents under the MCP config:
paths — Dot-separated paths to hide, e.g.
myDomain,myDomain.myFeature,myDomain.cruds,myDomain.cruds.MyModel.domains — Domain names to hide entirely (they won’t appear in
list_domains).allModels — If
true, no model CRUD tools are exposed.
Everything not hidden remains available. See Configuration details for the full shape.
Example (partial config):
System description
Under systemDescription you set static metadata for your system that is included in the start-here response:
description — Short system description for the AI.
version — System version string.
This is the right place for “what this system is” and version; it does not control which tools exist or what the START_HERE tool includes (that is under startHere).
Example (partial config):
Start here
The START_HERE tool is what makes the system navigable: the AI is instructed to call it first (or when the user asks for help). Its response is built from:
System metadata —
systemName,systemDescription,systemVersionfrom config.Default system entries — Built-in docs (e.g. “this is a domain-layered system”, “MCP navigation workflow”, “cross-layer props”). You can turn these off with
startHere.hideDefaultSystemEntries.Optional: include domains / include features — If
startHere.includeDomainsis true, the response includes the current list of domains (as iflist_domainshad been called). IfstartHere.includeFeaturesis true, it also includes the list of features per domain (as iflist_featureshad been called for each). So the AI gets domains and/or features without making extra tool calls.Examples of use — Custom entries you add under
startHere.examplesOfUse. These are where you document higher-level flows (e.g. “run feature A, then B, then C”). The built-in docs explain domains, features, and models; they do not explain your app-specific sequences. Put those inexamplesOfUse, as JSON object examples with minimal prose so the AI can apply them directly.
Include domains / include features
Enabling these is like pre-running list_domains and/or list_features and embedding the result in START_HERE. The downside is context size: for large systems (many tools), that can consume a lot of context and add noise. For small systems (on the order of 1–10 tools) it’s usually fine. For larger systems, prefer examples of use and let the AI call list_domains / list_features when needed.
Example (partial config):
}, })
Your tool is then exposed alongside the built-in domain/feature/model tools.
How to run the server
start — Start the MCP server (listens on the connection defined in config).
mcp[McpNamespace].start(systemContext, options?)getApp — Get the Express app (for HTTP/SSE) so you can mount it in your own server.
mcp[McpNamespace].getApp(options?)
Use start when the MCP server is the main process. Use getApp when you compose with an existing Express app (e.g. mount the MCP app at a path).
Middleware and routes
addPreRouteMiddleware(middleware) — Add Express middleware that runs before MCP route handling.
addAdditionalRoute(route) — Register an extra Express route (e.g. health or admin) on the same app.
Call these during setup (e.g. from a layer that has access to mcp[McpNamespace]) before the server is started or the app is used.
Changing logging configuration
Logging is configured under the logging section of the MCP config. You can control log levels and optionally add structured data to each request/response log entry.
requestLogLevel / responseLogLevel: Override the default log level (
info) for incoming requests and outgoing responses.requestLogGetData(input): Function that maps the raw request input into extra data to log.
responseLogGetData(result): Function that maps the raw tool result into extra data to log.
Example (partial config):