# AdapTable MCP Server and CLI

Canonical page: https://www.adaptabletools.com/docs/getting-started-ai-cli

- One package the Skills use to read the docs for the installed version, and check Initial State, Expressions and setup
- Install the MCP server so a Skill can call it. If you do not, the Skill runs the same package as the CLI and still finishes

AdapTable provides one package, <AiPackage/>, as part of its AI Resources.

The Skills use that package to:
- read the docs for the AdapTable version in the project
- check Initial State, Expressions etc. 
- setup against that version

- The [Agent Skills](https://www.adaptabletools.com/docs/getting-started-ai-skills/index.md) are what you talk to
- You **never call the MCP Server** yourself

The package runs in two ways:

| | |
| --- | --- |
| Install the MCP server | <ul><li>The Skill calls the tools</li><li>This is the easiest path</li></ul> |
| Do not install it | <ul><li>The Skill runs the CLI, and still finishes</li><li>CI and a terminal run the same CLI</li></ul> |

Nothing is added to the application, and your code [stays on your machine](https://www.adaptabletools.com/docs/getting-started-ai/index.md#stays-on-your-machine)

## Install and run

### Install the MCP server or the CLI

There are 3 steps. Do step 1, then either step 2 or step 3.

This package needs Node 20 or later.

Install the [Agent Skills](https://www.adaptabletools.com/docs/getting-started-ai-skills/index.md) first. Without them the agent has nothing to follow.

<span id="mcp-mode"></span>

This is the recommended install.

The config is a few lines in the project, one per client.

#### Cursor

`.cursor/mcp.json` in the project (or `~/.cursor/mcp.json` for every project):

<AiMcpConfig client="json"/>

#### Claude Code

Run this in the project; it writes `.mcp.json`, which you can commit for the team:

<AiMcpConfig client="claude-cli"/>

Or write `.mcp.json` yourself:

<AiMcpConfig client="json"/>

#### VS Code (Copilot)

`.vscode/mcp.json` in the project. The tools appear in Copilot Chat's agent mode:

<AiMcpConfig client="vscode"/>

#### Codex

`~/.codex/config.toml`:

<AiMcpConfig client="codex"/>

Restart the client and ask the agent which AdapTable tools it can see.

It should list the tools from this package. 

If it cannot see them, the command in that file must end in `mcp`, and the client must be restarted.

Consult the [Troubleshooting Guide](https://www.adaptabletools.com/docs/technical-reference-ai-cli/index.md#troubleshooting) for other possible errors or causes

Skip the config above. The Skill runs the CLI through `npx` and the work still gets done.

To pin the version for the team, and for CI:

{`npm i -D @adaptabletools/adaptable-mcp`}

The Skill runs the CLI. 

A check that finds a problem exits `1`, so a CI job or a pre-commit hook can fail on it. 

The job is described in great detail in the [technical reference](https://www.adaptabletools.com/docs/technical-reference-ai-cli/index.md#use-it-in-ci-and-hooks).

- Every command, what it prints, the JSON output, exit codes, the offline cache and full troubleshooting list are in the [technical reference](https://www.adaptabletools.com/docs/technical-reference-ai-cli/index.md)
- The AI Skills read that page and its designed for them (you do not need to read it)

### FAQ

**Does the MCP Server send my code anywhere?**
No, [everything stays on your machine](https://www.adaptabletools.com/docs/getting-started-ai/index.md#stays-on-your-machine)

**Do I need both the CLI and the MCP server?**
No, it is one package. The MCP server is the easiest way for a Skill to call it. The CLI is what the Skill runs when the server is not configured, and what CI runs.
