Skip to main content
The Guild CLI includes an MCP (Model Context Protocol) server that exposes Guild operations as tools for MCP clients. Client agents call these tools to read and act on Guild resources. This page covers how to run the server, what each tool takes, and what it returns. To connect a client step by step, or to use the hosted server at https://api.guild.ai/mcp instead, see Connect an MCP client.

Run the server

The server talks to its client over stdio, so the client starts it rather than you. It needs a signed-in CLI: run guild auth login first, or the server exits with Not authenticated. guild setup adds the server to .mcp.json in your project. To add it by hand, put this in your client’s MCP config:

Output format

Every tool returns its result in the content[0].text payload. The format depends on what the tool does:
  • Data-returning tools return a structured JSON string. The tool serializes the response data with JSON.stringify(data, null, 2), so the text is valid, indented JSON that a client agent can parse directly.
  • Action-taking tools return narrative plain text that describes the result of the action.
  • Errors return a plain text error string and set isError: true.
Data-returning tools return JSON, not human-readable narrative text. Parse content[0].text as JSON instead of scraping formatted output.

Data-returning tools

These tools return structured JSON. They cover the current user, list endpoints, and single-object get endpoints.

Pagination

Some data-returning tools can return more rows than fit in a single response. Use cursor pagination to walk the full result set instead of only the most-recent page. These tools support pagination:
  • guild_list_sessions
  • guild_list_triggers
  • guild_get_trigger_sessions
  • guild_get_session_events
Each of these tools accepts an optional cursor parameter. When more rows remain, the response includes a nextCursor string. Pass that value verbatim as the cursor argument on your next call to fetch the next page. When the response omits nextCursor, you have reached the end of the result set. For guild_get_session_events, the response payload places the rows in an events array ordered ascending by ID. Walk the full event history by following nextCursor until it is absent.

Action-taking tools

These tools perform an action and return narrative plain text describing the result.
  • guild_chat
  • guild_send_message
  • guild_interrupt_session
  • guild_add_workspace_agent
  • guild_remove_workspace_agent
  • guild_publish_context
  • guild_get_agent_readme, which returns the agent’s README as Markdown
  • guild_get_agent_code, which returns each source file under a --- <path> --- header

Tool parameters

Parameters marked optional can be left out. Every optional workspace_id defaults to the server’s workspace. Agents and integrations accept either an ID or a full name such as owner~agent-name. Prefer the terminal? Use guild api, the authenticated CLI escape hatch that calls the Guild REST API directly and prints the raw JSON response.
Last modified on October 21, 2026