MCP build: init → build → run. Turn your project (@tool, SKILL, n8n) into a standalone MCP npm server (no framework embedding, no package conflict).
npm install @easynet/agent-tool工具运行时包。最小目标:从 tool.yaml 生成可给 LangChain 使用的 tools。
``ts
import { createAgentTools } from "@easynet/agent-tool/api";
const tools = createAgentTools({ configFilePath: "./tool.yaml", coreTools: {} });
console.log(tools.map((t) => t.name));
`
`yaml
tools:
# FS 工具沙箱根目录(相对路径按当前项目解析)
sandboxedPath: .
# HTTP 允许列表。先给空数组,表示默认禁用外网请求(更安全)
allowedHosts: []
blockedHosts: []
# 最小起步:直接加载内置工具包(全部工具)
list:
- npm:@easynet/agent-tool-buildin
`
`ts
import { createAgentTools } from "@easynet/agent-tool/api";
async function main() {
// 1) 从 tool.yaml 创建 LangChain tools
const tools = createAgentTools({
configFilePath: "./tool.yaml",
coreTools: {},
});
// 2) 打印工具名,确认加载成功
console.log("loaded tools:", tools.map((t) => t.name));
}
main().catch(console.error);
`
- MCP 服务:createMCPServer(...)createOpenAPIServer(...)
- OpenAPI HTTP:createExtension(...)
- 扩展开发:、generateManifest(...)`