MCP Server
Servidor MCP: un paquete de nodos en capas para crear servidores MCP
Esta biblioteca agrega la capacidad de crear fácilmente servidores MCP con Node In Layers.
Cuenta con una biblioteca complementaria llamada '@node-in-layers/mcp-client', que se utiliza para crear clientes MCP. Ambas bibliotecas comparten las mismas funciones para definir modelos y herramientas.
Nueva capa
Esta biblioteca añade una nueva capa mcp al sistema. Debe colocarse después de la capa express .
Related MCP server: MCP Bone
Uso
Para poder utilizar esta biblioteca, debe realizar adiciones a su configuración, así como crear y exportar capas "mcp" desde sus aplicaciones/dominios.
Configuración
Añade esta aplicación/dominio a tu archivo de configuración. Debes hacerlo antes de las aplicaciones que añadirán herramientas al servidor MCP.
Luego configura la aplicación/dominio mcp con lo siguiente:
const mcpConfig = {
// (optional) The name of your MCP server.
name: 'mcp',
// (optional) The version of your MCP server.
version: '1.0.0',
// The server config from @l4t/mcp-ai/simple-server/types.js
server: {
connection: {
type: 'http',
host: 'localhost',
port: 3000,
},
},
logging: {
// optional
// If you want to change the default. Its 'info' by default.
requestLogLevel: 'info',
// If you want to change the default. Its 'info' by default.
responseLogLevel: 'info',
},
}
const config = {
['@node-in-layers/mcp-server']: mcpConfig,
}Creación de una capa MCP
Puede crear una capa MCP exportando una función desde su aplicación/dominio que devuelva una capa.
// /src/yourDomain/mcp.ts
import { McpContext, McpNamespace } from '@node-in-layers/mcp-server'
import { Config } from '@node-in-layers/core'
import { YourFeaturesLayer } from './features.js'
const create = (context: McpContext<Config, YourFeaturesLayer>) => {
// Adds your tool.
context.mcp[McpNamespace].addTool({
name: 'my-hello-world-tool',
description: 'My Tool',
execute: async (input: any) => {
return 'Hello, world!'
},
})
// Create a tool from your feature
context.mcp[McpNamespace].addTool({
name: 'my-hello-world-tool',
description: 'My Tool',
inputSchema: {
type: 'object',
properties: {
name: {
type: 'string',
},
},
required: ['name'],
},
execute: (input: any) => {
// You get an object, pass it back to your feature. Handles async for you.
return context.features.yourDomain.yourFeature(input)
},
})
return {}
}
export { create }Añadiendo modelos
Puedes encapsular tus modelos con funciones CRUDS y añadirlos al servidor MCP con la capa mcp. NOTA: Para que esto funcione, tu capa debe tener una capa de servicios y una de entidades (además de tus modelos). El nodo en capas creará automáticamente una propiedad CRUDS con tus modelos, y podrás añadirlos.
He aquí un ejemplo de cómo hacerlo uno a la vez. (No se recomienda generalmente, pero es posible hacerlo).
// /src/yourDomain/mcp.ts
import { McpContext, McpNamespace } from '@node-in-layers/mcp-server'
import { Config } from '@node-in-layers/core'
import { YourFeaturesLayer } from './features.js'
const create = (context: McpContext<Config, YourFeaturesLayer>) => {
// Adds your models cruds through features.
context.mcp[McpNamespace].addModelCruds(
context.features.yourFeature.cruds.Cars
)
return {}
}Aquí tienes una forma de cocinar realmente con gas. (Muy recomendable)
// /src/yourDomain/mcp.ts
import { McpContext, McpNamespace, mcpModels } from '@node-in-layers/mcp-server'
import { Config } from '@node-in-layers/core'
import { YourFeaturesLayer } from './features.js'
const create = (context: McpContext<Config, YourFeaturesLayer>) => {
// This automatically adds ALL of your models from features.
mcpModels('yourDomain')(context)
return {}
}Otra forma de organizar la adición de modelos es desde un dominio mcp centralizado. Incluya este como su último dominio después de cargar todos los demás.
// /src/mcp/mcp.ts
import { McpContext, McpNamespace, mcpModels } from '@node-in-layers/mcp-server'
import { Config } from '@node-in-layers/core'
const create = (context: McpContext<Config>) => {
// Add all your models for your whole system in one go.
mcpModels('yourDomain')(context)
mcpModels('yourDomain2')(context)
mcpModels('yourDomain3')(context)
mcpModels('yourDomain4')(context)
return {}
}Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
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.
Related MCP Connectors
Hosted MCP server for AI-driven data ops. Create apps, manage schemas, and CRUD structured data.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A Model Context Protocol (MCP) server for Selise Blocks Cloud integration
Related MCP Servers
- AlicenseBqualityFmaintenanceA 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.79MIT
- AlicenseNot gradedqualityDmaintenanceA Node.js module that provides an MCP Server connecting to MCP Bone online service, allowing users to register other MCP Servers, obtain function calling tools in JSON or XML format, and parse completion text into tool calls.21MIT
- AlicenseNot gradedqualityFmaintenanceA configurable server implementation that provides MCP (Model-Controller-Protocol) functionality, supporting both Node.js and Docker environments with automated setup and configuration options.225MIT
- AlicenseAqualityDmaintenanceA lightweight framework for building and running Model Context Protocol (MCP) servers using FastMCP, providing tools for development, debugging, and server management.4MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/Node-In-Layers/mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server