MCP Server
MCP 서버 - MCP 서버 구축을 위한 계층형 노드 패키지
이 라이브러리는 Node In Layers를 사용하여 MCP 서버를 쉽게 생성할 수 있는 기능을 추가합니다.
MCP 클라이언트를 생성하는 데 사용되는 '@node-in-layers/mcp-client'라는 보조 라이브러리가 있습니다. 이 두 라이브러리는 모델과 도구를 정의하는 데 동일한 함수를 공유합니다.
새 레이어
이 라이브러리는 시스템에 새로운 레이어인 mcp 추가합니다. 이 레이어는 express 레이어 뒤에 배치해야 합니다.
Related MCP server: MCP Server
용법
이 라이브러리를 사용하려면 구성에 추가해야 하며 앱/도메인에서 "mcp" 레이어를 만들어 내보내야 합니다.
구성
이 앱/도메인을 설정 파일에 추가하세요. 앱을 추가하기 전에 이 작업을 수행해야 MCP 서버에 도구가 추가됩니다.
그런 다음 다음을 사용하여 mcp 앱/도메인을 구성합니다.
지엑스피1
MCP 레이어 생성
앱/도메인에서 레이어를 반환하는 함수를 내보내어 MCP 레이어를 만들 수 있습니다.
// /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 }모델 추가
모델을 CRUDS 함수로 래핑하고 mcp 레이어를 통해 MCP 서버에 추가할 수 있습니다. 참고: 이 기능을 사용하려면 레이어에 모델 외에도 서비스 레이어와 기능 레이어가 모두 있어야 합니다. 레이어의 노드는 모델과 함께 자동으로 CRUDS 속성을 생성하며, 이를 추가할 수 있습니다.
한 번에 하나씩 하는 예는 다음과 같습니다. (일반적으로 권장하지는 않지만, 실행 가능합니다).
// /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 {}
}가스로 제대로 요리하는 방법을 소개합니다. (강력 추천)
// /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 {}
}모델 추가를 구성하는 또 다른 방법은 중앙 집중식 MCP 도메인을 사용하는 것입니다. 다른 모든 도메인이 로드된 후 이 도메인을 마지막 도메인으로 지정하세요.
// /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.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Remote MCP server exposing your Node Command fleet (files, shell, processes, browser) to AI hosts.
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.
Create, inspect, validate, and save editable 3D building scenes with Pascal's MCP server.
Related MCP Servers
- AlicenseBqualityDmaintenanceA 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
- FlicenseNot gradedqualityFmaintenanceA configurable server implementation that provides MCP (Model-Controller-Protocol) functionality, supporting both Node.js and Docker environments with automated setup and configuration options.-
- AlicenseAqualityDmaintenanceA lightweight framework for building and running Model Context Protocol (MCP) servers using FastMCP, providing tools for development, debugging, and server management.4MIT
- FlicenseNot gradedqualityDmaintenanceA production-ready MCP server built with Node.js and Express that supports remote deployment via HTTP and SSE. It provides a modular framework for building and scaling tools while serving multiple clients concurrently.-