ข้ามไปยังเนื้อหาหลัก

Using AI with Loha

Loha ships an MCP server your AI client can call directly. Instead of switching to the dashboard to check a build, you ask your agent: it reads the status, the logs, and (with your confirmation) can trigger a run, all from the chat window you already have open.

This guide gets you connected, then gives you a table of prompts to paste in and try.

Connect your AI client (2 minutes)​

The hosted MCP server works the same way regardless of which AI client you use: you add it once with a personal access token, the same credential the CLI uses.

  1. Create a PAT in the dashboard under your workspace's Settings → API Keys (the dashboard calls PATs API keys). Start read-only (builds:read, repos:read, pipelines:read); add triggers:run only if you want your agent to be able to start builds.
  2. Add the hosted endpoint (https://mcp.loha.longtumlab.com/) to your client's MCP config, sending the PAT as a Bearer token.

Claude Code has this scripted as a one-liner, and Cursor / Claude Desktop use the same .mcp.json shape; see the exact commands and config snippet in Use Loha with Claude Code & Cursor.

ChatGPT (via its MCP connector support) and Google Antigravity connect the same way (a hosted HTTP MCP server plus a bearer token), though the exact place you paste the URL and header lives in each client's own connector/tool settings rather than a shared config file. Check that client's MCP or "custom connector" documentation for where to add a remote server.

Once connected, confirm it worked by asking your agent "what Loha workspace am I in?" It should call whoami and tell you.

What your agent can actually do today​

The MCP server exposes eight tools; everything it can do maps to one of them. See the full reference for the complete list, but in short, your agent can:

  • Check who it's authenticated as and which workspace it's in
  • List repos, triggers, and recent builds
  • Validate a .loha.yml against Loha's real schema
  • Read a build's status, step breakdown, and secret-redacted logs
  • Trigger a manual run (guarded): it dry-runs by default and won't dispatch anything until you explicitly confirm

It can't (yet) connect a new repo, author a pipeline from scratch, tail logs live as they stream, or manage deploy targets: those are on the roadmap. Ask it to do what's on this list and it'll work; ask it to do more and it'll tell you it can't.

Prompt examples​

Paste any of these directly into a connected AI client:

What you wantPrompt to paste
Confirm you're connected"Which Loha workspace and account am I connected as?"
Check recent build health"Show me the last 5 builds for this repo and their status."
Validate before you commit"Validate the .loha.yml in this repo against Loha's schema and tell me if anything's wrong."
Debug a red build"Why did the last build on main fail? Find the failing step and show me its logs."
Trigger a build, with a safety net"Trigger a build on main. Ask me to confirm before you actually run it."
Trigger and wait for the result"Trigger a build on main, then poll it until it finishes and tell me pass or fail, with a link to the build."
Audit a pipeline change"Compare the .loha.yml on this branch to what's on main: what would actually change about how it builds?"

See also​