MCP Server for Molecular Verification
The Molecular Verifier Server includes MCP (Model Context Protocol) support, enabling integration with language models and AI workflows that use the MCP standard.
Overview
The MCP server provides the same molecular verification capabilities as the REST API, but through an MCP-compatible interface. This allows seamless integration with AI systems that use MCP for tool calling and function execution.
Starting the MCP Server
To start the server with MCP support:
You should see output indicating both FastAPI and MCP server initialization:
MCP Tools
The server exposes several MCP tools for molecular verification:
-
Query Validation
Tool:
validate_queryEndpoint:
POST /validate_query/{task}Description: Validates a query for a specific task type (molecular generation, property prediction, or molecular reaction).
Parameters:
query: MolecularVerifierServerQuery object or dictionarytask: Task type ("molecular_generation", "property_prediction", "molecular_reaction")
Returns: Validation result with is_valid flag, errors, and validated query.
-
Available RDKit Properties
Tool:
get_available_rdkit_propertiesEndpoint:
GET /get_available_rdkit_propertiesDescription: Returns a list of all available RDKit properties that can be evaluated.
Returns: List of property names (e.g., "QED", "logP", "SA", "CalcExactMolWt").
-
Available Docking Targets
Tool:
get_available_docking_targetsEndpoint:
GET /get_available_docking_targetsDescription: Returns available docking targets (receptors) for molecular generation.
Returns: Dictionary mapping target descriptions to target IDs.
-
Reward Calculation
Tool:
compute_rewardEndpoint:
POST /get_reward_mcpDescription: Computes reward scores for molecular generations based on specified properties and objectives.
Parameters:
query: MolecularVerifierServerQuery containing completions and metadata
Returns: BatchMolecularVerifierServerResponse with rewards and metadata.
-
Property Calculation
Tool:
get_propertiesEndpoint:
POST /get_propertiesDescription: Computes specific properties for given SMILES strings.
Parameters:
smiles: List of SMILES stringsproperties: List of property names to compute
Returns: Dictionary mapping SMILES to property values.
Troubleshooting
For optimal performance with the MCP server, ensure the following configuration:
- Batch Mode: The server should be configured to use batch processing mode for efficient handling of multiple requests.
- Low Buffer Time: Set a low buffer time to minimize latency in processing requests.
- Parsing Method: The parsing method must be set to
noneto ensure compatibility with the MCP protocol.
See Server Configuration for performance tuning options.