mcp-opencode-blender

mcp-opencode-blender

Enables programmatic control of Blender via OpenCode, supporting 3D model creation, material application, and export through a Model Context Protocol server.

Category
Visit Server

README

🚀 MCP OpenCode Blender

MCP OpenCode Blender هو خادم Model Context Protocol يوفر تكاملًا قويًا بين OpenCode و Blender لإدارة وتشغيل نماذج ثلاثية الأبعاد برمجيًا.

✨ المميزات

✅ التحكم الكامل في Blender عبر API
✅ إنشاء وتعديل الأشكال ثلاثية الأبعاد
✅ تطبيق المواد والألوان
✅ تصدير النماذج بصيغ متعددة (GLB, FBX, OBJ)
✅ دعم سكريبتات Python
✅ معالجة الأخطاء المتقدمة
✅ تسجيل شامل للعمليات

📋 المتطلبات

  • Python 3.8 أو أحدث
  • Blender 3.0 أو أحدث
  • pip (مدير الحزم)

🛠️ التثبيت

1. استنساخ المستودع

git clone https://github.com/khalidSAT/mcp-opencode-blender.git
cd mcp-opencode-blender

2. إنشاء بيئة افتراضية

# على Linux/Mac
python3 -m venv venv
source venv/bin/activate

# على Windows
python -m venv venv
venv\Scripts\activate

3. تثبيت المتطلبات

pip install -r requirements.txt

🚀 البدء السريع

تشغيل الخادم

python server.py

الناتج المتوقع:

🚀 MCP OpenCode Blender Server Started
📍 Server running on: localhost:5000
✅ Ready to accept connections

تشغيل الأمثلة

في نافذة أخرى:

python examples/basic_usage.py

📚 الأوامر المتاحة

1. ping

اختبار الاتصال بالخادم

response = client.send_command('ping')

2. create_primitive

إنشاء شكل أولي

response = client.send_command('create_primitive', {
    'type': 'cube',  # cube, sphere, cylinder, plane
    'name': 'my_object',
    'scale': 1.0
})

3. set_object_property

تعديل خصائص الكائن

response = client.send_command('set_object_property', {
    'object_name': 'my_object',
    'location': [0, 0, 0],
    'rotation': [0, 0, 0],
    'scale': [1, 1, 1]
})

4. apply_material

تطبيق مادة وألوان

response = client.send_command('apply_material', {
    'object_name': 'my_object',
    'color': [1, 0, 0],  # RGB (أحمر)
    'metallic': 0.5,
    'roughness': 0.3
})

5. export_scene

تصدير المشهد

response = client.send_command('export_scene', {
    'format': 'glb',  # glb, fbx, obj, usdz
    'filepath': './output/scene.glb'
})

6. get_scene_info

الحصول على معلومات المشهد

response = client.send_command('get_scene_info')

7. help

عرض جميع الأوامر المتاحة

response = client.send_command('help')

📁 البنية الدليلية

mcp-opencode-blender/
├── server.py                 # خادم MCP الرئيسي
├── client.py                 # عميل للاتصال بالخادم
├── requirements.txt          # المكتبات المطلوبة
├── config.json              # إعدادات المشروع
├── .gitignore               # ملف استثناء Git
├── README.md                # هذا الملف
├── LICENSE                  # رخصة MIT
├── examples/
│   ├── basic_usage.py      # أمثلة أساسية
│   ├── advanced_usage.py   # أمثلة متقدمة
│   └── blender_integration.py  # التكامل مع Blender
├── tests/
│   ├── test_server.py      # اختبارات الخادم
│   ├── test_commands.py    # اختبارات الأوامر
│   └── test_client.py      # اختبارات العميل
├── docs/
│   ├── API_REFERENCE.md    # مرجع API
│   ├── TROUBLESHOOTING.md  # استكشاف الأخطاء
│   └── EXAMPLES.md         # أمثلة متقدمة
└── src/
    ├── blender_handler.py  # معالج Blender
    ├── command_parser.py   # محلل الأوامر
    └── utils.py            # دوال مساعدة

💡 أمثلة عملية

مثال 1: إنشاء مشهد بسيط

from client import MCPClient

client = MCPClient('localhost', 5000)

# إنشاء مكعب
client.send_command('create_primitive', {'type': 'cube', 'name': 'cube1'})

# تعديل الموقع
client.send_command('set_object_property', {
    'object_name': 'cube1',
    'location': [2, 0, 0]
})

# تطبيق لون أحمر
client.send_command('apply_material', {
    'object_name': 'cube1',
    'color': [1, 0, 0]
})

مثال 2: إنشاء نموذج معقد

# إنشاء عدة كائنات
for i in range(5):
    client.send_command('create_primitive', {
        'type': 'sphere',
        'name': f'sphere_{i}',
        'scale': 0.5 + i * 0.1
    })
    
    client.send_command('set_object_property', {
        'object_name': f'sphere_{i}',
        'location': [i * 3, 0, 0]
    })

# تصدير النموذج
client.send_command('export_scene', {
    'format': 'glb',
    'filepath': './models/scene.glb'
})

🐛 استكشاف الأخطاء

المشكلة: "Connection refused"

الحل: تأكد من تشغيل الخادم:

python server.py

المشكلة: "Module not found"

الحل: تثبيت المكتبات:

pip install -r requirements.txt

المشكلة: Blender لم يتم اكتشافه

الحل: تعديل config.json وتحديد مسار Blender:

{
  "blender_path": "/path/to/blender"
}

📖 التوثيق الإضافية

🤝 المساهمة

نرحب بمساهماتك! يرجى:

  1. Fork المستودع
  2. إنشاء فرع جديد (git checkout -b feature/amazing-feature)
  3. Commit التغييرات (git commit -m 'إضافة ميزة رائعة')
  4. Push إلى الفرع (git push origin feature/amazing-feature)
  5. فتح Pull Request

📄 الرخصة

هذا المشروع مرخص تحت MIT License - انظر الملف للتفاصيل.

📧 التواصل


صُنع بـ ❤️ بواسطة khalidSAT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured