ASAM ODS Jaquel MCP Server - A Model Context Protocol server for creating and validating Jaquel queries
Project description
ASAM ODS Jaquel MCP Server
A Model Context Protocol (MCP) server for ASAM ODS with Jaquel query tools, ODS connection management, and bulk data access.
Overview
- 🔌 Built-in ODS connection management
- 🧰 29+ MCP tools: schema inspection, query validation, optimization, debugging, and direct ODS query execution
- 🏗️ Entity hierarchy visualization (AoTest → AoMeasurement)
- 🚀 Validate, build, and optimize Jaquel queries for ASAM ODS
- 📦 Bulk timeseries/submatrix data access and script generation
- 📊 Automatic Jupyter notebook generation for measurement comparison
- 📈 Matplotlib visualization code generation
- 📉 Statistical measurement comparison and correlation analysis
- 🔎 Measurement hierarchy exploration and discovery
- 💡 Interactive starting prompts for guided workflows
- 🤖 AI-guided bulk API learning with
get_bulk_api_helptool - 📝 Comprehensive examples, documentation, and test suite
Documentation
- Prompts Guide: See
PROMPTS.mdfor starting prompts documentation - Tool Reference: See
TOOLS_GUIDE.md - Setup: See
docs/setup.mdfor installation and configuration - Development:
- Run:
python -m odsbox_jaquel_mcp - Test:
python run_tests.pyorpytest tests/ - Sort imports:
python -m isort .(VS Code runs this automatically on save whensource.organizeImportsis enabled) - Lint:
black .andflake8 .
- Run:
Quick Start
Install Requirements
python -m venv .venv
.venv/bin/activate
pip install odsbox-jaquel-mcp[play]
Remark: [play] extra includes optional data analysis and visualization dependencies to allow using the virtual environment to work with the MCP server and do data analysis in Jupyter notebooks ans so on.
Running the Server
.venv/bin/activate
python -m odsbox_jaquel_mcp
Starts on stdin/stdout and waits for MCP messages (used with an MCP client).
Development
Clone
git clone https://github.com/totonga/odsbox-jaquel-mcp.git
cd odsbox-jaquel-mcp
Install Requirements
python -m venv .venv
.venv/bin/activate
pip install .
pip install -e ".[dev]"
Testing
Run tests:
python run_tests.py
# or
pytest tests/
Building the Package
python -m build
install whl package
pip install dist/odsbox_jaquel_mcp-0.1.0-py3-none-any.whl
MCP Inspector
Make sure npm and uv are installed, then run:
npx @modelcontextprotocol/inspector uvx odsbox-jaquel-mcp
Contributing
Pull requests and issues are welcome! Please:
- Follow PEP8 and use type hints
- Add/maintain tests for new features
- Update documentation as needed
License
This project is licensed under the Apache License 2.0. See LICENSE.
Links
Features
Core Validation Tools
Query Building & Validation
- validate_jaquel_query - Check query syntax and structure
- validate_filter_condition - Validate filter conditions
- build_filter_condition - Construct filter conditions
- explain_jaquel_query - Get plain English explanation
Pattern & Example Library
- get_query_pattern - Get template for common patterns
- list_query_patterns - List available patterns
- generate_query_skeleton - Generate query skeleton for entity
- get_operator_documentation - Learn about operators
Query Optimization
- suggest_optimizations - Get optimization suggestions
- merge_filter_conditions - Combine multiple conditions
Debugging Tools
- debug_query_steps - Break query into logical steps
- suggest_error_fixes - Get suggestions for errors
Schema Inspection (Requires Connection)
- check_entity_schema - Get all fields for entity
- validate_field_exists - Check if field exists
- validate_filter_against_schema - Validate against schema
- list_ods_entities - List all entities with relationships
- get_test_to_measurement_hierarchy - Get ASAM ODS test hierarchy structure
Connection Management (NEW)
- connect_ods_server - Establish ODS connection
- disconnect_ods_server - Close ODS connection
- get_ods_connection_info - Get connection status
- execute_ods_query - Execute query on ODS server
- get_submatrix_measurement_quantities - List measurement quantities for submatrix
- read_submatrix_data - Read timeseries data from submatrix
- generate_submatrix_fetcher_script - Generate Python scripts for data fetching
Starting Prompts
Discover and use the server's capabilities through interactive guided prompts:
- Validate a Jaquel Query - Learn query validation
- Explore Query Patterns - Find common query templates
- ODS Server Connection - Set up and manage connections
- Build Filter Conditions - Master WHERE clause construction
- Bulk Data Access - Master the 3-step Bulk API workflow
- Measurement Analysis - Compare measurements and visualize data
- Optimize & Debug - Improve query performance
See PROMPTS.md for complete details on all starting prompts.
Error Handling
Common Errors and Solutions
Not connected
{
"error": "Model not loaded",
"hint": "Connect to ODS server using 'connect_ods_server' tool first"
}
Solution: Call connect_ods_server first
Invalid entity
{
"error": "Entity not found: InvalidEntity",
"available_entities": ["AoUnit", "AoMeasurement", ...]
}
Solution: Use valid entity from available_entities
Invalid field
{
"valid": false,
"issues": ["Field 'invalid_field' not found"],
"suggestions": ["id", "name", "description"]
}
Solution: Use one of the suggested fields
Connection failed
{
"success": false,
"error": "Connection refused",
"error_type": "ConnectionError"
}
Solution: Check URL, server availability, firewall
Troubleshooting
Issue: Tools not discovered
- Ensure mcp>=0.1.0 is installed
- Check ToolsCapability is set in ServerCapabilities
- Restart MCP client
Issue: Schema tools fail
- Ensure ODS server is accessible
- Check username/password
- Verify network connectivity
- Review server logs
Issue: Queries timeout
- Increase request_timeout in connect
- Optimize query with suggest_optimizations
- Reduce $rowlimit
- Check ODS server performance
Performance Tips
- Use specific filters - Avoid querying all records
- Limit rows - Always use
$rowlimitappropriately - Select attributes - Only retrieve needed columns
- Index awareness - Filter on indexed fields first
- Connection reuse - Keep connection open when possible
- Cache schemas - Schema inspection is cached
Security Notes
- Credentials are only held in memory during connection
- Connection is cleaned up on disconnect
- No credentials stored in config files
- Use HTTPS with
verify_certificate: truefor production
Support
For issues or questions:
- Check the error message and hints
- Review the documentation and examples
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file odsbox_jaquel_mcp-0.3.4.tar.gz.
File metadata
- Download URL: odsbox_jaquel_mcp-0.3.4.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3868277e94e06aa6dcf94579c616393c84d59831ddf93bf5ba821185ae0c929d
|
|
| MD5 |
3c2dff7dfeb54b9b6cd629fe87bb4f41
|
|
| BLAKE2b-256 |
b8a5d84e0e92b24fb0d94aaaae2960ae0b3f9ac5a9716eeb2e3b7b7f02877a5f
|
Provenance
The following attestation bundles were made for odsbox_jaquel_mcp-0.3.4.tar.gz:
Publisher:
build.yml on totonga/odsbox-jaquel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odsbox_jaquel_mcp-0.3.4.tar.gz -
Subject digest:
3868277e94e06aa6dcf94579c616393c84d59831ddf93bf5ba821185ae0c929d - Sigstore transparency entry: 729851054
- Sigstore integration time:
-
Permalink:
totonga/odsbox-jaquel-mcp@7aa4d0cbbe54abdde211e65385b726124c6ffaeb -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/totonga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7aa4d0cbbe54abdde211e65385b726124c6ffaeb -
Trigger Event:
push
-
Statement type:
File details
Details for the file odsbox_jaquel_mcp-0.3.4-py3-none-any.whl.
File metadata
- Download URL: odsbox_jaquel_mcp-0.3.4-py3-none-any.whl
- Upload date:
- Size: 65.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5c496ba20790811fe812867dbb6c6a9d9b8d90d8b86565b7bb6193572a39e77
|
|
| MD5 |
23c41388428046f19cda0c72dc2f1ef8
|
|
| BLAKE2b-256 |
faf90ad7f658fee2645014b7da8c8bf8940800643a155b0b193030750c448923
|
Provenance
The following attestation bundles were made for odsbox_jaquel_mcp-0.3.4-py3-none-any.whl:
Publisher:
build.yml on totonga/odsbox-jaquel-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
odsbox_jaquel_mcp-0.3.4-py3-none-any.whl -
Subject digest:
a5c496ba20790811fe812867dbb6c6a9d9b8d90d8b86565b7bb6193572a39e77 - Sigstore transparency entry: 729851056
- Sigstore integration time:
-
Permalink:
totonga/odsbox-jaquel-mcp@7aa4d0cbbe54abdde211e65385b726124c6ffaeb -
Branch / Tag:
refs/tags/v0.3.4 - Owner: https://github.com/totonga
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build.yml@7aa4d0cbbe54abdde211e65385b726124c6ffaeb -
Trigger Event:
push
-
Statement type: