xAI Grok Setup
AvailableConnect Bookkeeping CLI to Grok two ways: paste a connector URL straight into the Grok app, or wire it up as a remote MCP tool in the xAI API/SDK. Either way, no local setup.
- •An xAI API key from console.x.ai
- •A Bookkeeping CLI account with your accounting software connected
- •A Bookkeeping CLI API key from your dashboard
1Get Your Bookkeeping CLI API Key
Go to your API Keys dashboard and create a new key. Copy it — you'll need it for the MCP authorization.
Get API Key2Connect Grok
In the Grok app (easiest): open grok.com/connectors → New Connector → Custom, and paste your connector URL: https://www.bookkeepingcli.com/api/mcp/YOUR_API_KEY. Your key is baked into the URL, so there's no OAuth form or login — it just connects. Your dashboard shows the full URL when you create a key.
In the xAI API/SDK: add the MCP server as a remote tool and pass your key as the authorization token, as shown below.
Python (xai-sdk)
from xai_sdk import Client
client = Client()
response = client.responses.create(
model="grok-3",
input="List my unpaid invoices",
tools=[
{
"type": "mcp",
"server_url": "https://www.bookkeepingcli.com/api/mcp",
"server_label": "bookkeeping",
"authorization": "Bearer YOUR_API_KEY"
}
]
)
print(response.output_text)cURL
curl https://api.x.ai/v1/responses \
-H "Authorization: Bearer $XAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "grok-3",
"input": "List my customers",
"tools": [{
"type": "mcp",
"server_url": "https://www.bookkeepingcli.com/api/mcp",
"server_label": "bookkeeping",
"authorization": "Bearer YOUR_BOOKKEEPING_API_KEY"
}]
}'What You Can Ask
Once connected, ask Grok about your accounting data in natural language:
~/.grok/instructions/bookkeeping-cli.md. This gives Grok full knowledge of all CLI commands, authentication, and provider-specific features.Next Steps
You're all set! Here's what you can do now: