MCP约曼服务器

](https://smithery.ai/server/@thirdstrandstudio/mcp-yeoman)
一个模型上下文协议(MCP)服务器,提供与Yeoman生成器的集成,允许AI代理以编程方式搜索和运行Yeoman模板。
工具
此服务器实现了以下MCP工具:
模板搜索方法
yeoman_search_templates-在npm上搜索Yeoman模板
- 参数: - query (string):用逗号分隔的搜索关键字 - pageSize (number,可选):要返回的结果数(默认值:20)
发电机方法
yeoman_get_generator_options-获取Yeoman发电机所需的选项和参数
- 参数: - generatorName (string):生成器的名称(不带“generator-”前缀)
yeoman_generate-运行约曼发电机
- 参数: - generatorName (string):生成器的名称(不带“generator-”前缀) - cwd (string):生成器应运行的工作目录 - appName (string):要创建的应用程序的名称 - version (string):要创建的应用程序的版本 - options (object,可选):传递给生成器的选项 - args (array,可选):传递给生成器的其他位置参数
安装
通过Smithery安装
通过以下方式自动安装mcp-yeoman for Claude Desktop 史密瑟里:
npx @smithery/cli@latest install mcp-yeoman --client claude先决条件
- Node.js(v16或更高版本)
- npm或纱线
安装软件包
# Clone the repository
git clone https://github.com/thirdstrandstudio/mcp-yeoman.git
cd mcp-yeoman
# Install dependencies
npm install
# Build the package
npm run build使用Claude Desktop
将以下内容添加到您的 claude_desktop_config.json:
使用npx
{
"mcpServers": {
"yeoman": {
"command": "npx",
"args": ["@thirdstrandstudio/mcp-yeoman"]
}
}
}直接Node.js
{
"mcpServers": {
"yeoman": {
"command": "node",
"args": ["/path/to/mcp-yeoman/dist/index.js"]
}
}
}替换 /path/to/mcp-yeoman 使用存储库的实际路径。
命令行参数
服务器支持以下命令行参数:
- `--generator-dir
`:指定用于安装Yeoman发电机的持久目录。默认情况下,生成器安装在操作完成时删除的临时目录中。使用持久目录可以提高使用相同生成器进行重复操作的性能。
例子:
{
"mcpServers": {
"yeoman": {
"command": "node",
"args": ["/path/to/mcp-yeoman/dist/index.js", "--generator-dir", "/path/to/generator-storage"]
}
}
}例子
搜索模板
// Search for React-related templates
const templates = await callTool("yeoman_search_templates", {
query: "react,typescript",
pageSize: 10
});获取生成器选项
// Get options for the React generator
const options = await callTool("yeoman_get_generator_options", {
generatorName: "react"
});运行发电机
// Run the React generator
const result = await callTool("yeoman_generate", {
generatorName: "react",
cwd: "/path/to/project",
appName: "my-react-app",
version: "1.0.0",
options: {
typescript: true,
sass: true
}
});发展
# Install dependencies
npm install
# Start the server in development mode
npm start
# Build the server
npm run build错误处理
服务器包括全面的错误处理:
- 无效参数的验证错误
- 交互式提示检测和所需选项的指导
- 用于调试的详细错误记录
- 自动清理临时目录(除非使用--generator dir)
- 通过MCP协议进行安全错误传播
许可证
此MCP服务器根据MIT许可证获得许可。这意味着您可以根据MIT许可证的条款和条件自由使用、修改和分发软件。有关更多详细信息,请参阅项目存储库中的LICENSE文件。
贡献
欢迎投稿!请随时提交拉取请求。投稿时,请:
- 分叉存储库
- 创建要素分支
- 提交一个拉取请求,明确描述更改
- 确保所有测试通过,并保持代码风格
