Leverages Gradio's built-in MCP server support to expose trackio functionality as tools for AI agents
Enables seamless deployment to Hugging Face Spaces, with support for both public and private spaces, and includes authentication for private datasets
trackio-mcp
MCP (Model Context Protocol) server support for trackio experiment tracking
This package enables AI agents to observe and interact with trackio experiments through the Model Context Protocol (MCP). Simply import trackio_mcp
before trackio
to automatically enable MCP server functionality.
Features
- Zero-code integration: Just import
trackio_mcp
beforetrackio
- Automatic MCP server: Enables MCP server on all trackio deployments (local & Spaces)
- Rich tool set: Exposes trackio functionality as MCP tools for AI agents
- Spaces compatible: Works seamlessly with Hugging Face Spaces deployments
- Drop-in replacement: No changes needed to existing trackio code
Installation
Or with development dependencies:
Quick Start
Basic Usage
Simply import trackio_mcp
before importing trackio
:
The MCP server will be automatically available at:
- Local:
http://localhost:7860/gradio_api/mcp/sse
- Spaces:
https://your-space.hf.space/gradio_api/mcp/sse
Deploy to Hugging Face Spaces with MCP
Standalone MCP Server
Launch a dedicated MCP server for trackio tools:
Available MCP Tools
Once connected, AI agents can use these trackio tools:
Core Tools (via Gradio API)
- log: Log metrics to a trackio run
- upload_db_to_space: Upload local database to a Space
Extended Tools (via trackio-mcp)
- get_projects: List all trackio projects
- get_runs: Get runs for a specific project
- filter_runs: Filter runs by name pattern
- get_run_metrics: Get metrics data for a specific run
- get_available_metrics: Get all available metric names for a project
- load_run_data: Load and process run data with optional smoothing
- get_project_summary: Get comprehensive project statistics
Example Agent Interaction
MCP Client Configuration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or equivalent:
Public Spaces:
Private Spaces/Datasets:
Local Development:
See Claude Code MCP docs for more info.
Public Spaces:
Private Spaces/Datasets:
Local Development:
Add to your Cursor ~/.cursor/mcp.json
file or create .cursor/mcp.json
in your project folder. See Cursor MCP docs for more info.
Public Spaces:
Private Spaces/Datasets:
Local Development:
Add to your Windsurf MCP config file. See Windsurf MCP docs for more info.
Public Spaces:
Private Spaces/Datasets:
Local Development:
Add to .vscode/mcp.json
. See VS Code MCP docs for more info.
Public Spaces:
Private Spaces/Datasets:
Local Development:
Add to mcp.json
in your project directory. See Gemini CLI Configuration for details.
Public Spaces:
Private Spaces/Datasets:
Local Development:
Create .cursor/mcp.json
(or equivalent for your IDE):
Public Spaces:
Private Spaces/Datasets:
Local Development:
Configuration
Environment Variables
TRACKIO_DISABLE_MCP
: Set to"true"
to disable MCP functionality (default: MCP enabled)
Programmatic Control
How It Works
trackio-mcp
uses monkey-patching to automatically:
- Enable MCP server: Sets
mcp_server=True
on all Gradio launches - Enable API: Sets
show_api=True
to expose Gradio API endpoints - Add tools: Registers additional trackio-specific MCP tools
- Preserve compatibility: No changes needed to existing trackio code
The package patches:
gradio.Blocks.launch()
- Core Gradio launch methodtrackio.ui.demo.launch()
- Trackio dashboard launches- Adds new MCP endpoints at
/gradio_api/mcp/sse
Deployment Examples
Local Development
Public Spaces Deployment
Private Spaces/Datasets Deployment
CLI Interface
Security Considerations
- Private Spaces: Use HF tokens for authentication with private spaces/datasets
- Access Control: MCP server inherits trackio's access controls
- Network Security: Consider firewall rules for production deployments
- Token Management: Store HF tokens securely, use environment variables
Troubleshooting
MCP Server Not Available
Connection Issues
- Check URL: Ensure correct
/gradio_api/mcp/sse
endpoint - Authentication: Add Bearer token for private Spaces/datasets
- Network: Verify firewall/proxy settings
- Dependencies: Ensure
gradio[mcp]
is installed
Tool Discovery Issues
Contributing
- Fork the repository
- Install development dependencies:
pip install -e .[dev]
- Make your changes
- Run tests:
pytest
- Submit a pull request
License
MIT License - see LICENSE file.
Acknowledgments
- trackio - The excellent experiment tracking library
- Gradio - For built-in MCP server support
- Model Context Protocol - For the standardized AI tool protocol
Made with care for the AI research community
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
An MCP server that enables AI agents to observe and interact with trackio experiment tracking, providing tools for managing ML experiments through natural language.
Related MCP Servers
- -securityFlicense-qualityAn OpenAI API-based MCP server that provides deep thinking and analysis capabilities, integrating with AI editor models to deliver comprehensive insights and practical solutions.Last updated -
- AsecurityAlicenseAqualityAn MCP server that enables AI tools to interact with ActiveCampaign API, allowing contact management and tracking event analysis through natural language queries.Last updated -5TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that provides AI with real-time screen monitoring capabilities and UI element intelligence, allowing AI to observe, analyze, and interact with screen content through features like smart clicking and text extraction.Last updated -43PythonMIT License
- AsecurityAlicenseAqualityA comprehensive MCP server providing tools for AI agents to interact with code, including reading symbols, importing modules, replacing text, and sending OS notifications.Last updated -374TypeScriptMIT License