trackio-mcp


Nametrackio-mcp JSON
Version 0.2.0 PyPI version JSON
download
home_pageNone
SummaryMCP (Model Context Protocol) server support for trackio experiment tracking
upload_time2025-08-03 13:37:47
maintainerNone
docs_urlNone
authorFatih Akyon
requires_python>=3.10
licenseNone
keywords ai agents mcp model context protocol experiment tracking gradio machine learning trackio
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # trackio-mcp

[![PyPI version](https://badge.fury.io/py/trackio-mcp.svg)](https://badge.fury.io/py/trackio-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![CI](https://github.com/fcakyon/trackio-mcp/workflows/CI%20with%20uv/badge.svg)](https://github.com/fcakyon/trackio-mcp/actions)

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

This package enables AI agents to observe and interact with [trackio](https://github.com/gradio-app/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

<details>
<summary><b>Claude Desktop</b></summary>

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"
    }
  }
}
```

</details>

<details>
<summary><b>Claude Code</b></summary>

See [Claude Code MCP docs](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp) 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"
    }
  }
}
```

</details>

<details>
<summary><b>Cursor</b></summary>

Add to your Cursor `~/.cursor/mcp.json` file or create `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) 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"
    }
  }
}
```

</details>

<details>
<summary><b>Windsurf</b></summary>

Add to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) 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"
    }
  }
}
```

</details>

<details>
<summary><b>VS Code</b></summary>

Add to `.vscode/mcp.json`. See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) 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"
      }
    }
  }
}
```

</details>

<details>
<summary><b>Gemini CLI</b></summary>

Add to `mcp.json` in your project directory. See [Gemini CLI Configuration](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md) 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"]
    }
  }
}
```

</details>

<details>
<summary><b>Cline</b></summary>

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"
    }
  }
}
```

</details>

## 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](LICENSE) file.

## Acknowledgments

