TensorBoard Event Query MCP Server
Query and analyze TensorBoard event files with an MCP server to explore logs, scalars, and metrics for faster model debugging and visualization.
Overview
TensorBoard Event Query MCP Server exposes TensorBoard event files through a simple, programmatic Model Context Protocol (MCP) server. Instead of parsing event files ad-hoc in scripts or opening a full TensorBoard instance, this server indexes event files and exposes structured endpoints for runs, tags, scalars, histograms and raw events. It makes it easier to query metrics, fetch time/step-series, and integrate event data into custom dashboards, CI checks, or lightweight analysis tools.
This approach is useful when you need repeatable, automatable access to training logs across many experiments or machines. The MCP server is optimized for quick lookups and streaming access to logged values so you can debug models faster, compare runs programmatically, and build bespoke visualizations without the overhead of launching the full TensorBoard web UI.
Features
- Index TensorBoard event files (.tfevents) and discover runs automatically
- Query scalar series by run and tag (time/step/value)
- List runs and available tags (scalars, histograms, images, text)
- Retrieve raw event payloads for debugging or custom processing
- Lightweight MCP-compatible HTTP API suitable for programmatic access
- Optional file-watch mode to auto-update indices when event files change
- CLI for quickly launching a local server; Docker-friendly
Installation / Configuration
Clone and run the server locally:
# Clone the repository
# (Optional) Create virtualenv
# Install dependencies
# Start the MCP server pointing to a directory with event files
Typical CLI flags:
--logdir /path/to/event/files # directory containing TensorBoard event files
--host 127.0.0.1 # bind address
--port 8080 # HTTP port
--watch # enable file system watch to reload on changes
--cache-size N # optional cache size for indexed data
Run with Docker:
Adjust configurations in your orchestration or systemd unit if running in production.
Available Resources
- GitHub repository: https://github.com/Alir3z4/tb-query
- Source code: explore server, parser, and CLI modules in the repo
- Example dataset: use any directory of TensorBoard event files generated by TensorFlow / PyTorch (when using tensorboardX)
- API docs: the repo contains example HTTP endpoints and request/response shapes (see doc/ or example clients directory)
Suggested local endpoints (examples):
| Endpoint | Purpose | ||||
|---|---|---|---|---|---|
| GET /mcp/v1/runs | List discovered runs (names, paths, metadata) | ||||
GET /mcp/v1/tags?run=| List tags available for a run | GET /mcp/v1/scalars?run= | Fetch scalar time-series for a run/tag | GET /mcp/v1/events?run= | Stream or fetch raw events for a run | Note: exact path versions and parameters are documented in the repo; use these as representative examples. Use Cases
Best Practices
For full API reference, examples and advanced configuration options, see the GitHub repository: https://github.com/Alir3z4/tb-query. |