Sponsored by Deepsite.site

Chemmcp

Created By
a month ago
Content

This guide will help you quickly set up and start using ChemMCP. Quick Setup Install uv"><script type=application/ld+json>[{"@context":"https://schema.org","@type":"Article","articleSection":"ChemMCP - Build Your Chemistry Co-Scientist","name":"Get Started","headline":"Get Started","abstract":"\u003cp\u003eChemMCP is a chemistry toolkit that empowers AI assistants with advanced chemistry capabilities.\u003c/p\u003e\n\u003cp\u003eThis guide will help you quickly set up and start using ChemMCP.\u003c/p\u003e\n\n\n\u003ch2 class=\u0022relative group\u0022\u003eQuick Setup \n \u003cdiv id=\u0022quick-setup\u0022 class=\u0022anchor\u0022\u003e\u003c/div\u003e\n \n\u003c/h2\u003e\n\u003col\u003e\n\u003cli\u003e\n\u003cp\u003e\u003cstrong\u003eInstall uv\u003c/strong\u003e\u003c/p\u003e","inLanguage":"en","url":"https://osu-nlp-group.github.io/ChemMCP/get-started/","author":{"@type":"Person","name":"The OSU NLP Group"},"mainEntityOfPage":"true","wordCount":"759"}]<link href=https://x.com/osunlp rel=me><link href=https://github.com/OSU-NLP-Group rel=me><script src=https://osu-nlp-group.github.io/ChemMCP/lib/jquery/jquery.slim.min.b0dca576e87d7eaa5850ae4e61759c065786cdb6489d68fcc82240539eebd5da522bdb4fda085ffd245808c8fe2acb2516408eb774ef26b5f6015fc6737c0ea8.js integrity="sha512-sNylduh9fqpYUK5OYXWcBleGzbZInWj8yCJAU57r1dpSK9tP2ghf/SRYCMj+KsslFkCOt3TvJrX2AV/Gc3wOqA==">

<div class="fixed inset-x-0 top-0 h-[800px] single_hero_background nozoom" style=background-image:url(/ChemMCP/img/background.svg)>

Get Started

<script type=text/javascript src=https://osu-nlp-group.github.io/ChemMCP/js/zen-mode.min.eea5245cf9244ecbdf2c150d1c8833226c1541cadf6e98f63a7c9192b1a3676df2c3ec603b14f4cfaaa53971fd9d8955640c0f405bf3de2b43ee7a5fb29ae721.js integrity="sha512-7qUkXPkkTsvfLBUNHIgzImwVQcrfbpj2OnyRkrGjZ23yw+xgOxT0z6qlOXH9nYlVZAwPQFvz3itD7npfsprnIQ==">
Table of Contents

ChemMCP is a chemistry toolkit that empowers AI assistants with advanced chemistry capabilities.

This guide will help you quickly set up and start using ChemMCP.

Quick Setup

  1. Install uv

    We recommend using <a href=https://github.com/astral-sh/uv target=_blank>uv, a fast Python package and project manager. Install uv with the following commands:

    # On macOS and Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # On Windows, use Powershell
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. Download ChemMCP

    git clone https://github.com/OSU-NLP-Group/ChemMCP.git
    
  3. Set Up and Install

    cd ChemMCP
    uv sync
    

    This above commands create a Python virtual environment in the .venv folder with all required packages installed. Then activate the environment:

    # On macOS and Linux
    source .venv/bin/activate
    
    # On Windows (CMD)
    .venv\Scripts\activate.bat
    

    To install ChemMCP:

    uv pip install -e . --no-build-isolation
    

    Optional: Use an Existing Environment

    To install ChemMCP in an existing Python or Conda environment:

    # Install dependencies
    pip install -r requirements
    
    # Install ChemMCP
    pip install -e --no-build-isolation
    
  4. Install docker

    If you are to use the <a href=https://osu-nlp-group.github.io/ChemMCP/tools/python_executor/>PythonExecutor tool, which relies on docker, please follow <a href=https://osu-nlp-group.github.io/ChemMCP/tools/python_executor/>its official doc to install it. Otherwise, please exclude it from the tools to run, using <a href=https://osu-nlp-group.github.io/ChemMCP/quick-config>QuickConfig, or the MCP server would not successfully start.

Usage

ChemMCP supports two usage modes:

The following sections will walk you through the basic usage of both modes, after setting up required API keys.

Required API Keys

Set the following environment variables to enable tool functionality:

To use all tools, you’ll need all the above variables. If you only plan to use a subset, not all variables are required, and you can use our <a href=https://osu-nlp-group.github.io/ChemMCP/quick-config>QuickConfig utility to auto-configure your tools.

MCP Mode

You can run ChemMCP as an MCP server to integrate with different clients. Here we show two examples, and the configuration should be very similar for other senarios.

