Troubleshooting: AI and MCP
Fixes for the AI assistant (keys, models, providers) and for MCP clients. tobira doctor checks the
ai: and mcp: sections, and tobira doctor --online also checks that the provider accepts the
key.
The AI assistant
- “AI is not configured”. There is no
ai:section. Add one; see AI configuration. - “ai provider authentication failed”. No key was found, or the provider rejected it. Set
ai.api_keyto a reference such asenv:GEMINI_API_KEY, or export the provider’s variable (the error names it). Forvertexai, check your Application Default Credentials. - Model not found. The provider reports the model as unknown (exit 3 from
tobira ask). Check the spelling ofai.model, or leave it empty for the default. Forollama, pull the model first (ollama pull llama3.3). - Rate limit. The provider is refusing for quota (exit 2). Wait, switch model, or raise the quota.
- Provider unreachable. For
ollamaor abase_url, check the server is running and the URL; for hosted providers, check the network (exit 2). - Ollama model without tool support. tobira does not check whether an
ollamamodel supports tool calling, so a model without it fails with a provider error (exit 3) as soon as the assistant calls a tool. Choose a model that supports tools. - The assistant only sees schema, no rows. That is
send_rows. Say yes at the prompt, setalways, or pass--send-rows. - No queries are run on my connection. Its driver has no read-only guard (SingleStore, for example), so only the schema tools are offered.
no key: set ai.api_key (a secret ref) or GEMINI_API_KEY(orANTHROPIC_API_KEY,OPENAI_API_KEY) in doctor’saisection. Setai.api_keyto a reference such asenv:GEMINI_API_KEY, or export the provider’s variable. A literal key in the config is a load error.vertexaiuses Application Default Credentials andollamaneeds no key.- Check a key without asking anything.
tobira doctor --onlinelists the provider’s models, without generating anything; forvertexaiit fetches an ADC token instead. - Text similarity says “text similarity needs ai.embedder”. Set
ai.embedder, for examplegoogleai/text-embedding-005. Its provider needs its own key, which doctor checks in the row namedembedder api_keyof theaisection.
MCP clients
- The client sees no connections. Nothing is exposed until
mcp.exposeor--exposenames it, and doctor’smcpsection fails an exposed name that is not a valid connection. - 401 over HTTP. Every request needs
Authorization: Bearer <token>. Withoutmcp.token, tobira generates a token at each start and prints it once to stderr, so a restart invalidates the client’s copy; setmcp.token: env:TOBIRA_MCP_TOKENto keep it stable.mcp.tokenmust be a reference, never a literal. - 403 over HTTP. The Host or Origin check refused the request: connect to the address tobira
bound (
127.0.0.1:8765,localhost:8765), or add a name with--allowed-host. --httpon a non-loopback address exits 4. Binding beyond loopback needs--insecure-bind; put TLS in front of it, since tobira speaks plain HTTP.- The client cannot start
tobira. MCP clients start the binary with their ownPATH; use the absolute path totobirain the client’s config. Secrets referenced withenv:must be set in that config too. tobira history --mcpshows every call a client made, refusals included. See the MCP server page.