tilt icon indicating copy to clipboard operation
tilt copied to clipboard

AI Agent support

Open dharmab opened this issue 6 months ago • 7 comments

Describe the Feature You Want

I'd like to connect the AI Agent in my editor to Tilt so the agent can trigger resources and see what happens while editing my project.

Two potential ways to do this would be:

  • tilt CLI commands to trigger resources and get their results, including the logged output
  • MCP support for the agent to directly interact with Tilt, in much the same way a human interacts with the web UI

Current Behavior

My agent can't trigger resources, so I either have to:

  • Trigger the resource myself and manually tell the agent what happened
  • Factor the resource's commands into a separate script and instruct the agent to run the script. Sometimes this is a little janky. Say triggered resource R has a dependency on resource D which in turn is triggered by edits to file F. If the agent edits F, it doesn't have any way to know if/when D has successfully completed so it can run the script for R.

Why Do You Want This?

I'm using TIlt in a large project and using an AI agent to perform some tasks within that project.

Additional context

I'm using Zed, but ideally the solution is portable to a variety of editors such as Cursor, Windsurf, etc.

dharmab avatar Jun 11 '25 22:06 dharmab

re: "tilt CLI commands to trigger resources and get their results, including the logged output"

i believe these already exist? tilt trigger, tilt api-resources, tilt logs, etc

nicks avatar Jun 12 '25 01:06 nicks

I looked over the tilt help command but somehow missed trigger - must have been my error!

However, tilt trigger doesn't do what I need. It returns immediately, instead of waiting for the resource to resolve. So the agent isn't sure when the resource is ready to check or move on to the next step in a series of steps (e.g. trigger a local resource, check the result, then decide what to do next based on pass/fail criteria)

Another issue is that tilt logs combines the logs from multiple triggers, making it more difficult for an agent to associate cause and effect with a specific trigger.

I guess what that would look like is a tilt trigger --wait --with-logs resource1,resource2... command which:

  • Does not return immediately, but rather waits for the resources to resolve
  • Prints the logs for those resources related to that specific triggering

(Or use MCP to provide the agent with similar context as a human has when looking at the Web UI)

dharmab avatar Jun 16 '25 14:06 dharmab

+1 for MCP ;)

Pietrox avatar Jun 22 '25 10:06 Pietrox

We Built an MCP server that lets AI assistants in Cursor/Windsurf directly interact with your Tilt dev environment. What it does:

  • Fetches logs from Tilt resources
  • Checks service states & health
  • Lists running services
  • Enables AI debugging with full context

Built with: FastMCP framework and used tilt cli commands to fetch the logs and ui resources

Considering open-sourcing if there's interest 👀

aryan-agrawal-glean avatar Jul 14 '25 06:07 aryan-agrawal-glean

@aryan-agrawal-glean i would like to see it!

nicks avatar Jul 14 '25 18:07 nicks

@nicks Pypi package: https://pypi.org/project/tilt-mcp/ Repo link: https://github.com/aryan-agrawal-glean/tilt-mcp

To use:

pip install tilt-mcp and add this in mcp-config

"tilt": {
      "args": [],
      "command": "tilt-mcp",
      "description": "Tilt MCP server for interacting with Tilt resources and logs"
    }

aryan-agrawal-glean avatar Jul 15 '25 09:07 aryan-agrawal-glean

FWIW: I added a few more functions to @aryan-agrawal-glean 's tilt-mcp project and dockerized the MCP server. It is also currently using the latest MCP SDK and specs.

Example .mcp.json configuration for Linux/MacOS:

{
  "mcpServers": {
    "tilt": {
      "type": "stdio",
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "${HOME}/.tilt-dev:/home/mcp-user/.tilt-dev",
        "-v",
        "${HOME}/.tilt-mcp:/home/mcp-user/.tilt-mcp",
        "-e",
        "TILT_PORT=10350",
        "--network=host",
        "ghcr.io/rrmistry/tilt-mcp:latest"
      ],
      "env": {}
    }
  }
}

Windows example for .mcp.json is in the ReadMe.md

Note: regarding volume mount ~/.tilt-dev in the dockerized tilt-mcp server, this is required due to a known issue in Tilt CLI: https://github.com/tilt-dev/tilt/issues/6612, which doesn't respect TILT_HOST env or --host CLI arguments.


If you find bugs then please do submit an issue in the repo. I am open for feedback 🙏

Hope this helps!

rrmistry avatar Oct 26 '25 03:10 rrmistry