validate_quantum_method_by_staticLABSCO SUMMARY
The reference build is the real setup cost.
Installing takes minutes; generating the per-version documentation the validator checks against is a separate step that runs an LLM over the parsed source and, by the project's own estimate, costs a couple of dollars per PennyLane version you want covered. Decide up front which versions you need — that choice is what determines whether validation can answer at all.
What it is
A Python MCP server that statically checks quantum computing code. It parses with the standard library's AST module, compiles the file, and compares every quantum library method call against documentation for a specific library version, so version-specific mistakes surface before you run anything.
What you get
validate_quantum_method_by_static— takes the code and optionally a version, and reports whether the methods used exist in that releaserequest_quantum_method_reference— returns documentation for a named method at a chosen version, so the model can correct itself- Version-specific validation across PennyLane v0.35.0 through v0.41.1
- A three-step check: syntax, compilation, then documented method usage
- An architecture the project intends to extend to other quantum libraries
Requirements
A virtual environment and uv, then uv sync in the cloned repo and uv run src/server.py. Before it is useful you must build the reference documents yourself, in two steps: parse the installed PennyLane source into JSON per version, then format that into documents with an LLM — that second step needs OPENAI_API_KEY and the project puts the cost at approximately $2.50 per version. Your client config launches it with uv from the project directory over stdio. MIT licensed.
Setup effort
Build from source — clone the repository, then follow the project's own run instructions
USE CASES
Catching a method that does not exist in your PennyLane version
Run the generated circuit code through static validation against the version you have installed.
Finding the right call for the release you are on
Ask for the reference on a specific method at a specific version and rewrite the code against what is documented.
Checking code before it reaches a queue
Validate syntax, compilation and API usage locally rather than discovering the problem after submission.
2 tools
Listed in project docs. Your client may show a different list.
request_quantum_method_referenceBEFORE YOU INSTALL
What to know first
Tools you get
2 tools named in the project's documentation.
Requires
- uv on PATH
- OPENAI_API_KEY in your environment
Where it runs
The documented client runs the server on your machine.
INSTALLATION
Connect your client
Server setup
uv --directory /your/mcp/server/directory/quantum-code-validator run server.py --transport stdioMCP Clients
Claude Desktop
{
"mcpServers": {
"quantum-code-validator": {
"command": "uv",
"args": [
"--directory",
"/your/mcp/server/directory/quantum-code-validator",
"run",
"server.py",
"--transport",
"stdio"
]
}
}
}The configuration on this page does not set OPENAI_API_KEY; the project's instructions put it in a .env file. Check which folder the server reads that file from before you rely on it.