py3Dmol

A Python tool for showing interactive 3D models of molecules, proteins, and protein–drug complexes in notebooks or scripts.

In plain words
What is it for?
Use it to load PDB, SDF, or SMILES structures, display them as cartoons, sticks, spheres, or surfaces, select parts by chain or residue, and export PNG or HTML views.
Why use it?
It makes complex molecular structures easier to inspect than in raw structure files. It helps you examine binding poses, pockets, shapes, and structural differences visually.

Skill for Claude CodeCodex

Part of the alkyl plugin — 27 skills shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kdevos12/alkyl/py3dmol
Any agent
npx skills add Kdevos12/ALKYL --skill py3dmol
Clone the repo
git clone --depth 1 https://github.com/Kdevos12/ALKYL

Made for: Claude Code, Codex.

Or install alkyl, the plugin that ships this one along with the rest of its 27 skills.

Per session 68 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 625 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00068 $0.00625
Opus 5 $0.00034 $0.00313
Sonnet 5 $0.00014 $0.00125
Haiku 4.5 $0.00007 $0.00063

Measured 3d ago against content hash 81c0938be10c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

py3Dmol scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/py3Dmol/SKILL.md · 58 lines

How it starts

The opening of the file, as written. The whole thing — 58 lines — stays where its author put it; the contents beside it link to each section on GitHub.

py3Dmol — Molecular Visualization

Purpose

Interactive 3D molecular visualization in Jupyter notebooks and scripts. Wraps 3Dmol.js (WebGL). Used for docking pose inspection, protein-ligand complexes, conformer overlays, trajectory snapshots.

When to Use This Skill

  • Visualizing docking poses from Vina/Gnina
  • Inspecting protein-ligand binding pockets
  • Displaying conformer ensembles
  • Annotating pharmacophore features on 3D structures
  • Quick structure QC after homology modeling or MD prep

Reference Files

File Content
references/basics.md Installation, view creation, loading PDB/SDF/SMILES, stick/sphere/cartoon/surface basics
references/protein-ligand.md Protein+ligand display, binding pocket zoom, dual-structure overlay, docking pose batch
references/selections-styles.md Selection language (chain/resi/resn/atom), color schemes, surfaces, labels, transparency
references/jupyter-patterns.md Jupyter embed, ipywidgets sliders, NGLview alternative, saving PNG, RDKit interop

Quick Routing

"Show me a docking pose"protein-ligand.md

"Show all conformers overlaid"jupyter-patterns.md (animation loop)

"Highlight binding pocket / surface"selections-styles.md

"I just need a quick look at a molecule"basics.md

Minimal Pattern

import py3Dmol

view = py3Dmol.view(width=800, height=500)
view.addModel(open('complex.pdb').read(), 'pdb')
view.setStyle({'cartoon': {'color': 'spectrum'}})   # protein
view.setStyle({'resn': 'LIG'}, {'stick': {'colorscheme': 'greenCarbon'}})
view.zoomTo({'resn': 'LIG'})
view.show()

Key Facts

  • py3Dmol renders via 3Dmol.js in Jupyter — requires a running notebook kernel
  • For non-Jupyter contexts: use view.png() → base64 PNG, or view.write_html()
  • NGLview is an alternative with better trajectory support (use for MD)
  • setStyle is cumulative by default; use setStyle({}, {}) to reset all
  • Ligand residue name varies: 'LIG', 'UNL', 'MOL' — check with grep before scripting

Read the full file on GitHub · 58 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 58 lines · 68 tokens per session scan A 81c0938be10c

Subscribe to this mod's changes

py3Dmol is a skill published in the GitHub repository Kdevos12/ALKYL (6 stars, last pushed 5mo ago), licensed MIT. It adds 68 tokens to every session and 625 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

datamol

Pythonic wrapper around RDKit with simplified interface and sensible defaults. Preferred for standard drug discovery including SMILES parsing, standardization, descriptors, fingerprints, clustering, 3D conformers, parallel processing. Returns native rdkit.Chem.Mol objects. For advanced control or custom parameters…

synthetic-sciences/openscience · 67 tokens

deepchem

Molecular ML with diverse featurizers and pre-built datasets. Use for property prediction (ADMET, toxicity) with traditional ML or GNNs when you want extensive featurization options and MoleculeNet benchmarks. Best for quick experiments with pre-trained models, diverse molecular representations. For graph-first…

synthetic-sciences/openscience · 78 tokens

molecular-optimization

Iterative lead optimization with analyze-reason-generate-verify-evaluate loop. Paper-backed (MT-Mol, DrugR, MultiMol).

synthetic-sciences/openscience · 34 tokens

admet-reasoning

Interpretable ADMET analysis with mechanistic reasoning. Maps liabilities to structural causes and biological pathways. Based on CoTox (Park 2025) and DrugR (Liu 2026).

synthetic-sciences/openscience · 47 tokens

patsnap-pharma-intelligence

Patsnap Pharma Intelligence MCP for AI agents. Search clinical trials, drugs, patents, papers, deals, FDA labels and more via 28 specialized tools.

patsnap/mcp · 40 tokens

patsnap-solution-engine

Patsnap TRIZ Concept Solution Engine MCP for AI agents. Generates innovation or product cost-reduction concepts through asynchronous TRIZ and TRIZ/DFMA workflows. Use for engineering problem solving, concept alternatives, cost-reduction analysis, task-progress retrieval, and selected-solution details.

patsnap/mcp · 64 tokens