使用xmcp创建一个新项目的流程非常简单,主要包括以下步骤:
- Installing Node.js:确保系统已安装Node.js(建议版本18或更高)
- Initialization Project: Run in a terminal
npx create-xmcp@latest my-project
command - Installation of dependencies:进入项目目录后执行
npm install
- Starting the Development Server: Run
npm run dev
即可在本地启动服务
项目初始化完成后,会自动生成标准的项目结构,包括:
- src/ – 包含middleware.ts和tools/目录
- dist/ – 编译输出目录
- 配置文件 – 包括package.json、tsconfig.json和xmcp.config.ts
默认情况下,开发服务器会运行在http://localhost:3000,开发者可以立即开始构建自己的MCP应用。
This answer comes from the articlexmcp: A TypeScript Framework for Building and Publishing MCP ApplicationsThe