> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exploratory.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Use from AI agents

What an AI agent should know before it runs expl server. An agent that can run shell commands can use expl directly. No MCP setup is needed.

## How to use expl

1. Check the connection first: run expl server status. Exit code 0 from expl server tools list does not mean the connection works.
2. Find commands instead of guessing names: run `expl server tools list --json`, then expl server tools describe \<tool\_name> for the arguments of one command.
3. Add `--json` and read the result from standard output. Progress and warnings go to standard error, so they do not break the JSON.
4. Read the exit code. 3 means the server cannot be reached, and 4 means authentication or permission.
5. Outside a terminal, an operation that is hard to undo does nothing without `--yes` (exit code 2). Ask the user before you add `--yes`, and add it only for an operation the user has decided to run. expl server token revoke is an exception: it sends the revocation without asking and without `--yes`, so confirm the key and the user's intention to revoke it before you run it.
6. In CI, sign in with an API key through the environment variable EXPL\_SERVER\_TOKEN.
7. When an error message names a tool, such as chart\_query, run expl server tools describe \<tool\_name> to see the command for that tool.

For listing and describing commands, see [Inspect commands](https://docs.exploratory.io/en/cli/server/commands.md#inspect-commands). For the exit codes, see [Exit codes and errors](https://docs.exploratory.io/en/cli/server/exit-codes.md). For using an API key in CI, see [Automation](https://docs.exploratory.io/en/cli/server/guides/automation.md).

## Choose expl or MCP Server

MCP is a shared standard for AI tools to connect to outside services. You can use Exploratory from AI with either.

| You want | Use |
| - | - |
| Scripts, CI, a shell-based agent | expl |
| An agent that works through MCP | MCP Server (you register the server URL in your AI tool) |

To read published content from an AI tool, see [MCP Server](https://docs.exploratory.io/en/mcp/server). To work with projects in Exploratory Desktop, see [Use with Desktop](https://docs.exploratory.io/en/cli/desktop/guides/agents.md).


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