Agent skill

Chemgraph

by argonne-lcf in argonne-lcf/ChemGraph

Develop, test, and extend ChemGraph -- an agentic framework for automated molecular simulations using LLMs, LangGraph, ASE, and MCP servers

Apache-2.0Auto-check passedAI & LLM Engineering

Install Chemgraph

skills CLI
$ npx skills add argonne-lcf/ChemGraph --skill chemgraph -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install argonne-lcf/ChemGraph chemgraph --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/argonne-lcf/ChemGraph.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.opencode/skills/chemgraph .claude/skills/chemgraph && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
chemgraph
GitHub stars
162
Token cost
~2.7k tokens
SKILL.md length
795 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
Apache-2.0

At a glance

Develop, test, and extend ChemGraph -- an agentic framework for automated molecular simulations using LLMs, LangGraph, ASE, and MCP servers

  • Works in 5 steps: Create or edit a file in… → Define the function with the @tool… → Use Pydantic schemas for structured… → …
  • Tasks that involve Building AI agents
  • SKILL.md covers What is ChemGraph, Project layout, Architecture overview and How to add a new LangChain tool, plus 12 more sections
  • Calls pytest, python and docker

What it does

Chemgraph is an agent skill from argonne-lcf/ChemGraph. Develop, test, and extend ChemGraph -- an agentic framework for automated molecular simulations using LLMs, LangGraph, ASE, and MCP servers

Its SKILL.md is about 2.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: opencode

It sits in AI & LLM Engineering, covering Building AI agents, MCP servers and Drug discovery and cheminformatics. It works with Model Context Protocol, LangGraph and LangChain. The repository describes itself as: Agentic framework for computational chemistry and materials science workflows. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Building AI agents
  • Tasks that involve MCP servers
  • Tasks that involve Drug discovery and cheminformatics

Example prompts

  • “/chemgraph”

Requirements

  • Python 3
  • Docker
  • Compatibility (from SKILL.md): opencode

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Create or edit a file in src/chemgraph/tools/
  2. Define the function with the @tool decorator from langchain_core.tools
  3. Use Pydantic schemas for structured input (see schemas/ase_input.py for the pattern)
  4. Import the tool in the relevant graph file (src/chemgraph/graphs/) and add it to the tools list
  5. Add tests in tests/

What it can do on your machine

Read from SKILL.md and the folder at commit e890eb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pytest
    • python
    • docker
    • streamlit

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use docker, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    opencode

    From compatibility in the SKILL.md frontmatter.

Context cost

Chemgraph loads about 2.7k tokens when it runs. Until then it costs about 37 tokens; SKILL.md has 795 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~37
When it runs · the whole SKILL.md, loaded when a task matches
~2.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from argonne-lcf/ChemGraph at commit e890eb3, republished under its Apache-2.0 licence (© argonne-lcf). 795 words, ~2,694 tokens.