- [trackio](https://github.com/gradio-app/trackio) - The excellent experiment tracking library
- [Gradio](https://gradio.app) - For built-in MCP server support
- [Model Context Protocol](https://modelcontextprotocol.io) - For the standardized AI tool protocol

---

**Made with care for the AI research community**
            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "trackio-mcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "AI agents, MCP, Model Context Protocol, experiment tracking, gradio, machine learning, trackio",
    "author": "Fatih Akyon",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/cf/14/bf27a169898618de554a346771cd67bbddf971f6f4b3b9cfeec76d9da7d4/trackio_mcp-0.2.0.tar.gz",
    "platform": null,
    "description": "# trackio-mcp\n\n[![PyPI version](https://badge.fury.io/py/trackio-mcp.svg)](https://badge.fury.io/py/trackio-mcp)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![CI](https://github.com/fcakyon/trackio-mcp/workflows/CI%20with%20uv/badge.svg)](https://github.com/fcakyon/trackio-mcp/actions)\n\n**MCP (Model Context Protocol) server support for trackio experiment tracking**\n\nThis package enables AI agents to observe and interact with [trackio](https://github.com/gradio-app/trackio) experiments through the Model Context Protocol (MCP). Simply import `trackio_mcp` before `trackio` to automatically enable MCP server functionality.\n\n## Features\n\n- **Zero-code integration**: Just import `trackio_mcp` before `trackio` \n- **Automatic MCP server**: Enables MCP server on all trackio deployments (local & Spaces)\n- **Rich tool set**: Exposes trackio functionality as MCP tools for AI agents\n- **Spaces compatible**: Works seamlessly with Hugging Face Spaces deployments\n- **Drop-in replacement**: No changes needed to existing trackio code\n\n## Installation\n\n```bash\npip install trackio-mcp\n```\n\nOr with development dependencies:\n\n```bash\npip install trackio-mcp[dev]\n```\n\n## Quick Start\n\n### Basic Usage\n\nSimply import `trackio_mcp` before importing `trackio`:\n\n```python\nimport trackio_mcp  # This enables MCP server functionality\nimport trackio as wandb\n\n# Your existing trackio code works unchanged\nwandb.init(project=\"my-experiment\")\nwandb.log({\"loss\": 0.1, \"accuracy\": 0.95})\nwandb.finish()\n```\n\nThe MCP server will be automatically available at:\n- **Local**: `http://localhost:7860/gradio_api/mcp/sse` \n- **Spaces**: `https://your-space.hf.space/gradio_api/mcp/sse`\n\n### Deploy to Hugging Face Spaces with MCP\n\n```python\nimport trackio_mcp\nimport trackio as wandb\n\n# Deploy to Spaces with MCP enabled automatically\nwandb.init(\n    project=\"my-experiment\", \n    space_id=\"username/my-trackio-space\"\n)\n\nwandb.log({\"loss\": 0.1})\nwandb.finish()\n```\n\n### Standalone MCP Server\n\nLaunch a dedicated MCP server for trackio tools:\n\n```python\nfrom trackio_mcp.tools import launch_trackio_mcp_server\n\n# Launch standalone MCP server on port 7861\nlaunch_trackio_mcp_server(port=7861, share=False)\n```\n\n## Available MCP Tools\n\nOnce connected, AI agents can use these trackio tools:\n\n### Core Tools (via Gradio API)\n- **log**: Log metrics to a trackio run\n- **upload_db_to_space**: Upload local database to a Space\n\n### Extended Tools (via trackio-mcp)\n- **get_projects**: List all trackio projects\n- **get_runs**: Get runs for a specific project  \n- **filter_runs**: Filter runs by name pattern\n- **get_run_metrics**: Get metrics data for a specific run\n- **get_available_metrics**: Get all available metric names for a project\n- **load_run_data**: Load and process run data with optional smoothing\n- **get_project_summary**: Get comprehensive project statistics\n\n### Example Agent Interaction\n\n```\nHuman: \"Show me the latest results from my 'image-classification' project\"\n\nAgent: I'll check your trackio projects and get the latest results.\n\n[Tool: get_projects] \u2192 finds \"image-classification\" project\n[Tool: get_runs] \u2192 gets runs for \"image-classification\" \n[Tool: get_run_metrics] \u2192 gets metrics for latest run\n[Tool: get_available_metrics] \u2192 gets metric names\n\nAgent: 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.\n```\n\n## MCP Client Configuration\n\n<details>\n<summary><b>Claude Desktop</b></summary>\n\nAdd to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or equivalent:\n\n**Public Spaces:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-space.hf.space/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-private-space.hf.space/gradio_api/mcp/sse\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_HF_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"http://localhost:7860/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Claude Code</b></summary>\n\nSee [Claude Code MCP docs](https://docs.anthropic.com/en/docs/agents-and-tools/claude-code/tutorials#set-up-model-context-protocol-mcp) for more info.\n\n**Public Spaces:**\n```sh\nclaude mcp add --transport sse trackio https://your-space.hf.space/gradio_api/mcp/sse\n```\n\n**Private Spaces/Datasets:**\n```sh\nclaude mcp add --transport sse --header \"Authorization: Bearer YOUR_HF_TOKEN\" trackio https://your-private-space.hf.space/gradio_api/mcp/sse\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"type\": \"sse\",\n      \"url\": \"http://localhost:7860/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Cursor</b></summary>\n\nAdd to your Cursor `~/.cursor/mcp.json` file or create `.cursor/mcp.json` in your project folder. See [Cursor MCP docs](https://docs.cursor.com/context/model-context-protocol) for more info.\n\n**Public Spaces:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-space.hf.space/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-private-space.hf.space/gradio_api/mcp/sse\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_HF_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"http://localhost:7860/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Windsurf</b></summary>\n\nAdd to your Windsurf MCP config file. See [Windsurf MCP docs](https://docs.windsurf.com/windsurf/mcp) for more info.\n\n**Public Spaces:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"serverUrl\": \"https://your-space.hf.space/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"serverUrl\": \"https://your-private-space.hf.space/gradio_api/mcp/sse\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_HF_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"serverUrl\": \"http://localhost:7860/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>VS Code</b></summary>\n\nAdd to `.vscode/mcp.json`. See [VS Code MCP docs](https://code.visualstudio.com/docs/copilot/chat/mcp-servers) for more info.\n\n**Public Spaces:**\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"trackio\": {\n        \"type\": \"http\",\n        \"url\": \"https://your-space.hf.space/gradio_api/mcp/sse\"\n      }\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"trackio\": {\n        \"type\": \"http\", \n        \"url\": \"https://your-private-space.hf.space/gradio_api/mcp/sse\",\n        \"headers\": {\n          \"Authorization\": \"Bearer YOUR_HF_TOKEN\"\n        }\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcp\": {\n    \"servers\": {\n      \"trackio\": {\n        \"type\": \"http\",\n        \"url\": \"http://localhost:7860/gradio_api/mcp/sse\"\n      }\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Gemini CLI</b></summary>\n\nAdd to `mcp.json` in your project directory. See [Gemini CLI Configuration](https://github.com/google-gemini/gemini-cli/blob/main/docs/cli/configuration.md) for details.\n\n**Public Spaces:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"command\": \"npx\",\n      \"args\": [\"mcp-remote\", \"https://your-space.hf.space/gradio_api/mcp/sse\"]\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"command\": \"npx\", \n      \"args\": [\"mcp-remote\", \"https://your-private-space.hf.space/gradio_api/mcp/sse\"],\n      \"env\": {\n        \"HF_TOKEN\": \"YOUR_HF_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"command\": \"npx\",\n      \"args\": [\"mcp-remote\", \"http://localhost:7860/gradio_api/mcp/sse\"]\n    }\n  }\n}\n```\n\n</details>\n\n<details>\n<summary><b>Cline</b></summary>\n\nCreate `.cursor/mcp.json` (or equivalent for your IDE):\n\n**Public Spaces:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-space.hf.space/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n**Private Spaces/Datasets:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"https://your-private-space.hf.space/gradio_api/mcp/sse\",\n      \"headers\": {\n        \"Authorization\": \"Bearer YOUR_HF_TOKEN\"\n      }\n    }\n  }\n}\n```\n\n**Local Development:**\n```json\n{\n  \"mcpServers\": {\n    \"trackio\": {\n      \"url\": \"http://localhost:7860/gradio_api/mcp/sse\"\n    }\n  }\n}\n```\n\n</details>\n\n## Configuration\n\n### Environment Variables\n\n- `TRACKIO_DISABLE_MCP`: Set to `\"true\"` to disable MCP functionality (default: MCP enabled)\n\n### Programmatic Control\n\n```python\nimport os\nos.environ[\"TRACKIO_DISABLE_MCP\"] = \"true\"  # Disable MCP\nimport trackio_mcp  # MCP won't be enabled\nimport trackio\n```\n\n## How It Works\n\n`trackio-mcp` uses monkey-patching to automatically:\n\n1. **Enable MCP server**: Sets `mcp_server=True` on all Gradio launches\n2. **Enable API**: Sets `show_api=True` to expose Gradio API endpoints  \n3. **Add tools**: Registers additional trackio-specific MCP tools\n4. **Preserve compatibility**: No changes needed to existing trackio code\n\nThe package patches:\n- `gradio.Blocks.launch()` - Core Gradio launch method\n- `trackio.ui.demo.launch()` - Trackio dashboard launches\n- Adds new MCP endpoints at `/gradio_api/mcp/sse`\n\n## Deployment Examples\n\n### Local Development\n\n```python\nimport trackio_mcp\nimport trackio\n\n# Start local tracking with MCP enabled\ntrackio.show()  # Dashboard + MCP server at http://localhost:7860\n```\n\n### Public Spaces Deployment\n\n```python\nimport trackio_mcp\nimport trackio as wandb\n\n# Deploy to public Spaces with MCP support\nwandb.init(\n    project=\"public-model\",\n    space_id=\"username/model-tracking\"\n)\n\nwandb.log({\"epoch\": 1, \"loss\": 0.5})\nwandb.finish()\n```\n\n### Private Spaces/Datasets Deployment\n\n```python\nimport trackio_mcp\nimport trackio as wandb\n\n# Deploy to private Spaces with private dataset\nwandb.init(\n    project=\"private-model\",\n    space_id=\"organization/private-model-tracking\",  # Private space\n    dataset_id=\"organization/private-model-metrics\"  # Private dataset\n)\n\nwandb.log({\"epoch\": 1, \"loss\": 0.5})\nwandb.finish()\n```\n\n## CLI Interface\n\n```bash\n# Launch standalone MCP server\ntrackio-mcp server --port 7861\n\n# Check status and configuration\ntrackio-mcp status\n\n# Test MCP server functionality\ntrackio-mcp test --url http://localhost:7860\n```\n\n## Security Considerations\n\n- **Private Spaces**: Use HF tokens for authentication with private spaces/datasets\n- **Access Control**: MCP server inherits trackio's access controls\n- **Network Security**: Consider firewall rules for production deployments\n- **Token Management**: Store HF tokens securely, use environment variables\n\n## Troubleshooting\n\n### MCP Server Not Available\n\n```python\nimport trackio_mcp\nimport trackio\n\n# Check if MCP was disabled\nimport os\nprint(\"MCP Disabled:\", os.getenv(\"TRACKIO_DISABLE_MCP\"))\n\n# Manual verification\ntrackio.show()  # Look for MCP server URL in output\n```\n\n### Connection Issues\n\n1. **Check URL**: Ensure correct `/gradio_api/mcp/sse` endpoint\n2. **Authentication**: Add Bearer token for private Spaces/datasets\n3. **Network**: Verify firewall/proxy settings\n4. **Dependencies**: Ensure `gradio[mcp]` is installed\n\n### Tool Discovery Issues\n\n```python\n# Test tools manually\nfrom trackio_mcp.tools import register_trackio_tools\n\ntools = register_trackio_tools()\ntools.launch(mcp_server=True)  # Test tools interface\n```\n\n## Contributing\n\n1. Fork the repository\n2. Install development dependencies: `pip install -e .[dev]`\n3. Make your changes\n4. Run tests: `pytest`\n5. Submit a pull request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file.\n\n## Acknowledgments\n\n- [trackio](https://github.com/gradio-app/trackio) - The excellent experiment tracking library\n- [Gradio](https://gradio.app) - For built-in MCP server support\n- [Model Context Protocol](https://modelcontextprotocol.io) - For the standardized AI tool protocol\n\n---\n\n**Made with care for the AI research community**",
    "bugtrack_url": null,
    "license": null,
    "summary": "MCP (Model Context Protocol) server support for trackio experiment tracking",
    "version": "0.2.0",
    "project_urls": {
        "documentation": "https://github.com/fcakyon/trackio-mcp#readme",
        "homepage": "https://github.com/fcakyon/trackio-mcp",
        "issues": "https://github.com/fcakyon/trackio-mcp/issues",
        "repository": "https://github.com/fcakyon/trackio-mcp"
    },
    "split_keywords": [
        "ai agents",
        " mcp",
        " model context protocol",
        " experiment tracking",
        " gradio",
        " machine learning",
        " trackio"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "df1a7faf842e4b8a3b79636d9ff7b6ecbe0b330937a84b439a77f140c3fffd64",
                "md5": "e7017b1677962bf51e702c3d47fe9906",
                "sha256": "6e518a098cc7ab3ae24076cf3c563f8e4564c0b72b3c621505d5209ec1fc4a58"
            },
            "downloads": -1,
            "filename": "trackio_mcp-0.2.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e7017b1677962bf51e702c3d47fe9906",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 11867,
            "upload_time": "2025-08-03T13:37:45",
            "upload_time_iso_8601": "2025-08-03T13:37:45.683726Z",
            "url": "https://files.pythonhosted.org/packages/df/1a/7faf842e4b8a3b79636d9ff7b6ecbe0b330937a84b439a77f140c3fffd64/trackio_mcp-0.2.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cf14bf27a169898618de554a346771cd67bbddf971f6f4b3b9cfeec76d9da7d4",
                "md5": "9fb194fd0adc49b3181fc47cdd86aaa3",
                "sha256": "ebed6dd38d4346ad58f6743d3ddc5ed688f701aefac3e8dcc5d2e18471603f8a"
            },
            "downloads": -1,
            "filename": "trackio_mcp-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "9fb194fd0adc49b3181fc47cdd86aaa3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 15758,
            "upload_time": "2025-08-03T13:37:47",
            "upload_time_iso_8601": "2025-08-03T13:37:47.065565Z",
            "url": "https://files.pythonhosted.org/packages/cf/14/bf27a169898618de554a346771cd67bbddf971f6f4b3b9cfeec76d9da7d4/trackio_mcp-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 13:37:47",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fcakyon",
    "github_project": "trackio-mcp#readme",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "trackio-mcp"
}
        
Elapsed time: 1.17442s