Skip to content

Add Model Context Protocol (MCP) server for molecular database access#5

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-model-context-protocol
Draft

Add Model Context Protocol (MCP) server for molecular database access#5
Copilot wants to merge 3 commits intomainfrom
copilot/add-model-context-protocol

Conversation

Copy link
Contributor

Copilot AI commented Jan 3, 2026

Adds a lightweight MCP server to expose molecular interaction rules database functionality to AI assistants via JSON-RPC 2.0 protocol.

Implementation

  • mcp_server.py: STDIO-based MCP server with 5 tools:

    • list_molecules: Enumerate all molecules in database
    • get_molecule_fg_family: Retrieve functional group family
    • get_atom_names: Get interaction site names
    • get_monomer_coordinates: Return z-matrix for monomer
    • form_dimer_coordinates: Generate dimer z-matrix from two monomers
  • mcp_cli.py: Console script entry point for server invocation

  • Configuration: Sample mcp-config.json and documentation in MCP_README.md

Usage

# Install and run
pip install molecular-interaction-rules
molecular-interaction-rules-mcp
// MCP client configuration
{
  "mcpServers": {
    "molecular-interaction-rules": {
      "command": "molecular-interaction-rules-mcp"
    }
  }
}
# Direct Python usage
from molecular_interaction_rules import MCPServer

server = MCPServer()
response = server.handle_request({
    'jsonrpc': '2.0',
    'id': 1,
    'method': 'tools/call',
    'params': {
        'name': 'form_dimer_coordinates',
        'arguments': {
            'molecule_1': 'benzene',
            'site_1': 'RC1',
            'molecule_2': 'benzene',
            'site_2': 'H1'
        }
    }
})

Changes

  • Added console script entry point in setup.py
  • Exported MCPServer in package __init__.py
  • Removed non-existent dithiolane import
  • Updated README with MCP quick start
Original prompt

This section details on the original issue you should resolve

<issue_title>SS-1: Add a Model Context Protocol on top of the package</issue_title>
<issue_description>Hi Copilot,

I need this package for the automatic generation of monomers and dimers of z-matrices at any given distance to have a model context protocol layer on top. We are going to register this with the MCP, I want this minimal code and lightweight.

Follow my style of code I put in the package.</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 3, 2026 21:59
Co-authored-by: Sulstice <11812946+Sulstice@users.noreply.github.com>
Co-authored-by: Sulstice <11812946+Sulstice@users.noreply.github.com>
Copilot AI changed the title [WIP] Add model context protocol to package for Z-matrix generation Add Model Context Protocol (MCP) server for molecular database access Jan 3, 2026
Copilot AI requested a review from Sulstice January 3, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SS-1: Add a Model Context Protocol on top of the package

2 participants