一款专业级服务器,提供两大主要功能:

git clone https://github.com/falahgs/mcp-3d-style-cartoon-gen-server.git
cd mcp-3d-style-cartoon-gen-server
npm install
.env文件:GEMINI_API_KEY=your_api_key_here
ALLOWED_DIRECTORIES=/path/to/allowed/dir1,/path/to/allowed/dir2
npm run build
要将此组合服务器与Claude桌面集成:
找到配置文件:
添加以下配置:
{
"mcpServers": {
"mcp-3d-cartoon-generator": {
"command": "node",
"args": [
"path/to/your/build/index.js"
],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here",
"IS_REMOTE": "true",
"SAVE_TO_DESKTOP": "true",
"DETECT_OS_PATHS": "true",
"ALLOWED_DIRECTORIES": "C:\\Users\\YourUsername\\Desktop,C:\\Users\\YourUsername\\Documents",
"DEBUG": "false"
}
}
}
}
对于Windows用户,可以使用包含的fix_claude_config.ps1脚本来自动配置Claude桌面:
powershell -ExecutionPolicy Bypass -File .\fix_claude_config.ps1
这将创建或更新配置文件,带有正确的编码和设置。
{
"name": "generate_3d_cartoon",
"description": "根据给定提示生成适合儿童的3D风格卡通图像",
"inputSchema": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "描述要生成的3D卡通图像的提示"
},
"fileName": {
"type": "string",
"description": "输出文件名(不带扩展名)"
}
},
"required": ["prompt", "fileName"]
}
}
{
"name": "read_file",
"description": "读取文件的内容",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "要读取的文件路径"
}
},
"required": ["path"]
}
}
{
"name": "write_file",
"description": "将内容写入文件",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "要写入的文件路径"
},
"content": {
"type": "string",
"description": "要写入文件的内容"
}
},
"required": ["path", "content"]
}
}
{
"name": "list_directory",
"description": "列出目录的内容",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "要列出的目录路径"
}
},
"required": ["path"]
}
}
{
"name": "create_directory",
"description": "创建新目录",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "要创建的目录路径"
}
},
"required": ["path"]
}
}
{
"name": "search_files",
"description": "搜索匹配模式的文件",
"inputSchema": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "从该基础目录开始搜索"
},
"pattern": {
"type": "string",
"description": "搜索模式(glob格式)"
},
"excludePatterns": {
"type": "array",
"items": {
"type": "string"
},
"description": "从搜索中排除的模式(glob格式)"
}
},
"required": ["path", "pattern"]
}
}
// 生成3D卡通
{
"name": "generate_3d_cartoon",
"arguments": {
"prompt": "一只友好的机器人正在和猫玩耍",
"fileName": "robot_cat_play"
}
}
// 读取文件
{
"name": "read_file",
"arguments": {
"path": "C:/Users/YourUsername/Documents/example.txt"
}
}
// 写入文件
{
"name": "write_file",
"arguments": {
"path": "C:/Users/YourUsername/Documents/new-file.txt",
"content": "这是文件的内容。"
}
}
// 列出目录内容
{
"name": "list_directory",
"arguments": {
"path": "C:/Users/YourUsername/Documents"
}
}
// 创建目录
{
"name": "create_directory",
"arguments": {
"path": "C:/Users/YourUsername/Documents/new-folder"
}
}
// 搜索文件
{
"name": "search_files",
"arguments": {
"path": "C:/Users/YourUsername/Documents",
"pattern": "*.txt",
"excludePatterns": ["temp*", "*.tmp"]
}
}
服务器实现了多项安全措施:
ALLOWED_DIRECTORIES环境变量中明确设置的目录才能被访问。| 变量 | 描述 | 默认值 |
|---|---|---|
GEMINI_API_KEY | 用于图像生成的Google Gemini API密钥 | (必需) |
ALLOWED_DIRECTORIES | 允许的文件系统路径的逗号分隔列表 | 用户主目录,当前目录 |
IS_REMOTE | 不打开浏览器的远程模式运行 | false |
SAVE_TO_DESKTOP | 强制保存到桌面目录 | false |
DETECT_OS_PATHS | 启用特定于操作系统的路径检测 | true |
DEBUG | 启用详细的调试日志 | false |
Claude中的JSON解析错误:
DEBUG设置为"false",以防止日志干扰JSON通信文件访问被拒绝:
ALLOWED_DIRECTORIES中图像未保存:
SAVE_TO_DESKTOP设置为"true",确保图像保存到桌面欢迎贡献!请随时提交Pull Request。