Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Opencode Blender

FreeNot checked

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

GitHubEmbed

About

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

README

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

from github.com/khalidSAT/mcp-opencode-blender

Installing Opencode Blender

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/khalidSAT/mcp-opencode-blender

FAQ

Is Opencode Blender MCP free?

Yes, Opencode Blender MCP is free — one-click install via Unyly at no cost.

Does Opencode Blender need an API key?

No, Opencode Blender runs without API keys or environment variables.

Is Opencode Blender hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Opencode Blender in Claude Desktop, Claude Code or Cursor?

Open Opencode Blender on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Opencode Blender with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs