MCP App: Progressive tool discovery and inline image output for anomaly plots#16
Open
MatthewKhouzam wants to merge 7 commits intoeclipse-tmll:mainfrom
Open
MCP App: Progressive tool discovery and inline image output for anomaly plots#16MatthewKhouzam wants to merge 7 commits intoeclipse-tmll:mainfrom
MatthewKhouzam wants to merge 7 commits intoeclipse-tmll:mainfrom
Conversation
Implement tmll_cli.py with commands for experiment management and ML analysis: - Experiment operations: create, list, delete, list-outputs, fetch-data - Anomaly detection: anomaly, memory-leak - Performance analysis: changepoint, correlation - Resource optimization: idle-resources, capacity planning - Clustering analysis Note: this code was created with the assistance of claude sonnet 4.5 Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Add the following MCP
mcp.json
{
"mcpServers": {
"tmll": {
"command": "/usr/bin/python3",
"args": "path-to/tmll/mcp_server_cli.py"],
"env": {
"PYTHONPATH": "path-to/tmll"
}
}
}
}
This code creation was assisted by claude-sonnet-4.5
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
- Fix experiment.UUID -> experiment.uuid - Add None check for experiment in create_experiment - Fix MemoryLeakDetection: remove outputs param, use analyze_memory_leaks() - Fix ChangePointAnalysis: method -> methods (list of analysis modes) - Fix CorrelationAnalysis: analyze_correlation -> analyze_correlations, plot_correlation -> plot_correlation_matrix - Fix IdleResourceDetection: single threshold -> per-resource thresholds - Fix CapacityPlanning: plan_capacity -> forecast_capacity(forecast_steps=) - Remove clustering command (module not meaningful) - Fix help text: 'UUID or name' -> 'UUID' - Handle nested dict data in fetch_data_cmd - Move scripts to tmll/mcp package - Fix MCP server CLI_PATH to use Path(__file__) for reliable resolution - Make MCP call_tool arguments Optional[dict] with None guard - Add mcp==1.27.0 to requirements.txt
When the trace server returns a non-200 status for both datatree and timegraph tree endpoints, response.model is None. Accessing .model on None caused an AttributeError, failing CI tests.
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Allow less context usage Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
Signed-off-by: Matthew Khouzam <matthew.khouzam@ericsson.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
This PR reworks the MCP server in two commits to improve context
efficiency and enable richer AI output.
Progressive MCP tool discovery (99b7fcb)
Migrates from the low-level Server API (with manual list_tools/call_tool
dispatching) to FastMCP with decorated @mcp.tool() functions. This
eliminates the monolithic tool schema that was sent upfront in every
conversation, replacing it with progressive discovery where the AI only
loads tool definitions as needed.
less code to maintain and less context consumed per MCP session
in a giant if/elif chain
properly
MCP App with image output (ff6b48a)
Adds plot_xy_with_anomalies — a new tool that returns ImageContent
directly in the MCP response, allowing the AI to embed annotated anomaly-
detection charts inline in its output rather than just returning text
summaries.
and outlier points marked
a text summary
server if not running
data via a new _add_dataframe helper
prevent stray prints from corrupting the MCP stdio transport
Context savings: The old server shipped all 11 tool schemas in a single
list_tools response on every connection. With FastMCP's progressive
discovery, the client only resolves schemas for tools it actually invokes,
reducing per-session context overhead — particularly valuable when the AI
has a limited context window and every token counts.
How to test
Load in an AI ide and ask to plot an XY graph
tc-mcp-app.mp4
Follow-ups
Review checklist