Provides quantum ML capabilities including circuit execution, kernel computation, VQC training, and model evaluation via MCP.
Configuration
View docs{
"mcpServers": {
"des137-qml-mcp": {
"command": "python",
"args": [
"server.py"
],
"env": {
"QML_MCP_LOG_LEVEL": "INFO",
"QML_MCP_QUANTUM_MAX_SHOTS": "100000",
"QML_MCP_QUANTUM_MAX_QUBITS": "10",
"QML_MCP_QUANTUM_DEFAULT_SHOTS": "1024",
"QML_MCP_ENABLE_DETAILED_ERRORS": "true"
}
}
}
}You deploy and run the QML-MCP server to execute quantum circuits, compute quantum kernels, and train quantum machine learning models. This MCP server lets you perform quantum ML tasks with configurable safety limits and structured logging, all accessible through a standard MCP client workflow.
You interact with the server through an MCP client to run quantum circuits, compute kernels, train a variational quantum classifier, and evaluate models. Use the available tools to perform practical ML tasks such as executing a circuit to obtain measurement results, building a quantum kernel matrix for ML pipelines, training a VQC on labeled data, and evaluating a trained model on test data. You can rely on the serverβs safety limits and detailed error messages to diagnose issues and ensure proper usage.
Key workflows you can perform include: running a quantum circuit to obtain measurement results for a given circuit and shot count, computing a quantum kernel matrix for training and testing data, training a Variational Quantum Classifier with your dataset, and evaluating the final model on a test set. Each workflow returns results or a trained model that you can persist and reuse in subsequent experiments.
Prerequisites: ensure you have Python 3.10 or newer and a compatible package manager. You will install the package in editable mode and can also install development dependencies if needed.
pip install -e .For development work, install with development extras to include testing and tooling.
pip install -e ".[dev]"Configure runtime behavior using environment variables. You can set maximums for shots and qubits, default shots, logging level, and error trace inclusion to tailor performance and diagnostics to your needs.
Key environment variables you may configure include: QML_MCP_QUANTUM_MAX_SHOTS, QML_MCP_QUANTUM_MAX_QUBITS, QML_MCP_QUANTUM_DEFAULT_SHOTS, QML_MCP_LOG_LEVEL, and QML_MCP_ENABLE_DETAILED_ERRORS. Use sensible values to balance accuracy, speed, and safety.
Start the server by launching the Python script that serves MCP requests.
python server.pyThe server enforces configurable safety limits to prevent resource overuse. You can cap the number of qubits per circuit and the maximum number of shots per run. All inputs are validated and error messages include tracebacks when detailed reporting is enabled.
This server depends on Python >= 3.10 and a compatible set of MCP and Qiskit components. Ensure your environment satisfies these requirements before running the server.
You can run the test suite to validate behavior and ensure that components such as configuration validation and ML utility functions operate correctly.
Execute a quantum circuit and obtain measurement results with configurable shots.
Compute a quantum kernel matrix using a specified feature map for ML tasks.
Train a Variational Quantum Classifier on labeled data and return a trained model.
Evaluate a trained quantum ML model on test data and provide performance metrics.