How ndaelman-hu/parse-patrol works
Project type and purpose
• This is a Python-based tooling framework (“parse-patrol”) for Materials Science/Chemistry that exposes multiple parsing tools as MCP (Model Context Protocol) JSON-RPC servers.
• It provides a unified “entrypoint” MCP server (src/parse_patrol/__main__.py) which dynamically loads or proxies to individual parser servers (cclib, custom_gaussian, nomad, iodata_parser, etc.).
• Intended for IDE-integrated LLM agents (e.g., VS Code Copilot “Agent” mode) to invoke slash-commands, run parsing pipelines, and inspect results.
File structure
• Top-level directories:
• src/ : Python packages
– parse_patrol/ → central MCP server aggregator
– cclib/, custom_gaussian/, iodata_parser/, nomad/ → each its own MCP server entrypoint
• .vscode/ : IDE configuration, mcp.json template listing all servers
• .pipelines/ : example agent-generated scripts + test data
• .resources/ : schema docs (semantic & structure definitions)
• .data/ : real or downloaded data to parse (e.g., NOMAD downloads)
• tests/ : reference files for automated parser tests
• assets/ : images/videos (demo, documentation)
• Key config files:
• pyproject.toml & uv.lock → Python dependencies & virtual-env management via uv
• .vscode/mcp.json → registers each MCP server under a unique command
README for additional insights
• Describes:
• Supported servers (cclib, custom_gaussian; planned: openbabel, nomad-lab)
• Development & testing workflow (uv sync, uv run, MCP inspector)
• How to register new parsers (add server under src/parsers and wire into parse_patrol)
• Emphasizes:
• Microservice-style pattern: one MCP server per parser tool
• A unified interface for agents via the central parse_patrol server
a. Main components
1. IDE/Agent Client
• VS Code w/ Copilot “Agent” mode
• MCP inspector (browser UI)
2. MCP Server Layer
• Central aggregator (parse_patrol)
• Individual parser servers: cclib, custom_gaussian, nomad, iodata_parser
3. Data & Resources
• .data/ (downloaded data files)
• .pipelines/data/ (test inputs for pipelines)
• .resources/ (schema docs)
4. Pipelines & Tests
• .pipelines/scripts/ (agent-generated pipelines)
• tests/ (automated parser tests)
5. Dependency Manager
• uv tool / Python venv (pyproject.toml, uv.lock)
b. Relationships & interactions
• IDE/Agent → sends JSON-RPC requests over MCP protocol → central aggregator
• Aggregator → routes requests to appropriate parser server → runs parsing logic
• Parser server → reads input files from .data/ or .pipelines/data/ → returns parsed output
• Agent pipelines (.pipelines/scripts) may orchestrate multiple servers in sequence
• Tests → directly invoke servers (via uv run mcp dev) for CI
c. Architectural patterns & principles
• Microservice/plugin pattern: each parser is an independent MCP server
• Unified façade: parse_patrol acts as API gateway for all parsers
• JSON-RPC transport: decouples client (IDE/Agent) from Python implementation
• Modular resources: separate schema documentation and test data
d. Key technologies/frameworks
• Python (packages under src/)
• Model Context Protocol (MCP) / JSON-RPC
• uv (development tool for dependency sync & script execution)
• VS Code MCP extension for server management