Claude Desktop Integration

Follow <a href=https://modelcontextprotocol.io/quickstart/server#testing-your-server-with-claude-for-desktop target=_blank>this guide to set up the configuration file of Claude Desktop. The JSON config for ChemMCP:

{
    "mcpServers": {
        "ChemMCP": {
            "command": "/ABSTRACT/PATH/TO/uv",  // Use which uv to get its path
            "args": ["run", "-m", "chemmcp"],
            "toolCallTimeoutMillis": 300000,  // Set this value because some tools may be slow in response of requests
            "env": {
                "CHEMSPACE_API_KEY": "API_KEY",
                "RXN4CHEM_API_KEY": "API_KEY",
                "TAVILY_API_KEY": "API_KEY",
                "LLM_MODEL_NAME": "openai/gpt-4o",  // Or any other LLM names supported by LiteLLM
                // Add required LLM credentials
                // ...
            }
        }
    }
}

Integration with LLM APIs (e.g., OpenAI Agents SDK)

LLM providers provide their SDKs to support MCP servers. Take <a href=https://openai.github.io/openai-agents-python/mcp/ target=_blank>OpenAI Agents SDK as an example, connect to ChemMCP with the following code:

async with MCPServerStdio(
    params={
        "command": "/ABSTRACT/PATH/TO/uv",  # Use which uv to get its path
        "args": ["--directory", "/ABSTRACT/PATH/TO/ChemMCP", "run", "-m", "chemmcp"],
        "toolCallTimeoutMillis": 300000,  # Set this value because some tools may be slow in response of requests
        "env": {
        		"CHEMSPACE_API_KEY": "API_KEY",
            "RXN4CHEM_API_KEY": "API_KEY",
            "TAVILY_API_KEY": "API_KEY",
            "LLM_MODEL_NAME": "openai/gpt-4o-2024-08-06",  # Or any other LLM names supported by LiteLLM
          	# Aad required LLM credentials
          	# ...
        }
    }
) as server:
    tools = await server.list_tools()

Python Calling Mode

ChemMCP tools can also be called directly in Python:

import os
from chemmcp.tools import WebSearch  # or any of the tool names

# Of course, you can set only those variables required by the tools to use
envs = {
    "CHEMSPACE_API_KEY": "API_KEY",
    "RXN4CHEM_API_KEY": "API_KEY",
    "TAVILY_API_KEY": "API_KEY",
    "LLM_MODEL_NAME": "openai/gpt-4o-2024-08-06",  # Or any other LLM names supported by LiteLLM
    # Aad required LLM credentials
    # ...
}

for key, value in envs:
  os.environ[key] = value

web_search = WebSearch()
result = web_search.run_code('What is the boiling point of water?')

Available Tools

Currently, ChemMCP tools fall into three categories:

  1. General Tools: General and broad information retrieval and web searching.

  2. Molecule Tools: Various analyses, predictions, and conversions related to chemical compounds and their properties.

  3. Reaction Tools: Chemical reaction prediction and analysis.

See the full list and documentation on the <a href=https://osu-nlp-group.github.io/ChemMCP/tools>Tools page.

Next Steps

Contact

Have questions or feedback?

  • Open an issue for bug reports or feature requests on our <a href=https://github.com/OSU-NLP-Group/ChemMCP target=_blank>GitHub repository.

  • Email us at yu.3737 at osu.edu – we are eager to know your ideas and suggestions!

<script type=text/javascript src=https://osu-nlp-group.github.io/ChemMCP/js/page.min.0860cf4e04fa2d72cc33ddba263083464d48f67de06114529043cb4623319efed4f484fd7f1730df5abea0e2da6f3538855634081d02f2d6e920b956f063e823.js integrity="sha512-CGDPTgT6LXLMM926JjCDRk1I9n3gYRRSkEPLRiMxnv7U9IT9fxcw31q+oOLabzU4hVY0CB0C8tbpILlW8GPoIw==">
<div id=search-wrapper class="invisible fixed inset-0 flex h-screen w-screen cursor-default flex-col bg-neutral-500/50 p-4 backdrop-blur-sm dark:bg-neutral-900/50 sm:p-6 md:p-[10vh] lg:p-[12vh]" data-url=https://osu-nlp-group.github.io/ChemMCP/ style=z-index:500>

    Recommend Servers
    TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
    Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
    BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
    Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
    Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
    EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
    Tavily Mcp
    WindsurfThe new purpose-built IDE to harness magic
    MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
    TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
    Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
    DeepChatYour AI Partner on Desktop
    CursorThe AI Code Editor
    ChatWiseThe second fastest AI chatbot™
    Serper MCP ServerA Serper MCP Server
    AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
    Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
    Amap Maps高德地图官方 MCP Server
    Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
    MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
    Playwright McpPlaywright MCP server