feat: add VibrationAgent MCP server for vibration analysis benchmarks#190
feat: add VibrationAgent MCP server for vibration analysis benchmarks#190LGDiMaggio wants to merge 2 commits intoIBM:mainfrom
Conversation
Add a new VibrationAgent MCP server that provides 8 tools for industrial vibration diagnostics: - get_vibration_data / list_vibration_sensors (CouchDB integration) - compute_fft_spectrum / compute_envelope_spectrum (DSP analysis) - assess_vibration_severity (ISO 10816 classification) - calculate_bearing_frequencies / list_known_bearings (bearing analysis) - diagnose_vibration (full automated diagnostic pipeline) DSP core adapted from vibration-analysis-mcp (Apache-2.0): https://github.com/LGDiMaggio/claude-stwinbox-diagnostics/tree/main/mcp-servers/vibration-analysis-mcp Also includes: - 20 benchmark scenarios (vibration_utterance.json, IDs 301-320) - Registration in workflow executor (DEFAULT_SERVER_PATHS) - scipy>=1.10.0 dependency and vibration-mcp-server entry point - 26 unit tests (DSP) + 17 MCP tool tests - Full documentation in INSTRUCTIONS.md Ref IBM#178 -- ready for review and testing Signed-off-by: Luigi Di Maggio <luigi.dimaggio@polito.it>
|
@LGDiMaggio I've seen the same issue with Pydantic in #187. That PR downgrades to @ShuxinLin given this is a repo wide issue do you want a separate PR to fix versioning between python and pydantic versions (for visiblity) or are you happy with any of the incoming PRs to fix that? |
|
Thanks for the heads-up on #187 — good to know the 3.12 downgrade fixes it. Happy to align this PR with whatever versioning approach you settle on. Just let me know if any changes are needed on my side. |
|
I downgraded the py version in this commit 8ef012c. It should be in main branch, no? |
|
Yes, 8ef012c is already in main — this PR branch is based on top of it. I also just verified: after installing Python 3.12 via I'll push a small follow-up commit shortly to fix a minor test helper compatibility issue with fastmcp 2.14.5's |
- conftest.py: handle both tuple and direct return from FastMCP.call_tool() - test_tools.py: fix bearing name assertion (includes description suffix) - test_tools.py: fix key name 'bearing' (was 'bearing_name') in to_dict() All 42 unit tests pass on Python 3.12; 2 integration tests skipped (no CouchDB). Signed-off-by: Luigi Di Maggio <luigi.dimaggio@polito.it>
|
@LGDiMaggio, we will review this PR progressively. |
| "id": 306, | ||
| "type": "Vibration", | ||
| "text": "What is the vibration severity classification for a machine with an RMS velocity of 4.5 mm/s? It is a medium-sized machine on rigid foundations.", | ||
| "category": "ISO Assessment", |
There was a problem hiding this comment.
ISO might be too specific. How about Condition Assessment?
| { | ||
| "id": 308, | ||
| "type": "Vibration", | ||
| "text": "Fetch vibration sensor data from Chiller 6, sensor Current, starting from 2020-06-01.", |
There was a problem hiding this comment.
It could be a little bit fuzzy for the ending time. If the vibration is measured at high frequency, say every couple of seconds, the data volume could be too large. It is better to have the ending time.
| { | ||
| "id": 311, | ||
| "type": "Vibration", | ||
| "text": "Generate the FFT spectrum using a Blackman window for the loaded signal.", |
There was a problem hiding this comment.
This is a little bit fuzzy. We need to know which signal for the loaded dataset, for example the signal sensor name or ID. Maybe need to specific the return should be the peak frequencies (say top 1, 2, ...,).
| { | ||
| "id": 312, | ||
| "type": "Vibration", | ||
| "text": "Perform envelope analysis on the vibration signal to look for bearing defect frequencies.", |
There was a problem hiding this comment.
Again, this is a little bit fuzzy, the implemented system might not know that there is a need for a bandpass filter (or it might be with a certain prompt examples). Ideally, we can be more specific:
- Add the signal ID:
- Specify the bandpass filter.
- Using certiain algorithm for the envelope.
The current utterance could work, but it increases the opportunities of hulliciation.
There was a problem hiding this comment.
The current implementation is based on the scipy package. An alternative is to use existing packages for FFT, time series analysis, and other package. That could help to expand the availability of the analytic functions and focus on the scenario development.
nianjunz
left a comment
There was a problem hiding this comment.
I made some initial comments on the fork - feat: add VibrationAgent MCP server for vibration analysis benchmarks
#190.
The work is great. It gives an opportunity to integrate a new application of asset management using the vibration signals. It might be that the AssetOpsBench is closer to the real engineering practice.
The main comments are: 1. Should we use the existing package to implement the MCP tools; 2. The utterances in general are a little bit fuzzy; 3. The utterances mainly focus on the knowledge extraction; we do not have utterances in prediction, diagnotic and decision support.
Summary
This PR adds a VibrationAgent MCP server to AssetOpsBench, introducing industrial vibration diagnostics capabilities as described in Issue #178.
What's included
src/servers/vibration/main.pysrc/servers/vibration/dsp/data_store.py,couchdb_client.pysrc/servers/vibration/tests/vibration_utterance.jsonpyproject.toml,executor.py,INSTRUCTIONS.mdTools provided
get_vibration_datalist_vibration_sensorscompute_fft_spectrumcompute_envelope_spectrumassess_vibration_severitycalculate_bearing_frequencieslist_known_bearingsdiagnose_vibrationOrigin
DSP core adapted from vibration-analysis-mcp (Apache-2.0), with reliability fixes (kurtosis standardisation, velocity vectorisation, ddof consistency).
Testing
uv run pytest src/servers/vibration/tests/test_dsp.py -v)test_tools.py): blocked by Pydantic 2.12.5 + Python 3.14 incompatibility (repo-wide issue affecting all servers, not specific to this PR)Notes
Ref #178