Labsco
rrmistry logo

tilt-mcp

5

from rrmistry

Tilt MCP is a Model Context Protocol server that integrates with Tilt to provide programmatic access to Tilt resources, logs, and management operations for Kubernetes development environments

🔥🔥🔥✓ VerifiedFreeAdvanced setup

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.

Why use a Tilt MCP server?

Imagine prompting like this:

Please work on {some LLM request} and then check tilt MCP for "backend-api" resource logs for compile status. Make sure that "backend-tests" resource is successful with your changes.

The key insight is you no longer need to tell your LLM how to build and deploy your code. Instead, you can simply ask it to what to build and deploy.

Tilt is a powerful tool for working with Docker/Kubernetes workloads. With the Tilt MCP server, you can integrate Tilt's features directly into your workflow using Large Language Models (LLMs) like Claude Code / Codex / Gemini / VS Code Copilot / etc.

This saves significant LLM tokens (and so ⏱️+💰), both by avoiding to give extra context to your LLM on how to build/deploy, and also by avoiding LLMs actually doing the build/deploy. All the LLM needs to know is to make code changes then call the tilt MCP server to get real-time feedback.

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
  • Enable and disable resources dynamically
  • Get detailed information about resources
  • Trigger resource rebuilds
  • Wait for resources to reach specific conditions

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

Available MCP Capabilities

The Tilt MCP server follows the Model Context Protocol specification and exposes three types of capabilities:

🔍 Resources (Read-Only Data)

Resources provide read-only access to Tilt data. They're automatically discovered by MCP clients and can be accessed via their URI.

Resource URIDescription
tilt://resources/all{?tilt_port}List of all enabled Tilt resources with their current status
tilt://resources/{resource_name}/logs{?tail,filter,tilt_port}Logs from a specific resource with optional regex filtering (case-insensitive by default)
tilt://resources/{resource_name}/describe{?tilt_port}Detailed information about a specific resource

All resources support an optional tilt_port parameter (default: 10350) to query different Tilt instances.

Example URIs:

  • tilt://resources/all - Get all resources from default port (10350)
  • tilt://resources/all?tilt_port=10351 - Get all resources from port 10351
  • tilt://resources/frontend/logs - Get last 1000 lines from frontend (default)
  • tilt://resources/frontend/logs?tail=100&tilt_port=10351 - Get last 100 lines from frontend on port 10351
  • tilt://resources/backend/logs?filter=error - Filter logs for errors (case-insensitive)
  • tilt://resources/backend/logs?filter=X-Request-Id:%20abc123 - Filter by request ID
  • tilt://resources/backend/describe - Get detailed info about backend

🛠️ Tools (Actions with Side Effects)

Tools enable LLMs to perform actions that modify the state of your Tilt environment.

ToolDescriptionParameters
trigger_resourceTriggers a Tilt resource to rebuild/updateresource_name (required), tilt_port (optional, default: '10350')
enable_resourceEnables one or more Tilt resourcesresource_names (required, list), enable_only (optional, default: false), tilt_port (optional, default: '10350')
disable_resourceDisables one or more Tilt resourcesresource_names (required, list), tilt_port (optional, default: '10350')
wait_for_resourceWait for a resource to reach a specific conditionresource_name (required), condition (optional, default: 'Ready', valid values: 'Ready' or 'UpToDate'), timeout_seconds (optional, default: 30), tilt_port (optional, default: '10350')

