Skip to content

Commit cb2438f

Browse files
committed
feat: Add MCP analysis profiles and structured output format
- Add 5 analysis profiles: quick, standard, detailed, fingerprint, mastering - Implement structured response with categorized audio/content/quality/fingerprint info - Add hierarchical insights categorized by severity (critical/warnings/info/suggestions) - Enhance audio comparison with multi-dimensional similarity scoring - Add progress tracking with completed/pending module status - Update documentation and examples with new MCP features
1 parent ac20ec4 commit cb2438f

4 files changed

Lines changed: 418 additions & 18 deletions

File tree

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,39 @@ ferrous-waves serve
9494

9595
The server exposes three tools:
9696

97-
#### `analyze_audio` - Comprehensive audio analysis with filtering and pagination
97+
#### `analyze_audio` - Analyze audio files with configurable depth
9898
Parameters:
9999
- `file_path` (required): Path to audio file
100+
- `analysis_profile`: Choose analysis depth (default: "standard")
101+
- `"quick"`: Basic metrics only (fastest)
102+
- `"standard"`: Core audio features
103+
- `"detailed"`: All analysis modules
104+
- `"fingerprint"`: Focus on similarity detection
105+
- `"mastering"`: Focus on loudness and quality metrics
100106
- `return_format`: "summary" (default), "full", or "visual_only"
101107
- `include_visuals`: Include base64-encoded images (default: false, WARNING: very large)
102108
- `include_spectral`: Include spectral data arrays (default: false)
103109
- `include_temporal`: Include temporal data arrays (default: false)
104110
- `max_data_points`: Limit array sizes for pagination (default: 1000)
105111
- `cursor`: Continue from previous response's next_cursor
106112

107-
#### `compare_audio` - Compare two audio files with fingerprint similarity
113+
Response format includes:
114+
- Audio properties (format, duration, sample rate, channels)
115+
- Content type and confidence scores
116+
- Quality metrics (loudness LUFS, true peak, dynamic range)
117+
- Issues categorized by severity (critical, warnings, info)
118+
- Fingerprint data for similarity matching
119+
120+
#### `compare_audio` - Compare two audio files
108121
Parameters:
109122
- `file_a`, `file_b` (required): Paths to audio files
110123
- `metrics`: Optional comparison metrics to calculate
111124

112-
Returns fingerprint similarity score (0.0-1.0) and match type (Identical, Similar, Different, etc.)
125+
Returns:
126+
- Similarity scores: overall, fingerprint, spectral, perceptual, structural (0.0-1.0 scale)
127+
- Differences: loudness delta, tempo delta, quality delta, key change
128+
- Match type: Identical, Very Similar, Similar, Different
129+
- Use case suggestions: "Same recording", "Different master", "Cover version", etc.
113130

114131
#### `get_job_status` - Check analysis job status
115132
Parameters:

examples/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,12 @@ The `envelope_visualization` example creates a PNG image showing waveform with p
5353

5454
## MCP Server
5555

56-
The `mcp_client.rs` example shows the JSON format for MCP tool calls. To use the actual MCP server:
56+
The `mcp_client.rs` example shows the JSON format for MCP tool calls, including:
57+
- Different analysis profiles (quick, standard, detailed, fingerprint, mastering)
58+
- Pagination with cursors
59+
- Comparison with similarity scoring
60+
61+
To use the actual MCP server:
5762

5863
```bash
5964
# Start the MCP server

examples/mcp_client.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,33 +7,47 @@ fn main() {
77
println!("Example MCP Tool Calls:");
88
println!();
99

10-
// Example 1: Analyze with default settings (returns compact summary)
11-
let analyze_summary = json!({
10+
// Example 1: Analyze with different profiles
11+
let analyze_quick = json!({
1212
"tool": "analyze_audio",
1313
"arguments": {
14-
"file_path": "/path/to/audio.wav"
14+
"file_path": "/path/to/audio.wav",
15+
"analysis_profile": "quick" // Fast analysis
16+
}
17+
});
18+
println!("1. Analyze Audio (Quick Profile):");
19+
println!("{}", serde_json::to_string_pretty(&analyze_quick).unwrap());
20+
println!();
21+
22+
// Example 1b: Mastering profile for quality focus
23+
let analyze_mastering = json!({
24+
"tool": "analyze_audio",
25+
"arguments": {
26+
"file_path": "/path/to/audio.wav",
27+
"analysis_profile": "mastering" // Focus on loudness and quality
1528
}
1629
});
17-
println!("1. Analyze Audio (Summary - Default):");
30+
println!("1b. Analyze Audio (Mastering Profile):");
1831
println!(
1932
"{}",
20-
serde_json::to_string_pretty(&analyze_summary).unwrap()
33+
serde_json::to_string_pretty(&analyze_mastering).unwrap()
2134
);
2235
println!();
2336

24-
// Example 2: Analyze with spectral data and pagination
37+
// Example 2: Analyze with detailed profile for complete analysis
2538
let analyze_detailed = json!({
2639
"tool": "analyze_audio",
2740
"arguments": {
2841
"file_path": "/path/to/audio.wav",
42+
"analysis_profile": "detailed", // All modules
2943
"return_format": "full",
3044
"include_spectral": true,
3145
"include_temporal": true,
3246
"max_data_points": 100,
3347
"cursor": null
3448
}
3549
});
36-
println!("2. Analyze Audio (Full with Pagination):");
50+
println!("2. Analyze Audio (Detailed Profile with Full Data):");
3751
println!(
3852
"{}",
3953
serde_json::to_string_pretty(&analyze_detailed).unwrap()

0 commit comments

Comments
 (0)