Skip to main content

Model Context Protocol server for Tilt - interact with Tilt resources through MCP

Project description

Tilt MCP Server

A Model Context Protocol (MCP) server that integrates with Tilt to provide programmatic access to Tilt resources and logs through LLM applications.

Overview

The Tilt MCP server allows Large Language Models (LLMs) and AI assistants to interact with your Tilt development environment. It provides tools to:

  • List all enabled Tilt resources
  • Fetch logs from specific resources
  • Monitor resource status and health

This enables AI-powered development workflows, debugging assistance, and automated monitoring of your Tilt-managed services.

Features

  • 🔍 Resource Discovery: List all active Tilt resources with their current status
  • 📜 Log Retrieval: Fetch recent logs from any Tilt resource
  • 🛡️ Type Safety: Built with Python type hints for better IDE support
  • 🚀 Async Support: Fully asynchronous implementation using FastMCP
  • 📊 Structured Output: Returns well-formatted JSON responses

Prerequisites

  • Python 3.8 or higher
  • Tilt installed and configured
  • An MCP-compatible client (e.g., Claude Desktop, mcp-cli)

Installation

From PyPI (recommended)

pip install tilt-mcp

From Source

git clone https://github.com/aryan-agrawal-glean/tilt-mcp.git
cd tilt-mcp
pip install -e .

Configuration

For Claude Desktop

Add the following to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/claude/claude_desktop_config.json

{
  "mcpServers": {
    "tilt": {
      "command": "python",
      "args": ["-m", "tilt_mcp.server"],
      "env": {}
    }
  }
}

For Development/Testing

You can run the server directly:

python -m tilt_mcp.server

Or use it with the MCP CLI:

mcp run python -m tilt_mcp.server

Usage

Once configured, the Tilt MCP server provides the following tools:

get_all_resources

Lists all enabled Tilt resources with their current status.

Example response:

[
  {
    "name": "frontend",
    "type": "k8s",
    "status": "ok",
    "updateStatus": "ok"
  },
  {
    "name": "backend-api",
    "type": "k8s", 
    "status": "pending",
    "updateStatus": "pending"
  }
]

get_resource_logs

Fetches recent logs from a specific Tilt resource.

Parameters:

  • resource_name (string, required): Name of the Tilt resource
  • tail (integer, optional): Number of log lines to return (default: 1000)

Example request:

{
  "resource_name": "frontend",
  "tail": 50
}

Example response:

{
  "logs": "2024-01-15 10:23:45 INFO Starting server on port 3000\n2024-01-15 10:23:46 INFO Server ready"
}

Example Prompts

Here are some example prompts you can use with an AI assistant that has access to this MCP server:

  • "Show me all the Tilt resources that are currently running"
  • "Get the last 100 lines of logs from the backend-api service"
  • "Which services are failing or have errors?"
  • "Show me the recent logs from all services that aren't healthy"
  • "Help me debug why the frontend service is crashing"

Development

Setting up the development environment

# Clone the repository
git clone https://github.com/yourusername/tilt-mcp.git
cd tilt-mcp

# Create a virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install in development mode with dev dependencies
pip install -e ".[dev]"

Running tests

pytest

Code formatting and linting

# Format code
black src tests

# Run linter
ruff check src tests

# Type checking
mypy src

Troubleshooting

Common Issues

  1. "Tilt not found" error

    • Ensure Tilt is installed and available in your PATH
    • Try running tilt version to verify installation
  2. "No resources found" when Tilt is running

    • Make sure your Tiltfile is loaded and resources are started
    • Check that you're running the MCP server in the correct directory
  3. Connection errors

    • Verify the MCP client configuration is correct
    • Check the logs at ~/.tilt-mcp/tilt_mcp.log

Debug Logging

To enable debug logging, set the environment variable:

export LOG_LEVEL=DEBUG

Contributing

We welcome contributions! Please see our Contributing Guide for details on:

  • Setting up your development environment
  • Running tests
  • Submitting pull requests
  • Code style guidelines

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with FastMCP for the MCP server implementation
  • Integrates with Tilt for Kubernetes development

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tilt_mcp-0.1.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tilt_mcp-0.1.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file tilt_mcp-0.1.1.tar.gz.

File metadata

  • Download URL: tilt_mcp-0.1.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for tilt_mcp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f12855a460f12564cb9e590d2752feed335d28965b428db36e0d30eea93842b7
MD5 eee9cb9c72a5780f3c83e27d1d865585
BLAKE2b-256 ef77e36876f1e829de5cedaef3eaf52d744e144d8a53ba46298038201c5615ca

See more details on using hashes here.

File details

Details for the file tilt_mcp-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tilt_mcp-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.14

File hashes

Hashes for tilt_mcp-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 271b96d4561d462988695ba6c2c76f57668dbe7708c94f31fad34906f52301eb
MD5 806ddddf77a0674b4c07f6bed4da21c2
BLAKE2b-256 9c530651bfee22dc37ab29b406b7fd67f4fed696a9340f403ad02a3395f2c187

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page