> ## Documentation Index
> Fetch the complete documentation index at: https://ara-90a60a07.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Grokbot

> Connect Grok Bot to Reason, start a Session, and get the result back in your chat.

Ask Grok Bot to delegate a task to Reason. Reason runs the task in a Session, and your bot brings back the result and a link you can open.

<img src="https://mintcdn.com/ara-90a60a07/456PgXr6TotXinZm/images/integrations/grokbot-connection.webp?fit=max&auto=format&n=456PgXr6TotXinZm&q=85&s=8726dbfe2efbc6a73984f88c8372a652" alt="A bot and Reason connected by a single line." width="1440" height="480" className="rounded-2xl" data-path="images/integrations/grokbot-connection.webp" />

## Connect, then ask

<Steps>
  <Step title="Connect Reason once">
    Ask your bot to check whether it already has a working Reason integration. If it does, reuse it. Otherwise, give it the setup request under **For your agent** below. Complete any required sign-in or secure credential setup yourself—never paste credentials into chat.
  </Step>

  <Step title="Try one small task">
    Paste the connection test below into your bot. It asks Reason to start one harmless Session and return its answer.
  </Step>

  <Step title="Open the result">
    Your bot should return a Reason Session link and the completed answer. Open the link to check the result. A bot saying “connected” or “started” is not enough.
  </Step>
</Steps>

```text wrap theme={null}
Use your Reason integration to start exactly one Session titled "Grok Bot connection smoke test". Ask it: "Reply REASON_GROKBOT_CONNECTED and explain in one sentence what a Reason Session is." Do not change files, open PRs, or deploy. Wait for completion and return the actual Session link and result. Do not expose credentials.
```

<Note>
  We tested this flow with a Grok Bot that already had a Reason API integration: it started a Session, retrieved the completed answer, and returned the link. This verifies that integration—not a universal Grok Bot plugin or a fresh MCP connection.
</Note>

## Use it for real work

Once the test passes, just describe what you need. Include the repository and what a good result looks like.

<Tabs>
  <Tab title="Understand code">
    ```text wrap theme={null}
    Ask Reason to explain how sign-in works in my-org/my-repo and where its tests live. Do not change files. Wait for the answer and return the Session link and summary.
    ```
  </Tab>

  <Tab title="Make a small fix">
    ```text wrap theme={null}
    Ask Reason to fix the broken mobile navigation in my-org/my-repo. Run the relevant tests and open a pull request. Do not merge or deploy. Return the Session link, pull request, and test results when finished.
    ```
  </Tab>
</Tabs>

Replace `my-org/my-repo` with a repository your Reason workspace can access. Review the result and tests before merging. Repository protections and required approvals still apply.

## Setup resources

These details are for the agent or developer connecting your bot; you do not need them for every task.

<Tabs>
  <Tab title="For your agent">
    Copy this setup request into your bot:

    ```text wrap theme={null}
    Help me connect this bot to Reason so I can ask for a task and receive the completed result and Session link.
    First check for an existing Reason integration and reuse it if available. Verify the intended workspace and access; never reveal credentials or ask me to paste them into chat.
    If there is no integration, inspect this bot's documented capabilities. Use Reason's HTTP API documentation at https://docs.reasonmachines.com/api-reference/account/verify-credentials for an API adapter. Keep credentials in the bot's supported server-side secret store and guide me through secure setup.
    Alternatively, only if this client supports remote MCP over Streamable HTTP and OAuth, use https://mcp.reasonmachines.com/mcp with https://docs.reasonmachines.com/docs/mcp. Ask me to complete sign-in and consent. Do not invent plugin names, UI steps, or install commands.
    Start exactly one harmless Reason Session asking it to reply REASON_GROKBOT_CONNECTED. Wait for completion, check its outcome, retrieve the actual answer, and return the Session link and result. Do not edit files, open PRs, merge, or deploy during this test.
    If any step fails, report that step rather than claiming the connection works.
    ```
  </Tab>

  <Tab title="Advanced">
    <AccordionGroup>
      <Accordion title="HTTP API: the integration used in our test" icon="code">
        Start with the [HTTP API reference](/api-reference/account/verify-credentials). A bot adapter needs to authenticate, create a Session, retain its ID, wait for completion, and retrieve the result. Return the actual Session link and answer to the chat; surface failures instead of treating creation as success.

        Keep credentials server-side in the bot's supported secret store. Grant only the workspace access and scopes it needs. The live test used an existing configured adapter; it did not verify a new installation flow.
      </Accordion>

      <Accordion title="Remote MCP: for compatible clients" icon="plug">
        Public connection URL:

        ```text wrap theme={null}
        https://mcp.reasonmachines.com/mcp
        ```

        Follow [MCP setup](/docs/mcp) for authentication. The URL alone grants no access. Grok Bot's remote MCP/OAuth connection was not exercised in our API test.

        Follow current tool schemas: verify workspace access with `getSelf`, start with `createSession`, wait with `getSession`, check the outcome, and retrieve the answer with `listSessionMessages`. Continue the same Session with `sendSessionMessage` for follow-up work.
      </Accordion>

      <Accordion title="Reason Network: for bots with shell access" icon="terminal">
        See [Reason Network](/docs/network) for setup on the trusted computer running your bot. Use `reason network who` to discover an agent, then use its actual address:

        ```bash wrap theme={null}
        reason network alice/api-claude "Explain the billing webhook retry policy. Do not change files."
        ```

        This is an alternative, not the path exercised in our API test. Pass user text as a separate process argument, not interpolated shell code.
      </Accordion>
    </AccordionGroup>
  </Tab>
</Tabs>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.