Trackio logo

Trackio

Community
fcakyon

MCP (Model Context Protocol) server support for trackio experiment tracking

Publisherfcakyon
Repositorytrackio-mcp
LanguagePython
Forks
2
Stars
3
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Trackio exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    3 stars and 2 forks from the linked repository.

trackio-mcp

PyPI version License: MIT CI

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 before trackio
  • 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

bash
pip install trackio-mcp

Or with development dependencies:

bash
pip install trackio-mcp[dev]

Quick Start

Basic Usage

Simply import trackio_mcp before importing trackio:

python
import trackio_mcp  # This enables MCP server functionality
import trackio as wandb

# Your existing trackio code works unchanged
wandb.init(project="my-experiment")
wandb.log({"loss": 0.1, "accuracy": 0.95})
wandb.finish()

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

python
import trackio_mcp
import trackio as wandb

# Deploy to Spaces with MCP enabled automatically
wandb.init(
    project="my-experiment", 
    space_id="username/my-trackio-space"
)

wandb.log({"loss": 0.1})
wandb.finish()

Standalone MCP Server

Launch a dedicated MCP server for trackio tools:

python
from trackio_mcp.tools import launch_trackio_mcp_server

# Launch standalone MCP server on port 7861
launch_trackio_mcp_server(port=7861, share=False)

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

Human: "Show me the latest results from my 'image-classification' project"

Agent: I'll check your trackio projects and get the latest results.

[Tool: get_projects] → finds "image-classification" project
[Tool: get_runs] → gets runs for "image-classification" 
[Tool: get_run_metrics] → gets metrics for latest run
[Tool: get_available_metrics] → gets metric names

Agent: Your latest image-classification run achieved 94.2% accuracy with a final loss of 0.18. The model trained for 50 epochs with best validation accuracy of 94.7% at epoch 45.

MCP Client Configuration

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent:

Public Spaces:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-space.hf.space/gradio_api/mcp/sse"
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-private-space.hf.space/gradio_api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_HF_TOKEN"
      }
    }
  }
}

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "url": "http://localhost:7860/gradio_api/mcp/sse"
    }
  }
}

See Claude Code MCP docs for more info.

Public Spaces:

sh
claude mcp add --transport sse trackio https://your-space.hf.space/gradio_api/mcp/sse

Private Spaces/Datasets:

sh
claude mcp add --transport sse --header "Authorization: Bearer YOUR_HF_TOKEN" trackio https://your-private-space.hf.space/gradio_api/mcp/sse

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "type": "sse",
      "url": "http://localhost:7860/gradio_api/mcp/sse"
    }
  }
}

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:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-space.hf.space/gradio_api/mcp/sse"
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-private-space.hf.space/gradio_api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_HF_TOKEN"
      }
    }
  }
}

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "url": "http://localhost:7860/gradio_api/mcp/sse"
    }
  }
}

Add to your Windsurf MCP config file. See Windsurf MCP docs for more info.

Public Spaces:

json
{
  "mcpServers": {
    "trackio": {
      "serverUrl": "https://your-space.hf.space/gradio_api/mcp/sse"
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcpServers": {
    "trackio": {
      "serverUrl": "https://your-private-space.hf.space/gradio_api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_HF_TOKEN"
      }
    }
  }
}

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "serverUrl": "http://localhost:7860/gradio_api/mcp/sse"
    }
  }
}

Add to .vscode/mcp.json. See VS Code MCP docs for more info.

Public Spaces:

json
{
  "mcp": {
    "servers": {
      "trackio": {
        "type": "http",
        "url": "https://your-space.hf.space/gradio_api/mcp/sse"
      }
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcp": {
    "servers": {
      "trackio": {
        "type": "http", 
        "url": "https://your-private-space.hf.space/gradio_api/mcp/sse",
        "headers": {
          "Authorization": "Bearer YOUR_HF_TOKEN"
        }
      }
    }
  }
}

Local Development:

json
{
  "mcp": {
    "servers": {
      "trackio": {
        "type": "http",
        "url": "http://localhost:7860/gradio_api/mcp/sse"
      }
    }
  }
}

Add to mcp.json in your project directory. See Gemini CLI Configuration for details.

Public Spaces:

json
{
  "mcpServers": {
    "trackio": {
      "command": "npx",
      "args": ["mcp-remote", "https://your-space.hf.space/gradio_api/mcp/sse"]
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcpServers": {
    "trackio": {
      "command": "npx", 
      "args": ["mcp-remote", "https://your-private-space.hf.space/gradio_api/mcp/sse"],
      "env": {
        "HF_TOKEN": "YOUR_HF_TOKEN"
      }
    }
  }
}

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "command": "npx",
      "args": ["mcp-remote", "http://localhost:7860/gradio_api/mcp/sse"]
    }
  }
}

