Skip to main content
Glama

Fusion360MCP

by jaskirat1616
chat_ui.htmlβ€’33.1 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"> <title>Fusion 360 MCP Chat</title> <style> * { margin: 0; padding: 0; box-sizing: border-box; } :root { --primary-color: #2563eb; --primary-hover: #1d4ed8; --bg-primary: #ffffff; --bg-secondary: #f8fafc; --bg-chat: #f1f5f9; --border-color: #e2e8f0; --text-primary: #1e293b; --text-secondary: #64748b; --success-color: #10b981; --error-color: #ef4444; --warning-color: #f59e0b; --user-msg-bg: #2563eb; --assistant-msg-bg: #ffffff; --code-bg: #1e293b; --sidebar-width: 280px; --min-window-width: 320px; } /* Fluid typography using clamp() for smooth scaling */ html { font-size: clamp(14px, 0.875rem + 0.15vw, 16px); } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background: var(--bg-secondary); color: var(--text-primary); height: 100vh; height: 100dvh; /* Dynamic viewport height for mobile */ overflow: hidden; position: fixed; width: 100%; min-width: var(--min-window-width); } .container { display: flex; height: 100vh; height: 100dvh; max-width: 1600px; margin: 0 auto; position: relative; overflow: hidden; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } /* Hamburger Menu Button */ .hamburger-btn { display: none; position: fixed; top: 16px; left: 16px; z-index: 1001; width: 44px; height: 44px; background: var(--primary-color); border: none; border-radius: 8px; color: white; cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); } .hamburger-btn span { display: block; width: 20px; height: 2px; background: white; transition: all 0.3s ease; } .hamburger-btn.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); } .hamburger-btn.active span:nth-child(2) { opacity: 0; } .hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); } /* Sidebar */ .sidebar { width: var(--sidebar-width); min-width: 240px; max-width: 320px; background: var(--bg-primary); border-right: 1px solid var(--border-color); display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden; } /* Sidebar overlay for mobile */ .sidebar-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0, 0, 0, 0.5); z-index: 999; opacity: 0; transition: opacity 0.3s ease; } .sidebar-overlay.show { display: block; opacity: 1; } /* Mobile sidebar - hidden by default */ @media (max-width: 768px) { .hamburger-btn { display: flex; } .sidebar { position: fixed; left: 0; top: 0; height: 100vh; z-index: 1000; transform: translateX(-100%); box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1); } .sidebar.open { transform: translateX(0); } } /* Tablet sidebar - smaller width */ @media (min-width: 769px) and (max-width: 1024px) { .sidebar { width: 240px; } } .sidebar-header { padding: clamp(16px, 4vw, 20px); border-bottom: 1px solid var(--border-color); flex-shrink: 0; } .sidebar-header h1 { font-size: clamp(18px, 1.25rem, 20px); font-weight: 600; margin-bottom: 8px; word-wrap: break-word; overflow-wrap: break-word; } .status-indicator { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); } .status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-color); animation: pulse 2s infinite; } @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } } .status-dot.error { background: var(--error-color); } .conversations { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px; min-height: 0; /* Important for flex scrolling */ overscroll-behavior: contain; } .conversation-item { padding: 12px; border-radius: 8px; margin-bottom: 4px; cursor: pointer; transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1); word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; } .conversation-item:hover { background: var(--bg-secondary); } .conversation-item.active { background: var(--bg-chat); } .new-chat-btn { margin: 12px; padding: 12px; background: var(--primary-color); color: white; border: none; border-radius: 8px; font-weight: 500; cursor: pointer; transition: background 0.2s; min-height: 44px; } .new-chat-btn:hover { background: var(--primary-hover); } /* Main Chat Area */ .chat-area { flex: 1; display: flex; flex-direction: column; background: var(--bg-chat); } .chat-header { padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 24px); background: var(--bg-primary); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; flex-wrap: wrap; gap: 12px; min-height: 60px; } .chat-header h2 { font-size: clamp(16px, 1.25rem, 20px); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; } /* Mobile chat header - add space for hamburger */ @media (max-width: 768px) { .chat-header { padding-left: 68px; } } .model-selector { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: clamp(12px, 0.875rem, 14px); } .model-selector span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; } .model-selector strong { word-wrap: break-word; overflow-wrap: break-word; } .model-selector select { padding: 8px 12px; border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-primary); font-size: clamp(13px, 0.875rem, 14px); cursor: pointer; max-width: 100%; } .messages-container { flex: 1; overflow-y: auto; overflow-x: hidden; padding: clamp(12px, 4vw, 24px); display: flex; flex-direction: column; gap: clamp(12px, 2vw, 16px); -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */ min-height: 0; /* Important for flex scrolling */ overscroll-behavior: contain; } .message { display: flex; gap: clamp(8px, 1.5vw, 12px); max-width: min(80%, 900px); animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); word-wrap: break-word; overflow-wrap: break-word; } /* Mobile messages - wider on small screens */ @media (max-width: 768px) { .message { max-width: 95%; } } /* Very small screens */ @media (max-width: 480px) { .message { max-width: 100%; } } @keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .message.user { align-self: flex-end; flex-direction: row-reverse; } .message-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; flex-shrink: 0; } .message.user .message-avatar { background: var(--primary-color); color: white; } .message.assistant .message-avatar { background: var(--text-secondary); color: white; } .message-content { background: var(--assistant-msg-bg); padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 16px); border-radius: 12px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); min-width: 0; /* Prevents flex overflow */ max-width: 100%; overflow: hidden; } .message.user .message-content { background: var(--user-msg-bg); color: white; } .message-text { line-height: 1.6; font-size: clamp(14px, 0.9375rem, 15px); word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; } .message-text p { margin-bottom: 0.5em; } .message-text p:last-child { margin-bottom: 0; } .message-text code { word-wrap: break-word; overflow-wrap: break-word; } .code-block { margin-top: 12px; background: var(--code-bg); color: #e2e8f0; padding: clamp(12px, 2vw, 16px); border-radius: 8px; overflow-x: auto; overflow-y: hidden; position: relative; max-width: 100%; -webkit-overflow-scrolling: touch; } .code-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); flex-wrap: wrap; gap: 8px; } .code-lang { font-size: clamp(11px, 0.75rem, 12px); color: #94a3b8; text-transform: uppercase; white-space: nowrap; } .code-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; } .code-btn { padding: 8px 14px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 6px; color: white; font-size: 13px; cursor: pointer; transition: all 0.2s; min-height: 36px; display: flex; align-items: center; gap: 4px; } .code-btn:hover { background: rgba(255, 255, 255, 0.2); } .code-btn.execute { background: var(--success-color); border-color: var(--success-color); } .code-btn.execute:hover { background: #059669; } .code-btn.toggle { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.3); } .code-btn.toggle:hover { background: rgba(255, 255, 255, 0.25); } /* Mobile code buttons - larger touch targets */ @media (max-width: 768px) { .code-btn { padding: 10px 16px; font-size: 14px; min-height: 44px; } .code-actions { width: 100%; } .code-btn { flex: 1; justify-content: center; } } .code-content { max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; } .code-content.expanded { max-height: 1000px; transition: max-height 0.5s ease-in; } pre { margin: 0; font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace; font-size: clamp(11px, 0.8125rem, 13px); line-height: 1.5; overflow-x: auto; overflow-y: hidden; white-space: pre; word-wrap: normal; max-width: 100%; -webkit-overflow-scrolling: touch; } pre code { display: inline-block; min-width: 100%; width: max-content; } .execution-result { margin-top: 12px; padding: 12px; border-radius: 6px; font-size: 14px; } .execution-result.success { background: rgba(16, 185, 129, 0.1); color: var(--success-color); border: 1px solid var(--success-color); } .execution-result.error { background: rgba(239, 68, 68, 0.1); color: var(--error-color); border: 1px solid var(--error-color); } .typing-indicator { display: flex; gap: 4px; padding: 12px 16px; } .typing-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-secondary); animation: typing 1.4s infinite; } .typing-dot:nth-child(2) { animation-delay: 0.2s; } .typing-dot:nth-child(3) { animation-delay: 0.4s; } @keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } } /* Input Area */ .input-area { padding: clamp(12px, 3vw, 20px) clamp(16px, 4vw, 24px); background: var(--bg-primary); border-top: 1px solid var(--border-color); flex-shrink: 0; position: relative; } /* Prevent input area from being cut off */ @supports (padding: max(0px)) { .input-area { padding-bottom: max(clamp(12px, 3vw, 20px), env(safe-area-inset-bottom)); } } .input-wrapper { display: flex; gap: clamp(8px, 1.5vw, 12px); align-items: flex-end; max-width: 100%; } .input-container { flex: 1; position: relative; min-width: 0; /* Prevents flex overflow */ } #messageInput { width: 100%; min-height: clamp(48px, 10vw, 52px); max-height: min(200px, 40vh); padding: clamp(12px, 2vw, 14px) clamp(14px, 2.5vw, 16px); border: 2px solid var(--border-color); border-radius: 12px; font-size: max(16px, clamp(14px, 0.9375rem, 15px)); /* min 16px to prevent iOS zoom */ font-family: inherit; resize: none; transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1); box-sizing: border-box; } #messageInput:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); } .send-btn { width: clamp(48px, 10vw, 52px); height: clamp(48px, 10vw, 52px); background: var(--primary-color); border: none; border-radius: 12px; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); flex-shrink: 0; touch-action: manipulation; } .send-btn:hover:not(:disabled) { background: var(--primary-hover); transform: scale(1.05); } .send-btn:active:not(:disabled) { transform: scale(0.95); } .send-btn:disabled { opacity: 0.5; cursor: not-allowed; } .settings-panel { padding: clamp(10px, 2vw, 12px); border-top: 1px solid var(--border-color); background: var(--bg-secondary); flex-shrink: 0; max-height: 40vh; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; } .setting-group { margin-bottom: 12px; } .setting-group:last-child { margin-bottom: 0; } .setting-label { display: block; font-size: clamp(12px, 0.8125rem, 13px); font-weight: 500; margin-bottom: 6px; color: var(--text-secondary); word-wrap: break-word; } .setting-input { width: 100%; padding: clamp(8px, 1.5vw, 10px) clamp(10px, 2vw, 12px); border: 1px solid var(--border-color); border-radius: 6px; font-size: max(16px, clamp(13px, 0.875rem, 14px)); /* min 16px to prevent iOS zoom */ box-sizing: border-box; background: var(--bg-primary); transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1); } .setting-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); } .setting-input select, select.setting-input { cursor: pointer; } /* Welcome Screen */ .welcome-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: clamp(20px, 5vw, 40px); overflow-y: auto; overflow-x: hidden; } .welcome-screen h2 { font-size: clamp(24px, 5vw, 32px); margin-bottom: clamp(12px, 2vw, 16px); word-wrap: break-word; } .welcome-screen p { font-size: clamp(14px, 1rem, 16px); color: var(--text-secondary); margin-bottom: clamp(24px, 4vw, 32px); max-width: 90%; word-wrap: break-word; } .example-prompts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: clamp(10px, 2vw, 12px); width: 100%; max-width: min(800px, 95vw); } /* Responsive grid for example prompts */ @media (max-width: 768px) { .example-prompts { grid-template-columns: 1fr; } } @media (min-width: 769px) and (max-width: 1024px) { .example-prompts { grid-template-columns: repeat(2, 1fr); } } .example-prompt { padding: clamp(12px, 2.5vw, 16px); background: var(--bg-primary); border: 1px solid var(--border-color); border-radius: 12px; cursor: pointer; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); text-align: left; min-height: 44px; display: flex; flex-direction: column; justify-content: center; touch-action: manipulation; } .example-prompt:hover { border-color: var(--primary-color); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .example-prompt:active { transform: translateY(0); } .example-prompt-title { font-weight: 600; margin-bottom: 4px; font-size: clamp(14px, 0.9375rem, 15px); word-wrap: break-word; } .example-prompt-text { font-size: clamp(13px, 0.875rem, 14px); color: var(--text-secondary); word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; } /* Scrollbar - macOS/Windows native style */ ::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.2); border-radius: 6px; border: 3px solid transparent; background-clip: content-box; } ::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.35); background-clip: content-box; } ::-webkit-scrollbar-thumb:active { background: rgba(0, 0, 0, 0.5); background-clip: content-box; } /* Firefox scrollbar styling */ * { scrollbar-width: thin; scrollbar-color: rgba(0, 0, 0, 0.2) transparent; } /* Additional responsive fixes and z-index management */ /* Ensure proper stacking context */ .sidebar-overlay { z-index: 999; } .sidebar { z-index: 1000; } .hamburger-btn { z-index: 1001; } /* Prevent text selection on UI elements */ .hamburger-btn, .new-chat-btn, .send-btn, .code-btn, .example-prompt { -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } /* Smooth window resize transitions */ @media (prefers-reduced-motion: no-preference) { .container, .sidebar, .chat-area, .messages-container, .input-area { transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); } } /* Respect user's motion preferences */ @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; } } /* Very small screens - additional constraints */ @media (max-width: 480px) { :root { --sidebar-width: 260px; } .model-selector { width: 100%; } .code-actions { flex-direction: column; } .code-btn { width: 100%; } } /* Landscape mobile orientation */ @media (max-height: 500px) and (orientation: landscape) { .welcome-screen { padding: 16px; } .welcome-screen h2 { font-size: 20px; margin-bottom: 8px; } .welcome-screen p { font-size: 13px; margin-bottom: 16px; } .example-prompts { grid-template-columns: repeat(2, 1fr); gap: 8px; } .sidebar-header { padding: 12px; } .input-area { padding: 8px 12px; } } /* Large screens - better max widths */ @media (min-width: 1400px) { .message { max-width: min(70%, 1000px); } } /* Ultra-wide screens */ @media (min-width: 1920px) { .container { max-width: 1800px; } :root { --sidebar-width: 320px; } } /* Tablet specific adjustments */ @media (min-width: 769px) and (max-width: 1024px) { .message { max-width: 85%; } .chat-header { flex-wrap: nowrap; } } /* Print styles */ @media print { .sidebar, .hamburger-btn, .sidebar-overlay, .input-area, .chat-header { display: none !important; } .chat-area { margin: 0; padding: 0; } .messages-container { overflow: visible !important; max-height: none !important; } .message { page-break-inside: avoid; } } /* Focus visible for accessibility */ *:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; } /* Better button active states for native feel */ button:active, .example-prompt:active { transform: scale(0.98); } /* Ensure no horizontal overflow anywhere */ html, body, .container, .sidebar, .chat-area, .messages-container, .message-content, .code-block { overflow-wrap: break-word; } /* Safe area insets for notched devices */ @supports (padding: max(0px)) { body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); } .sidebar { padding-left: env(safe-area-inset-left); } } </style> </head> <body> <!-- Hamburger Menu Button --> <button class="hamburger-btn" id="hamburgerBtn" onclick="toggleSidebar()"> <span></span> <span></span> <span></span> </button> <!-- Sidebar Overlay --> <div class="sidebar-overlay" id="sidebarOverlay" onclick="closeSidebar()"></div> <div class="container"> <!-- Sidebar --> <div class="sidebar" id="sidebar"> <div class="sidebar-header"> <h1>Fusion 360 MCP</h1> <div class="status-indicator"> <div class="status-dot" id="statusDot"></div> <span id="statusText">Connected</span> </div> </div> <button class="new-chat-btn" onclick="newChat()">+ New Chat</button> <div class="conversations" id="conversations"> <!-- Conversation history will be populated here --> </div> <div class="settings-panel"> <div class="setting-group"> <label class="setting-label">AI Backend</label> <select id="backendSelect" class="setting-input" onchange="updateBackend()"> <option value="ollama">Ollama (Local)</option> <option value="gemini">Google Gemini</option> <option value="openai">OpenAI</option> </select> </div> <div class="setting-group" id="apiKeyGroup" style="display: none;"> <label class="setting-label">API Key</label> <input type="password" id="apiKeyInput" class="setting-input" placeholder="Enter API key"> </div> <div class="setting-group"> <label class="setting-label">Model</label> <select id="modelSelect" class="setting-input"> <option value="">Loading...</option> </select> </div> </div> </div> <!-- Main Chat Area --> <div class="chat-area"> <div class="chat-header"> <h2>AI Design Assistant</h2> <div class="model-selector"> <span style="color: var(--text-secondary); font-size: 14px;">Model: <strong id="currentModel">-</strong></span> </div> </div> <div class="messages-container" id="messagesContainer"> <!-- Welcome Screen --> <div class="welcome-screen" id="welcomeScreen"> <h2>Welcome to Fusion 360 MCP</h2> <p>AI-powered design automation for Fusion 360. Try one of these examples to get started:</p> <div class="example-prompts"> <div class="example-prompt" onclick="sendExample('Create a 10mm cube at the origin')"> <div class="example-prompt-title">Basic Shape</div> <div class="example-prompt-text">Create a 10mm cube at the origin</div> </div> <div class="example-prompt" onclick="sendExample('Create a cylinder with 20mm diameter and 50mm height')"> <div class="example-prompt-title">Cylinder</div> <div class="example-prompt-text">Create a cylinder with 20mm diameter and 50mm height</div> </div> <div class="example-prompt" onclick="sendExample('Create a rectangular pattern of 5x3 holes, each 3mm diameter, spaced 10mm apart')"> <div class="example-prompt-title">Pattern</div> <div class="example-prompt-text">Create a rectangular pattern of holes</div> </div> <div class="example-prompt" onclick="sendExample('Create a fillet of 2mm radius on all edges of the selected body')"> <div class="example-prompt-title">Fillet</div> <div class="example-prompt-text">Create a fillet on all edges</div> </div> </div> </div> </div> <div class="input-area"> <div class="input-wrapper"> <div class="input-container"> <textarea id="messageInput" placeholder="Describe what you want to create in Fusion 360..." onkeypress="handleKeyPress(event)" ></textarea> </div> <button class="send-btn" id="sendBtn" onclick="sendMessage()"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"> <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/> </svg> </button> </div> </div> </div> </div> <script src="chat_ui.js"></script> </body> </html>

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jaskirat1616/Fusion360MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server