Read-Only Tools (for clients that don't support MCP Resources):

ToolDescriptionParameters
list_resourcesList all enabled Tilt resources with their statustilt_port (optional, default: '10350')
get_resource_logsGet logs from a specific resource with optional regex filteringresource_name (required), tail (optional, default: 1000), filter (optional, regex pattern), tilt_port (optional, default: '10350')
describe_resourceGet detailed information about a specific resourceresource_name (required), tilt_port (optional, default: '10350')

Note: The read-only tools (list_resources, get_resource_logs, describe_resource) provide the same functionality as the MCP Resources above, but are exposed as tools for better compatibility with LLM clients (like Claude Code) that may not fully support MCP resource discovery.

All tools support an optional tilt_port parameter to target different Tilt instances running on different ports.

💡 Prompts (Guided Workflows)

Prompts are reusable templates that guide the LLM through common debugging and troubleshooting workflows.

PromptDescriptionParameters
debug_failing_resourceStep-by-step debugging guide for a failing resourceresource_name (required)
analyze_resource_logsAnalyze logs from a resource to identify errorsresource_name (required), lines (optional, default: 100)
troubleshoot_startup_failureInvestigate why a resource won't start or keeps crashingresource_name (required)
health_check_all_resourcesComprehensive health check across all resourcesNone
optimize_resource_usageOptimize resource usage by selectively enabling/disabling servicesfocus_resources (required, list)

Error Handling

All capabilities include comprehensive error handling:

  • Resource Not Found: Raises ValueError with helpful message
  • Tilt Connection Issues: Raises RuntimeError with Tilt error details
  • JSON Parsing Errors: Provides detailed parsing error information

All operations are logged to ~/.tilt-mcp/tilt_mcp.log for debugging.

Features

MCP Protocol Compliance:

  • 🔍 Resources: Read-only access to Tilt data via URI templates (e.g., tilt://resources/all)
  • 🛠️ Tools: Actions with side effects for resource management and control
  • 💡 Prompts: Guided workflows for debugging and troubleshooting

Capabilities:

  • 📊 Resource Discovery: List all active Tilt resources with their current status
  • 📜 Log Retrieval: Fetch recent logs from any Tilt resource with configurable tail
  • 🔄 Resource Triggering: Manually trigger Tilt resources to rebuild/update
  • Resource Control: Enable or disable resources dynamically
  • 📋 Detailed Information: Get comprehensive details about any resource
  • Wait Conditions: Wait for resources to reach specific states
  • 🤖 Guided Workflows: Pre-built prompts for common debugging scenarios

Technical Features:

  • 🛡️ Type Safety: Built with Python type hints for better IDE support
  • 🚀 Async Support: Fully asynchronous implementation using FastMCP
  • 📈 MCP Best Practices: Proper separation of resources, tools, and prompts
  • 🔧 Comprehensive Logging: All operations logged to ~/.tilt-mcp/tilt_mcp.log

Example Prompts

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

Using Built-in Prompt Templates:

  • "Use the debug_failing_resource prompt for the backend service"
  • "Run a health check on all my resources"
  • "Use the troubleshoot_startup_failure prompt to investigate why the frontend won't start"
  • "Analyze the logs from the backend service using the analyze_resource_logs prompt"
  • "Help me optimize my resources to focus on just the backend and database"

Resource Discovery & Status:

  • "Show me all the Tilt resources that are currently running"
  • "Which services are failing or have errors?"
  • "Compare the status of frontend and backend services"
  • "Access the tilt://resources/all resource to see all services"

Log Analysis:

  • "Get the last 100 lines of logs from the backend-api service"
  • "Read the logs from tilt://resources/frontend/logs?tail=50"
  • "Show me the last 200 lines of logs from any failing services"
  • "Help me debug why the frontend service is crashing by looking at recent logs"

Resource Control:

  • "Disable the frontend and backend services"
  • "Enable only the database service and disable everything else"
  • "Enable the frontend service"
  • "Disable all non-essential services to save resources"

Build & Deployment:

  • "Trigger a rebuild of the backend service"
  • "Rebuild the frontend and show me the logs"
  • "Trigger all services that have errors"
  • "Wait for the backend to be ready before checking its logs"

Advanced Automation Workflows:

  • "Enable the backend, wait for it to be ready, then check its logs"
  • "Disable all services, then enable only frontend and wait for it to start"
  • "Get detailed info about the database and show me its recent logs"
  • "Trigger a rebuild of the API service and wait until it's ready"
  • "Run a complete health check and fix any issues you find"

Using Resources Directly:

  • "Read tilt://resources/backend/describe to understand the configuration"
  • "Compare logs from tilt://resources/frontend/logs?tail=500 and tilt://resources/backend/logs?tail=500"
  • "Check tilt://resources/all to see which services need attention"
  • "Get the last 50 lines from the frontend: tilt://resources/frontend/logs?tail=50"

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

Support