Download SKILL.mdSave it as .claude/skills/chemgraph/SKILL.md (or your agent's skills folder).
name
chemgraph
description
Develop, test, and extend ChemGraph -- an agentic framework for automated molecular simulations using LLMs, LangGraph, ASE, and MCP servers
compatibility
opencode
license
Apache-2.0
metadata.audience
developers
metadata.workflow
development

What is ChemGraph

ChemGraph is a Python framework (package name chemgraph) built at Argonne National Laboratory that automates computational chemistry workflows using LLMs. It connects natural language queries to molecular simulations via an agent architecture built on LangGraph/LangChain, ASE (Atomic Simulation Environment), RDKit, and MCP (Model Context Protocol) servers.

Key capabilities: molecule lookup (PubChem), 3D structure generation (RDKit), geometry optimization, vibrational analysis, thermochemistry, IR spectra, and HPC-scale ensemble simulations via Parsl.

Project layout

ChemGraph/
  src/
    chemgraph/              # Core package
      agent/                # Main ChemGraph agent class (llm_agent.py)
      graphs/               # LangGraph workflow definitions (9 workflows)
      tools/                # LangChain tool implementations
      mcp/                  # FastMCP server implementations
      models/               # LLM provider integrations (OpenAI, Anthropic, Gemini, Groq, Ollama, ALCF, Argo)
      prompt/               # System prompt templates per model/workflow
      schemas/              # Pydantic data models (AtomsData, ASEInput/Output, calculators)
      memory/               # Session memory (SQLite-backed persistence, schemas)
      state/                # LangGraph state definitions
      hpc_configs/          # Parsl configs for ALCF Polaris/Aurora
      utils/                # Config, logging, evaluation utilities
    ui/                     # Streamlit web app (app.py) and Rich CLI (cli.py)
  tests/                    # pytest test suite (20+ files)
  scripts/                  # MCP examples, Parsl examples
  notebooks/                # Jupyter demo notebooks
  docs/                     # MkDocs documentation source
  config.toml               # Default runtime configuration
  pyproject.toml            # Package metadata and dependencies
  docker-compose.yml        # Multi-profile Docker (jupyter, streamlit, mcp, cli)

Architecture overview

Agent entry point

src/chemgraph/agent/llm_agent.py contains the ChemGraph class. This is the central orchestrator:

  • Selects and loads LLM models from any supported provider
  • Dispatches to the correct workflow graph
  • Runs async execution via LangGraph's astream
  • Handles state serialization and logging
Workflows (graphs/)

Each file defines a LangGraph StateGraph. The workflows are:

WorkflowFilePurpose
single_agentsingle_agent.pyDefault. One LLM with chemistry tools
multi_agentmulti_agent.pyPlanner/Executor/Aggregator pipeline
graspagraspa_agent.pyGas adsorption in MOFs
mock_agentmock_agent.pyTesting workflow
graspa_mcpgraspa_mcp.pygRASPA via MCP + Parsl
mof_builder_mcpmof_builder_mcp.pyMOF construction via MCP
Tools (tools/)

LangChain @tool-decorated functions. Key files:

  • ase_tools.py -- run_ase (energy/opt/vib/thermo), save_atomsdata_to_file, file_to_atomsdata
  • cheminformatics_tools.py -- molecule_name_to_smiles, smiles_to_coordinate_file, smiles_to_atomsdata
  • generic_tools.py -- calculator (safe math eval), ask_human
  • report_tools.py -- generate_html (interactive HTML reports with NGL 3D viewer)
  • graspa_tools.py -- gRASPA simulation tools
  • architector_tools.py -- Metal complex tools
  • pormake_tools.py -- MOF topology/structure tools
  • parsl_tools.py -- MACE with Parsl for HPC parallel execution
MCP servers (mcp/)

FastMCP-based servers. Each exposes chemistry tools over stdio or HTTP:

  • mcp_tools.py -- General chemistry MCP server (name-to-SMILES, structure gen, ASE simulations, file I/O). Port 9003.
  • mace_mcp_parsl.py -- MACE ML potential with Parsl HPC. Port 9004.
  • graspa_mcp_parsl.py -- gRASPA simulation with Parsl HPC. Port 9005.
  • data_analysis_mcp.py -- Data analysis (CIF splitting, JSONL aggregation, isotherm plotting). Port 9006.
  • server_utils.py -- Shared startup utility (run_mcp_server), handles stdio vs streamable_http transport, logging to stderr.
Schemas (schemas/)

Pydantic models for data validation:

  • atomsdata.py -- AtomsData (numbers, positions, cell, pbc)
  • ase_input.py -- ASEInputSchema / ASEOutputSchema
  • agent_response.py -- ResponseFormatter, VibrationalFrequency, IRSpectrum, etc.
  • calculators/ -- One schema per calculator: mace_calc.py, emt_calc.py, tblite_calc.py, nwchem_calc.py, orca_calc.py, psi4_calc.py, fairchem_calc.py, mopac_calc.py, aimnet2_calc.py
Memory (memory/)

SQLite-backed session persistence:

  • store.py -- SessionStore class: CRUD for sessions, context building for resume, prefix-based session ID lookup. Database at ~/.chemgraph/sessions.db.
  • schemas.py -- SessionMessage (role, content, tool_name, timestamp), Session (full record with messages), SessionSummary (lightweight listing model)
State (state/)

LangGraph state definitions:

  • state.py -- State (messages + remaining_steps), MultiAgentState
  • multi_agent_state.py -- ManagerWorkerState for Planner/Executor/Aggregator
  • graspa_state.py, mof_state.py -- Domain-specific states

How to add a new LangChain tool

  1. Create or edit a file in src/chemgraph/tools/
  2. Define the function with the @tool decorator from langchain_core.tools
  3. Use Pydantic schemas for structured input (see schemas/ase_input.py for the pattern)
  4. Import the tool in the relevant graph file (src/chemgraph/graphs/) and add it to the tools list
  5. Add tests in tests/

Example pattern from cheminformatics_tools.py:

python
from langchain_core.tools import tool

@tool
def molecule_name_to_smiles(name: str) -> str:
    """Convert a molecule name to SMILES using PubChem."""
    import pubchempy as pcp
    comps = pcp.get_compounds(name.strip(), "name")
    if not comps:
        raise ValueError(f"No PubChem compound found for: {name}")
    return comps[0].connectivity_smiles  # .smiles keeps stereochemistry

How to add a new MCP server tool

MCP tools are defined in src/chemgraph/mcp/ using FastMCP:

python
from mcp.server.fastmcp import FastMCP

mcp = FastMCP(name="My Server", instructions="...")

@mcp.tool(name="my_tool", description="What it does")
async def my_tool(param: str) -> dict:
    # implementation
    return {"status": "success", "result": ...}

if __name__ == "__main__":
    from chemgraph.mcp.server_utils import run_mcp_server
    run_mcp_server(mcp, default_port=9007)

The run_mcp_server utility handles:

  • --transport stdio (default) for LangGraph/OpenCode MCP clients
  • --transport streamable_http with --port and --host for HTTP access
  • Logging to stderr (critical for stdio mode) and optional file logging via CHEMGRAPH_LOG_DIR
Show full SKILL.md (312 more words)Show less

How to add a new calculator

  1. Create a Pydantic schema in src/chemgraph/schemas/calculators/ (follow mace_calc.py pattern)
  2. The schema must define calculator_type, implement get_calculator() returning an ASE calculator, and optionally get_atoms_properties()
  3. Register it in src/chemgraph/tools/mcp_helper.py load_calculator() with a new elif branch
  4. Add tests

How to add a new workflow

  1. Create a new graph file in src/chemgraph/graphs/
  2. Define a StateGraph with nodes, edges, and conditional routing
  3. Register it in src/chemgraph/agent/llm_agent.py in the workflow dispatch logic
  4. Add a prompt template in src/chemgraph/prompt/ if needed
  5. Add a state class in src/chemgraph/state/ if the workflow needs custom state

Running tests

bash
# Run all tests (excluding LLM-dependent tests)
pytest tests/

# Run with LLM tests
pytest tests/ --run-llm

# Run specific test file
pytest tests/test_mcp.py

# Run async tests
pytest tests/test_mcp.py -v

Test markers:

  • @pytest.mark.llm -- requires LLM API access (skipped by default)
  • @pytest.mark.asyncio -- async tests

Running MCP servers

bash
# stdio mode (for LangGraph / OpenCode / Claude Desktop)
python -m chemgraph.mcp.mcp_tools

# HTTP mode
python -m chemgraph.mcp.mcp_tools --transport streamable_http --port 9003

# With log directory
CHEMGRAPH_LOG_DIR=/tmp/chemgraph_logs python -m chemgraph.mcp.mcp_tools

Running the CLI

bash
# Single query
chemgraph --query "Calculate the energy of water using MACE"

# Interactive mode
chemgraph --interactive

# List supported models
chemgraph --list-models

# Session management
chemgraph --list-sessions
chemgraph --show-session a3b2
chemgraph --delete-session a3b2c1d4
chemgraph -q "Follow-up query" --resume a3b2

Running the Streamlit UI

bash
streamlit run src/ui/app.py

Configuration

config.toml at the project root controls runtime settings:

  • [general] -- model, workflow, recursion_limit, verbosity
  • [chemistry.calculators] -- omit default for automatic selection (mace_polar when the graph-longrange add-on is installed, otherwise mace_mp); an explicit default preserves that selection. Fallback is emt.
  • [chemistry.optimization] -- optimizer method, fmax, steps
  • [api.*] -- LLM provider base URLs and timeouts

Coding conventions

  • Python >= 3.10, formatted with Ruff (line-length 88)
  • Pydantic for all data models and tool input schemas
  • Async-first for MCP tool implementations
  • All MCP server logging must go to stderr (stdout is reserved for stdio transport)
  • Energies in eV, frequencies in cm^-1, distances in Angstroms
  • Pre-commit hooks configured via .pre-commit-config.yaml (Ruff linter + formatter)

Docker

bash
# Streamlit UI
docker compose --profile streamlit up

# MCP server
docker compose --profile mcp up

# Jupyter notebooks
docker compose --profile jupyter up

Key dependencies

  • langgraph + langchain -- agent orchestration
  • ase -- atomic simulation environment
  • rdkit -- cheminformatics, 3D structure generation
  • pubchempy -- PubChem molecule lookup
  • mcp + fastmcp -- Model Context Protocol servers
  • mace-torch -- MACE ML potentials
  • pydantic -- data validation
  • parsl -- HPC parallel execution (optional)
  • streamlit + stmol -- web UI (optional)

When to use this skill

Use this skill when:

  • Developing new features, tools, or workflows for ChemGraph
  • Adding or modifying MCP servers
  • Adding new calculator integrations
  • Writing or debugging tests
  • Understanding the project architecture
  • Refactoring or extending existing code

© argonne-lcf, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .opencode/skills/chemgraph of argonne-lcf/ChemGraph.

Open the folder on GitHubat commit e890eb3

Compare with similar skills

Chemgraph next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Chemgraph compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Chemgraph this skillargonne-lcf/ChemGraph162—~2.7kAutomated safety check: PassApache-2.0
Dive Into LangGraphluochang212/dive-into-langgraph457—~837Automated safety check: NotesCustom licence
Tool Designagentailor/fullstack-langgraph-nextjs-agent132—~3.2kAutomated safety check: PassMIT
Magic ResumeMagic-Resume/Magic-Resume101—~663Automated safety check: PassMIT
Agent Eval Casesagentailor/fullstack-langgraph-nextjs-agent132—~5.3kAutomated safety check: PassMIT
Agent Inspectrajudandigam/agent-inspect165—~424Automated safety check: PassMIT

Similar skills

  • Dive Into LangGraph

    luochang212/dive-into-langgraph

    A Chinese-language guide and reference for building agents with LangGraph 1.0, from a first ReAct agent through middleware, memory, MCP, RAG and web search.

    457 GitHub stars~837 tokensUpdated 27 days ago
    AI & LLM EngineeringAuto-check: notes
  • Tool Design

    agentailor/fullstack-langgraph-nextjs-agent

    Design and verify tools that AI agents can actually use — for any framework or language (MCP servers, LangChain/LangGraph, function-calling, raw JSON schema; TypeScript, Python, or otherwise).

    132 GitHub stars~3.2k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Magic Resume

    Magic-Resume/Magic-Resume

    How AI agents integrate with Magic Resume — read and safely edit a user's resumes through the native MCP server (@magic-resume/mcp).

    101 GitHub stars~663 tokensUpdated 3 days ago
    Agent WorkflowsAuto-check passed
  • Agent Eval Cases

    agentailor/fullstack-langgraph-nextjs-agent

    Decide which AI agent behaviors are worth an eval case, then write those cases — harness-, framework-, and language-agnostic.

    132 GitHub stars~5.3k tokensUpdated 1 mo ago
    AI & LLM EngineeringAuto-check passed
  • Agent Inspect

    rajudandigam/agent-inspect

    Local evidence debugger and trajectory-test toolkit for TypeScript AI agents.

    165 GitHub stars~424 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Strands

    strands-agents/harness-sdk

    Build, extend, evaluate, or migrate applications with Strands Agents in Python or TypeScript.

    8.7k GitHub stars~1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from argonne-lcf/ChemGraph

  • Pbs Hpc

    argonne-lcf/ChemGraph

    Prepare PBS HPC jobs, choose allocation and filesystem settings, submit and monitor jobs, and diagnose job output.

    162 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Chemgraph

    argonne-lcf/ChemGraph

    Use ChemGraph Python and CLI workflows, agent-written batch scripts, and attached chemistry MCP tools.

    162 GitHub stars~743 tokensUpdated yesterday
    Auto-check passed

Questions about Chemgraph

What does Chemgraph do?

Develop, test, and extend ChemGraph -- an agentic framework for automated molecular simulations using LLMs, LangGraph, ASE, and MCP servers. Chemgraph is an agent skill from argonne-lcf/ChemGraph.

When should I use Chemgraph?

Chemgraph fits situations like: tasks that involve Building AI agents; tasks that involve MCP servers; tasks that involve Drug discovery and cheminformatics.

How do I install Chemgraph in Claude Code?

Run `npx skills add argonne-lcf/ChemGraph --skill chemgraph -a claude-code`. Or copy the skill folder (.opencode/skills/chemgraph in argonne-lcf/ChemGraph) into .claude/skills/chemgraph in your project. Claude Code loads it when a task matches its description.

How do I install Chemgraph in Codex?

Run `npx skills add argonne-lcf/ChemGraph --skill chemgraph -a codex`. Or copy the skill folder (.opencode/skills/chemgraph in argonne-lcf/ChemGraph) into .agents/skills/chemgraph in your project. Codex loads it when a task matches its description.

Can I use Chemgraph in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add argonne-lcf/ChemGraph --skill chemgraph -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/chemgraph, .gemini/skills/chemgraph, .github/skills/chemgraph and .opencode/skills/chemgraph in your project.

What does Chemgraph need to run?

Going by SKILL.md and its folder, Chemgraph needs the command-line tools its instructions call (pytest, python, docker and streamlit). Our summary lists: Python 3; Docker. Compatibility (from SKILL.md): opencode.

Does Chemgraph access the network?

SKILL.md contains no URLs. Its commands use docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Chemgraph safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Chemgraph use?

Chemgraph is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Chemgraph use?

About 2.7k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Chemgraph?

Skills that share tags, products or a category with Chemgraph: Dive Into LangGraph (luochang212/dive-into-langgraph, 457 stars), Tool Design (agentailor/fullstack-langgraph-nextjs-agent, 132 stars), Magic Resume (Magic-Resume/Magic-Resume, 101 stars) and Agent Eval Cases (agentailor/fullstack-langgraph-nextjs-agent, 132 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Chemgraph?

argonne-lcf (a GitHub organization) maintains it in argonne-lcf/ChemGraph, which has 162 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 7, 2026.

Source: argonne-lcf/ChemGraph on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.