HOW IT WORKSCONNECT YOUR TOOLS
Back to Connect
Connect

Connect Grok Build CLI to Hark via MCP — setup guide

Point xAI's Grok Build CLI at Hark's MCP server so coding sessions start briefed on your project and record what they shipped.

MCP endpoint
https://harkstudio.io/mcp

Sign in to Hark to connect a client. Personal tokens and per-account details live inside the app.

Grok Build (xAI CLI)

One command, then sign in to Hark from the browser.

Grok Build is xAI's terminal agent (the grok command). Register Hark over HTTP:

grok mcp add --transport http hark https://harkstudio.io/mcp

The server is written to ~/.grok/config.toml. Add --scope project to write .grok/config.toml in the current repo instead, so teammates get it too.

~/.grok/config.toml (equivalent, if you prefer editing by hand)
[mcp_servers.hark]
type = "http"
url = "https://harkstudio.io/mcp"
  1. Start grok in a project. The first Hark tool call opens the browser for OAuth — sign in and approve.
  2. Tokens are stored in ~/.grok/mcp_credentials.json and refreshed automatically.
  3. Ask: "List my Hark workspaces." Check the server with grok mcp list or grok mcp doctor hark.

Headless or CI, where no browser is available: use a Hark personal access token instead of OAuth (create one at Connections → Tokens).

grok mcp add --transport http hark https://harkstudio.io/mcp \
  --header "Authorization: Bearer $HARK_TOKEN"
xAI docs — MCP in Grok Build

xAI's remote MCP does not support require_approval, so writes run without a confirmation step. Start with a read-only Hark token (Connections → Tokens) and switch to read + write once you trust the flow.

Grok Build and Grok Bot carry no separate app identity, so Hark labels their activity from the connection: OAuth connections show as Grok Build or Grok, and token-based runs show the token's name — name the token Grok so the activity log reads clearly.

Verify it works

Ask your client: "List my Hark workspaces." Expected: your workspace names.

Then: "Create a project called Connection test in <workspace>." Expected: a new V-### appears in the app and the activity log shows the source ("via Claude Code", "via Codex", etc.). Delete the test venture afterward.

Troubleshooting

  • "Unauthorized request origin" — the client origin isn't allowlisted; retry from the latest app version, or email hello@harkstudio.io.
  • Consent screen loops / stale token — remove the connector in the client, sign out of Hark, sign back in, re-add the connector.
  • Tools list is empty — the connector isn't enabled for this chat (Claude and ChatGPT require enabling it per conversation).
  • Plan cap error — you've hit the monthly agent-call cap for this workspace; see billing.
  • Old endpoint — anything pointing at a lovable.app URL must be updated to harkstudio.io/mcp.

What Hark keeps clear

Evidence on every line

Every record shows Agreed / Observed / Proposed and a source you can open: where did this come from? Agreed means accepted, not independently verified. Observed is reserved for system evidence such as a merged pull request. An agent's claim is never shown as verified simply because it was accepted.

Learn more about Evidence on every line

Repo-native rules

Once linked and selected as the source, the repo's CLAUDE.md or AGENTS.md is authoritative. Hark mirrors it on pushes and retains history rather than authoring competing edits. Optional .hark/ export carries accepted handoff state and decisions into the repo. Repo activity suggests drafts with commit evidence. Agent briefs include mirrored instruction documents and linked repo metadata. Arbitrary repo-document browsing is not exposed by the current tools: Hark never serves source code. Automatic session hooks and compaction protection in the Hark mod are Claude Code-only; other tools follow their connection guide and explicit session tools.

Learn more about Repo-native rules

Scoped, expiring agent access

New agent keys default Propose: suggest changes, never approve them. An eight-character pairing code expires after 15 minutes and works once; no key is pasted into a setup chat. One-link agent approval asks you to sign in, choose permissions, projects and expiry, then approve. The agent still completes pairing. Keys normally expire after 90 days and can be revoked or rotated. The separate show-once Copy key path is for private storage, not chat.

Learn more about Scoped, expiring agent access
SIGN IN TO CONNECT