Create .cursor/mcp.json (or equivalent for your IDE):

Public Spaces:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-space.hf.space/gradio_api/mcp/sse"
    }
  }
}

Private Spaces/Datasets:

json
{
  "mcpServers": {
    "trackio": {
      "url": "https://your-private-space.hf.space/gradio_api/mcp/sse",
      "headers": {
        "Authorization": "Bearer YOUR_HF_TOKEN"
      }
    }
  }
}

Local Development:

json
{
  "mcpServers": {
    "trackio": {
      "url": "http://localhost:7860/gradio_api/mcp/sse"
    }
  }
}

Configuration

Environment Variables

  • TRACKIO_DISABLE_MCP: Set to "true" to disable MCP functionality (default: MCP enabled)

Programmatic Control

python
import os
os.environ["TRACKIO_DISABLE_MCP"] = "true"  # Disable MCP
import trackio_mcp  # MCP won't be enabled
import trackio

How It Works

trackio-mcp uses monkey-patching to automatically:

  1. Enable MCP server: Sets mcp_server=True on all Gradio launches
  2. Enable API: Sets show_api=True to expose Gradio API endpoints
  3. Add tools: Registers additional trackio-specific MCP tools
  4. Preserve compatibility: No changes needed to existing trackio code

The package patches:

  • gradio.Blocks.launch() - Core Gradio launch method
  • trackio.ui.demo.launch() - Trackio dashboard launches
  • Adds new MCP endpoints at /gradio_api/mcp/sse

Deployment Examples

Local Development

python
import trackio_mcp
import trackio

# Start local tracking with MCP enabled
trackio.show()  # Dashboard + MCP server at http://localhost:7860

Public Spaces Deployment

python
import trackio_mcp
import trackio as wandb

# Deploy to public Spaces with MCP support
wandb.init(
    project="public-model",
    space_id="username/model-tracking"
)

wandb.log({"epoch": 1, "loss": 0.5})
wandb.finish()

Private Spaces/Datasets Deployment

python
import trackio_mcp
import trackio as wandb

# Deploy to private Spaces with private dataset
wandb.init(
    project="private-model",
    space_id="organization/private-model-tracking",  # Private space
    dataset_id="organization/private-model-metrics"  # Private dataset
)

wandb.log({"epoch": 1, "loss": 0.5})
wandb.finish()

CLI Interface

bash
# Launch standalone MCP server
trackio-mcp server --port 7861

# Check status and configuration
trackio-mcp status

# Test MCP server functionality
trackio-mcp test --url http://localhost:7860

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

python
import trackio_mcp
import trackio

# Check if MCP was disabled
import os
print("MCP Disabled:", os.getenv("TRACKIO_DISABLE_MCP"))

# Manual verification
trackio.show()  # Look for MCP server URL in output

Connection Issues

  1. Check URL: Ensure correct /gradio_api/mcp/sse endpoint
  2. Authentication: Add Bearer token for private Spaces/datasets
  3. Network: Verify firewall/proxy settings
  4. Dependencies: Ensure gradio[mcp] is installed

Tool Discovery Issues

python
# Test tools manually
from trackio_mcp.tools import register_trackio_tools

tools = register_trackio_tools()
tools.launch(mcp_server=True)  # Test tools interface

Contributing

  1. Fork the repository
  2. Install development dependencies: pip install -e .[dev]
  3. Make your changes
  4. Run tests: pytest
  5. Submit a pull request

License

MIT License - see LICENSE file.

Acknowledgments


Made with care for the AI research community

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "trackio": {
      "command": "uvx",
      "args": [
        "trackio-mcp"
      ]
    }
  }
}

Use Trackio MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Trackio is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Trackio as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Trackio MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "trackio": {
      "command": "npx",
      "args": [
        "-y",
        "trackio-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Trackio MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Trackio MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Trackio to help me with this task?
Trackio
Sure. I read it.
Here is what I found using Trackio.

Frequently asked questions

What is the Trackio MCP server used for?

Trackio is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Trackio MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Trackio with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Trackio MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Trackio connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Trackio MCP to TypingMind?

Trackio runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Trackio MCP provide in TypingMind?

Trackio exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Trackio MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Trackio requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