mofstructure-mcp

mofstructure-mcp

An MCP server for deconstructing and analyzing Metal-Organic Framework (MOF) structures, including SBU and ligand identification, guest removal, and COF stacking analysis. It enables AI agents to perform automated chemical informatics and structural characterization on crystal structures via CIF files.

Category
访问服务器

README

mofstructure — MCP Edition

A lean, MCP-enabled repackaging of the outstanding mofstructure library by Dr. Dinga Wonanke.


Standing on the shoulders of giants

Let's be blunt: the original mofstructure is one of the most impressive pieces of software in computational materials science written by a single researcher.

In a field where "framework analysis" usually means running a black-box binary and hoping the output makes sense, Dr. Wonanke built something genuinely different. The deconstruction engine inside mofdeconstructor.py — over 2 000 lines of carefully reasoned graph theory — can take any arbitrary MOF crystal structure and correctly identify every secondary building unit, every organic ligand, every metal cluster, the SBU topology, the coordination number of every metal centre, and the points of extension — all automatically, all in pure Python, without ever needing a pre-curated database of known topologies to look things up in.

That is a hard problem. Most tools either require you to label things manually, rely on heuristic pattern matching that breaks on anything non-standard, or are proprietary closed-source binaries. mofstructure does it right: it constructs the full molecular graph, identifies metal nodes, finds the organic bridges, locates the breaking points, and assembles the building units — then hands you back proper ASE Atoms objects with SMILES, InChI and InChIKey already computed via OpenBabel.

The guest-removal logic is similarly thoughtful. Rather than a naive "delete small molecules" heuristic it analyses graph connectivity to find genuinely unbound components, which means it works correctly even on unusual solvates and disordered structures that trip up simpler approaches.

And the COF stacking analysis, the PBC wrapping, the IUPAC name lookup database — all of it is the kind of infrastructure that takes years of domain knowledge to build correctly.

If you are doing any serious high-throughput MOF screening or computational reticular chemistry, reading the original codebase is essential. This fork would not exist without its extraordinary foundation.

Original repository: https://github.com/bafgreat/mofstructure
Original author: Dr. Dinga Wonanke — https://www.dingawonanke.com
Original paper: Wonanke et al., Journal of Open Source Software, 2024.


What is this fork?

This edition strips the original down to a focused MCP (Model Context Protocol) server so that AI agents — in particular those built with featherflow — can call MOF structure operations as tools over stdio or HTTP.

What was removed and why

Removed Reason
Porosity calculation (porosity.py) Provided by the separate zeopp-backend MCP service
Open metal site detection (get_oms) Provided by mofchecker-mcp and zeopp-backend
obsolate/ directory Dead code, superseded by current implementation
Sphinx docs Out of date; not needed for MCP deployment

What was added

Added Description
mofstructure/mcp_server.py FastMCP server exposing 5 tools over stdio
mcp dependency MCP Python SDK
mofstructure_mcp CLI entry point python -m mofstructure.mcp_server

The three-service architecture

This fork is designed to work alongside two companion MCP services:

mofchecker-mcp      →  "Is this structure valid?"        (quality checks)
mofstructure-mcp    →  "What is this structure made of?" (deconstruction + cleanup)
zeopp-backend       →  "How porous is this structure?"   (geometric analysis)

Point your agent at all three and it can perform end-to-end MOF analysis from a raw CIF file.


Installation

Important — each MCP server should run in its own virtual environment.

git clone https://github.com/lichman0405/mofstructure.git
cd mofstructure
python -m venv .venv
# Linux / macOS
source .venv/bin/activate
# Windows PowerShell
.\.venv\Scripts\Activate.ps1

pip install -e .

Optional RDKit support:

pip install -e ".[rdkit]"

MCP tools

The server exposes five tools. Every tool accepts either a cif_path (absolute path on the server filesystem) or cif_content (raw CIF text).

Tool Description
remove_guest Remove unbound guest molecules; returns clean host CIF
get_sbu Deconstruct into metal + organic SBUs with SMILES / InChI / InChIKey
get_ligands Deconstruct into metal clusters + organic ligands with cheminformatics
wrap_structure Wrap atoms into unit cell — fixes the "broken bond" PBC visualisation artefact
analyze_cof_stacking Compute interlayer lateral offsets and heights; classify AA / AB / mixed stacking

Running the server

stdio (for featherflow / Claude Desktop)

python -m mofstructure.mcp_server
# or, after pip install:
mofstructure_mcp

featherflow integration

Edit ~/.featherflow/config.json:

{
  "tools": {
    "mcpServers": {
      "mofstructure": {
        "command": "/path/to/mofstructure/.venv/bin/python",
        "args": ["-m", "mofstructure.mcp_server"],
        "toolTimeout": 120
      },
      "mofchecker": {
        "command": "/path/to/mofchecker/.venv/bin/python",
        "args": ["-m", "mofchecker.mcp_server"],
        "toolTimeout": 120
      },
      "zeopp": {
        "url": "http://localhost:9877/mcp",
        "toolTimeout": 120
      }
    }
  }
}

On Windows replace the path with C:/path/to/mofstructure/.venv/Scripts/python.exe.


Using as a Python library

The library API is unchanged from the original:

from mofstructure import structure

mof = structure.MOFstructure(filename="path/to/your.cif")

# Remove guest molecules
clean = mof.remove_guest()

# Deconstruct into SBUs  (cheminfo=True computes SMILES / InChI / InChIKey)
metal_sbus, organic_sbus = mof.get_sbu(cheminfo=True)
for sbu in metal_sbus:
    print(sbu.info['sbu_type'], sbu.info['smi'])

# Deconstruct into ligands and metal clusters
metal_clusters, organic_ligands = mof.get_ligands(cheminfo=True)
for ligand in organic_ligands:
    print(ligand.info['inchikey'])

Command-line tools

Command Description
mofstructure <cif_file> [output_dir] Deconstruct a single CIF into SBUs and ligands
mofstructure_database <cif_folder> [output_dir] Batch-process a folder of CIFs into a database
mofstructure_building_units <cif_folder> Batch deconstruction only
mofstructure_curate <cif_folder> Curate / validate a folder of CIFs
mofstructure_mcp Start the MCP server (stdio)

License

MIT — same as the original project.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选