We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Chenghao-Wu/MCP_LAMMPS'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
server.cpython-311.pyc•10.1 KiB
�
X�h� � � � d Z ddlZddlZddlmZ ddlmZmZmZm Z ddl
mZ ddlm
Z
ddlmZ dd lmZ dd
lmZ ddlmZ ej ej d�
� � ej e� � Z G d� d� � Zd� Zedk r e� � dS dS )z[
MCP LAMMPS Server - Main server implementation for LAMMPS molecular dynamics simulations.
� N)�Path)�Any�Dict�List�Optional)�FastMCP)�InitializationOptions)�Context� )�LAMMPSInterface)�SimulationManager)�DataHandlerz4%(asctime)s - %(name)s - %(levelname)s - %(message)s)�level�formatc � � e Zd ZdZ ddededee d efd
�Zdd�Zd
e de
eef fd�Zddeddfd�Z
ddeddfd�ZdS )�LAMMPSServera?
MCP Server for LAMMPS molecular dynamics simulations.
This server provides tools for:
- Setting up and configuring LAMMPS simulations
- Running equilibration and production simulations
- Monitoring simulation progress
- Analyzing simulation results
- Managing simulation workflows
�LAMMPS MCP Server�>A server for controlling LAMMPS molecular dynamics simulationsN�INFO�name�instructions�work_dir� log_levelc �L � || _ || _ |pt j � � dz | _ | j � d�� � t
j � � � t t |�
� � � � � � t � � | _ t | j � � | _ t | j � � | _ t# ||g �� � | _ | � � � t( � d| j � �� � dS )a
Initialize the LAMMPS MCP server.
Args:
name: Server name
instructions: Server instructions for AI assistants
work_dir: Working directory for simulations
log_level: Logging level
�lammps_workspaceT)�exist_ok)r r �toolsz3LAMMPS MCP Server initialized with work directory: N)r r r �cwdr �mkdir�logging� getLogger�setLevel�getattr�upperr �lammps_interfacer
�simulation_managerr �data_handlerr �server�_register_tools�logger�info)�selfr r r r s �4/home/zhenghaowu/mcp_lammps/src/mcp_lammps/server.py�__init__zLAMMPSServer.__init__&