[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80857":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":12,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":14,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":15,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":16,"fork":16,"defaultBranch":17,"hasWiki":18,"hasPages":16,"topics":19,"createdAt":10,"pushedAt":10,"updatedAt":20,"readmeContent":21,"aiSummary":22,"trendingCount":14,"starSnapshotCount":14,"syncStatus":23,"lastSyncTime":24,"discoverSource":25},80857,"pymol-claude-code","nagarh\u002Fpymol-claude-code","nagarh","Control PyMOL via Claude Code","",null,"Python",35,10,0,3.12,false,"main",true,[],"2026-06-12 02:04:07","# Control PyMOL via Claud Code CLI\n\nPyMOL MCP connects [Claude Code](https:\u002F\u002Fclaude.ai\u002Fcode) to [PyMOL](https:\u002F\u002Fpymol.org) via the Model Context Protocol, letting you control molecular visualizations. Describe what you want — fetch a structure, highlight active-site residues, color by secondary structure, measure distances — and Claude translates it into PyMOL commands in real time. It works locally on Mac or remotely on an HPC cluster through a simple SSH reverse tunnel, with no plugins or GUI interaction required.\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"pymol_claude_code.gif\" alt=\"PyMOL MCP Demo\"\u002F>\n\u003C\u002Fp>\n\n## How It Works\n\nClaude picks from three MCP tools (`run_command`, `run_python`, `pymol_get`) to talk to PyMOL over XML-RPC.\n\n![Information Flow](flow.svg)\n\n## Prerequisites\n\n- [PyMOL](https:\u002F\u002Fpymol.org) \n- [Claude Code](https:\u002F\u002Fclaude.ai\u002Fcode) (`npm install -g @anthropic-ai\u002Fclaude-code`)\n- Python 3.10+\n\n## Launch PyMOl via terminal in PC\n\n```\npymol -R\n```\n\n## Setup on Linux \u002F HPC (Remote via SSH Tunnel)\n\nSince PyMOL runs on your local Mac and Claude Code runs on the remote HPC, you need an SSH reverse tunnel to bridge them.\n\n**1. Clone the repo on HPC**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fnagarh\u002Fpymol-claude-code\ncd pymol-claude-code\n```\n\n**2. Install dependencies on HPC**\n```bash\npip install mcp\n```\n\n**3. Choose a free port on HPC**\n```bash\ntry \u003CPORT>  = 49123 to check it is free or not \n\nss -tlnp | grep \u003CPORT> || echo \"port is FREE\" \n```\n\n**4. Update the port in `pymol_mcp_server.py`**\n\nChange this line to match your chosen port:\n```python\npymol = xmlrpc.client.ServerProxy('http:\u002F\u002Flocalhost:\u003CPORT>')\n```\n\n**5. Register the MCP server with Claude Code on HPC**\n```bash\nclaude mcp add pymol python3 .\u002Fpymol_mcp_server.py\n\nclaude mcp list \n\nVerify this output \npymol: python3 .\u002Fpymol_mcp_server.py - ✓ Connected\n```\n\n**6. On your PC — start the SSH reverse tunnel**\n\nSkip this step if you are on a local Linux machine; it is only needed if you followed the above steps on an HPC system.\n```bash\nssh -R \u003CPORT>:localhost:9123 \u003Cuser>@\u003Chpc-address> \n```\n\n**7. Open Claude Code**\n```bash\nclaude\n```\n\n---\n\n## Setup on Mac (Local)\n\n**1. Clone the repo**\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fnagarh\u002Fpymol-claude-code\ncd pymol-claude-code\n```\n\n**2. Create virtual environment and install dependencies**\n```bash\npython3 -m venv venv\nsource venv\u002Fbin\u002Factivate\npip install mcp\n```\n\n**3. Register the MCP server with Claude Code**\n```bash\nclaude mcp add pymol $(pwd)\u002Fvenv\u002Fbin\u002Fpython3 $(pwd)\u002Fpymol_mcp_server.py\n\nclaude mcp list\n\nverify this output:\npymol_mcp_server.py - ✓ Connected\n```\n\n**4. Open Claude Code**\n```bash\nclaude\n```\n\nPyMOL must be running with XML-RPC before using Claude Code.\n\n---\n\n## Usage\n\nOnce connected, Claude can control PyMOL directly. Example prompts:\n\n- `fetch 1hho and show the protein as cartoon`\n- `remove water molecules and show surface`\n- `select residues within 4 angstroms of the ligand`\n- `color the helices salmon and the ligand yellow`\n\n## Auto-approve PyMOL MCP Permissions\n\nBy default Claude Code asks for approval every time a PyMOL tool is called. To disable this, add the following to your `~\u002F.claude\u002Fsettings.json`:\n\n```json\n{\n  \"permissions\": {\n    \"allow\": [\n      \"Bash(*)\",\n      \"mcp__pymol__*\"\n    ]\n  }\n}\n```\nOR \n\n```bash\necho '{\"permissions\":{\"allow\":[\"Bash(*)\",\"mcp__pymol__*\"]}}' > ~\u002F.claude\u002Fsettings.json\n```\n\n\nThis allows all PyMOL MCP tools (`run_command`, `run_python` and `pymol_get`) without prompting.\n\n---\n\n## Troubleshooting\n\n**MCP server shows `failed`**\n- Check that PyMOL is running with XML-RPC enabled\n- Verify the port in `pymol_mcp_server.py` matches your tunnel port\n- Restart Claude Code after changing the port\n\n**Port is stuck on HPC**\n- Always press `Ctrl+C` on the SSH tunnel before closing the terminal\n- Use a different port if stuck: `ss -tlnp | grep \u003CPORT> || echo \"FREE\"`\n- Stuck ports are released by HPC's sshd automatically after some time\n\n---\n\n## Author\n\n**Name:** Hemant Nagar  \n**Email:** hn533621@ohio.edu\n","该项目通过Claude Code控制PyMOL，实现分子可视化操作。其核心功能是利用Model Context Protocol协议，将自然语言指令实时转换为PyMOL命令，支持结构获取、高亮活性位点残基、按二级结构着色及测量距离等功能，无需插件或图形界面交互。项目基于Python开发，适用于需要远程或本地进行复杂分子结构分析与展示的场景，如科研教育、药物设计等。用户只需在终端启动PyMOL，并通过简单的SSH反向隧道配置即可完成HPC集群上的远程控制设置。",2,"2026-06-11 04:02:35","CREATED_QUERY"]