> For the complete documentation index, see [llms.txt](https://dataflint.gitbook.io/dataflint-for-spark/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dataflint.gitbook.io/dataflint-for-spark/dataflint-copilot/copilot-in-claude-code.md).

# Copilot in Claude Code

### Summary

This guide shows you how to install and configure the DataFlint MCP (Model Context Protocol) server in Claude Code.

The entire process takes just a few minutes.

The steps are:

1. Prerequisites - Ensure you have the required tools installed
2. Add DataFlint MCP to Claude Code
3. Authenticate with your organization
4. Verify the installation

### Prerequisites

Before installing the DataFlint MCP server, ensure you have:

* **Node.js** (version 18 or higher) installed on your system
* **npm** or **npx** available in your command line
* **Claude Code** installed and available as `claude` in your terminal
* Your **organization's customer domain** — only for BYOC (bring your own cloud) customers. Contact your DataFlint admin if you do not know it.

### Installation

#### Step 1: Add DataFlint MCP to Claude Code

Open a terminal and run one of the following commands.

**For SaaS customers:**

```bash
claude mcp add dataflint -- npx -y @dataflint/mcp-server@latest
```

**For BYOC (bring your own cloud) customers:**

```bash
claude mcp add dataflint -- npx -y @dataflint/mcp-server@latest --customer-domain YOUR_COMPANY_NAME
```

{% hint style="info" %}
Replace `YOUR_COMPANY_NAME` with your customer domain. SaaS customers do not need this flag.
{% endhint %}

#### Step 2: First-time authentication

When you first use DataFlint MCP in Claude Code:

1. Your browser will automatically open to your organization's authentication page
2. Log in with your organization credentials
3. Future uses will not require browser authentication

<figure><img src="/files/qEfd5ZBSHESQrFSXyDuz" alt=""><figcaption></figcaption></figure>

After successful authentication, you can close the browser and return to Claude Code.

<figure><img src="/files/cSZHDsEtexcFGw7kSRAY" alt=""><figcaption></figcaption></figure>

### Verify the installation

#### Test the connection

Open Claude Code, run `/mcp`, and run the Spark expert command:

<figure><img src="/files/zh26NSWwEXjuZYOZv0hE" alt=""><figcaption></figcaption></figure>

Then you can ask Claude questions, with or without the prompt, such as:

```
Find my top 5 application to fix by using DataFlint MCP
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://dataflint.gitbook.io/dataflint-for-spark/dataflint-copilot/copilot-in-claude-code.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
