> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/tools/setup-contacts-mcp-credentials.md).

# Contacts MCP Credential Setup

### I. Feature Background

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

#### What Is the MCP Credential Feature?

The MCP credential feature is like "setting up a dedicated pass for each customer." When multiple customers need to use the same tool to query their own data, each person needs their own "key" (credential) to ensure they can only see their own data and not anyone else's.

**Simple Analogy**\
Think of an apartment building — all residents use the same elevator (MCP tool), but each person must swipe their own access card (credential) to enter their own floor.

#### Why Is This Feature Needed?

* **Protect Customer Privacy** — Each customer uses their own credentials, ensuring data is not mixed together
* **Individualized Service** — Different customers can have different usage permissions
* **Easy Management** — When a customer's credentials expire or need replacement, you only need to update that one customer's settings

#### Use Case Examples

**Scenario 1: Personal Data Queries**\
Customer A and Customer B both need to query their own purchase records, but each has different account credentials

**Scenario 2: Department Permission Management**\
Different departments use the same query tool but have different viewing permissions

**Scenario 3: Tiered Service**\
VIP customers can query more detailed data, while regular customers can only query basic information

***

### II. Feature Location & Preparation

#### Where to Find This Feature

**Navigation Path**\
Contact Management → Click Edit Contact → Switch to the "MCP Credentials" tab

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

**Important Reminder**\
You must first create and save the contact before you can configure MCP credentials (to ensure credentials are correctly bound to the contact)

#### Preparation Before Setup

Before starting the configuration, confirm the following:

1. MCP tools have already been created in the system (AI Features → Tools → MCP)

   <figure><img src="/files/eS2AOfZR1mL4KnvNDSyP" alt=""><figcaption></figcaption></figure>
2. The contact to receive credentials has been created and saved
3. You have obtained the contact's credential information (usually provided by the customer or authorized personnel)

> **Permission Note**\
> System administrators can flexibly assign "Tools" and "Contacts" feature permissions based on organizational needs.

***

### III. Operating Instructions

#### 3.1 View Available Tools

**Steps**

1. Open the contact you want to edit
2. Click the "MCP Credentials" tab at the top
3. You will see a list of all configurable tools

**Tool List Description**

Each tool displays:

* **Tool Name** (e.g., "Customer Database Query")
* **Tool Description** (if available, shown in gray text below the name)
* **Edit Button** (pencil icon on the right)

**How to Identify Configuration Status**

* **Already configured** → A green "Configured" label appears to the right of the tool name
* **Not yet configured** → No label appears to the right of the tool name

***

#### 3.2 Add or Modify Credentials

**Step 1: Open the Settings Area**

Click the "Edit" button (pencil icon) to the right of the tool to expand the settings area

**Step 2: Fill In Headers (Credential Information)**

Paste the credential information in the text box using JSON format:

```json
{"Authorization": "Bearer your-key-code-here"}
```

If you're unsure about the format, click the "**Format JSON**" button to auto-format

{% hint style="info" %}
**What Are Headers?**\
Headers are like "identification documents" that contain the contact's dedicated key. Just like you need to bring your ID when going to the bank, the system needs these Headers to confirm "who this person is."
{% endhint %}

{% hint style="info" %}
**What Is JSON?**\
JSON is a data format that looks like: `{"field_name": "content"}`. Don't worry — usually someone will provide this to you directly, and you just need to copy and paste it.
{% endhint %}

**Step 3: Important Notes**

* Headers are **required** (marked with a red \*)
* The entered Headers will **replace** the tool's default settings

{% hint style="info" %}
**Important**: Different MCP tools require different Headers formats. Make sure the credential format you received matches the tool's requirements
{% endhint %}

**Step 4: Save or Cancel**

**Save Settings**

* After confirming everything is correct, click the "**Save**" button in the bottom right corner
* The system will validate the format
* After saving successfully:
  * The editing area will automatically collapse
  * A **green "Configured" label** will appear to the right of the tool name (only appears for the first time)

**Cancel Editing**

* If you don't want to save, click "Cancel"

***

#### 3.3 Reset Credentials (Clear Configured Credentials)

**When Would You Use This?**

When credentials are configured incorrectly, or when the credentials are no longer needed, you can reset them.

**How to Operate**

1. Click the tool's "Edit" button to expand the editing area
2. If the tool already has credentials configured (has a green "Configured" label), a red "**Reset Credentials**" button will appear in the bottom left corner
3. Click to confirm, and the credentials will be cleared
4. After clearing, the green "Configured" label to the right of the tool name will disappear

**⚠️ Important Reminder**

* Reset **cannot be undone**
* It is recommended to copy and back up the Headers content before resetting
* If you only need to modify the content, edit it directly — there's no need to reset

***

### IV. Operation Examples

#### Example 1: Set Up Database Query Credentials for a Customer

**Scenario**

Customer A needs to query their own purchase records, and you have received a set of credential codes.

**Headers Content**

```json
{
  "apikey": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
```

**Steps**

1. Find contact "Customer A" and click Edit
2. Switch to the "MCP Credentials" tab
3. Find the "Customer Database Query" tool and click the Edit button
4. Paste the credential codes
5. Click "Format JSON" to ensure proper formatting
6. Click Save

***

#### Example 2: Set Up Dedicated Query Credentials for a Department

**Scenario**

The sales department needs to access customer data but can only view basic information, not financial data.

**Headers Content**

```json
{
  "X-API-Key": "dept_sales_abc123",
  "X-Department": "sales"
}
```

**Field Descriptions**

* `X-API-Key` — The sales department's dedicated key
* `X-Department` — Identifies this is being used by the sales department

***

#### Example 3: Set Up Credentials with Multiple Fields

**Headers Content**

```json
{
  "Authorization": "Bearer token_xyz",
  "X-Client-ID": "client_12345",
  "Content-Type": "application/json"
}
```

**Field Descriptions**

* `Authorization` — The main authentication key
* `X-Client-ID` — Client ID number
* `Content-Type` — Data format specification (usually fixed to this value)

***

### V. Contact MCP vs. Tool MCP Differences

#### Feature Comparison Table

| Comparison Item        | Tool → MCP                                                          | Contact → MCP Credentials                                                                     |
| ---------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **What Is It**         | Creates the tool itself                                             | Sets up dedicated credentials for individual contacts                                         |
| **Scope**              | Available system-wide                                               | Only for a specific contact                                                                   |
| **Configuration**      | <p>• Tool URL<br>• Default credentials<br>• Available functions</p> | <p>• Only this person's credentials<br>• Overrides default credentials</p>                    |
| **When to Use**        | When connecting a new tool for the first time                       | When each customer needs different credentials                                                |
| **Who Can Operate**    | Anyone with permissions                                             | Anyone with permissions                                                                       |
| **Where to Configure** | Tool management page                                                | Contact editing page                                                                          |
| **Common Uses**        | <p>• Add a new query tool<br>• Set up tool basics</p>               | <p>• Each customer uses their own credentials<br>• VIP customers have special permissions</p> |

#### Simple Analogy: Computer Lab

Imagine a school computer lab:

**Tool MCP (Set up by authorized personnel)**

* Install software in the computer lab
* Configure all computers to use the software
* Determine which features the software has

**Contact MCP Credentials**

* Create individual accounts for each student
* Each student logs in with their own account
* Different students can have different usage permissions

#### Practical Workflow

```
Step 1: Create MCP Tool (by personnel with tool creation permissions)
    ↓
Create "Customer Database Query" tool
- Set tool URL
- Set default credentials (if applicable)
    ↓
Step 2: Set up dedicated credentials for each contact (by personnel with credential configuration permissions)
    ↓
Customer A: Configure A's dedicated credentials
Customer B: Configure B's dedicated credentials
Customer C: Configure C's dedicated credentials
    ↓
Result: Everyone uses the same tool but with their own credentials
```

> **Permission Flexibility**\
> System administrators can determine who can create tools and who can configure credentials based on organizational needs. These can be the same people or managed separately.

#### Key Takeaways

* **Tool MCP** — You need the "tool" first before it can be used
* **Contact MCP Credentials** — Then give each person their "key"

***

### VI. FAQ

#### Q1: Why can't I see the "MCP Credentials" tab?

**Possible Reasons**

* You are on the "Add Contact" page (you need to save the contact first, then re-enter edit mode to see it)
* No MCP tools have been created in the system yet
* The contact data hasn't been saved yet

**Solutions**

1. Fill in and save the contact's basic information first
2. Confirm that MCP tools exist in the system (check with authorized personnel)
3. Re-enter edit mode

***

#### Q2: What should I do if the Headers format is incorrect?

**Common Error Examples**

* ❌ Wrong: `{'key': 'value'}` (used single quotes)
* ❌ Wrong: `{key: value}` (no quotes)
* ❌ Wrong: `{"key": "value",}` (trailing comma)
* ✅ Correct: `{"key": "value"}`

**Solutions**

1. Click the "Format JSON" button — the system will auto-check
2. If there's still an issue, copy the credentials again
3. Or ask the credential provider to re-confirm the format

***

#### Q3: How do I know what to fill in?

**How to Obtain Credentials**

1. Ask the customer to provide their credential information
2. Ask the responsible personnel to provide or help create them
3. Ask the colleague responsible for the tool
4. Refer to other successfully configured contacts (but don't copy directly!)

**⚠️ Don't fill in random values**

Credentials have specific formats and content. Entering incorrect values will prevent the tool from working and may cause data errors.

***

#### Q4: Why don't I see the "Configured" label?

**Display Conditions**

* Only tools that have already been configured with credentials show the green label
* When configuring for the first time, the label won't appear until after saving successfully
* The label appears only after a successful save

**No labels on any tools in the list?**

This means the contact hasn't had any MCP credentials configured yet — this is normal.

***

#### Q5: Can't find the "Reset Credentials" button?

**Display Conditions (all must be met)**

1. The tool already has credentials configured (green "Configured" label appears to the right of the tool name)
2. You have clicked the "Edit" button to expand the editing area

**Button Location**

After expanding the editing area, the red "Reset Credentials" button is in the bottom left corner; the "Cancel" and "Save" buttons are in the bottom right corner.

**Tool doesn't have credentials configured yet?**

The "Reset Credentials" button won't appear because there are no credentials to reset. The bottom left corner will be empty.

***

#### Q6: What happens when I click "Reset Credentials"?

**What Happens**

* The contact's dedicated credentials will be cleared
* The green "Configured" label to the right of the tool name will disappear
* If the tool has default credentials, those will be used instead (but usually there are none)
* ⚠️ **Deletion cannot be undone**

**Recommended Approach**

* Copy and back up the Headers content first
* Make sure you really want to delete
* If you only need to modify the content, use "Edit" instead

***

#### Q7: Can multiple contacts use the same set of credentials?

**Technically, yes**

The system won't prevent you from copying the same credentials to different people

**But it's not recommended**

* You won't know who is using it
* Data may get mixed together
* When something goes wrong, you won't know whose issue it is

**Correct Approach**

* Each contact uses their own credentials
* Keep data clearly separated
* Easier to track and manage

***

#### Q8: The tool list is empty, showing "No available tools"?

**Possible Reasons**

* No MCP tools have been created in the system yet
* All tools are "global" type (global tools don't require individual credential configuration)

**Solutions**

1. Ask personnel with tool creation permissions to confirm whether MCP tools have been created
2. Confirm that the tool type settings are correct
3. If everything looks normal but you still can't see any tools, contact technical support

***

### Appendix: Operation Checklist

#### Pre-Setup Confirmation

* [ ] The contact has been created and saved
* [ ] MCP tools are available in the system
* [ ] Credential information has been obtained (from the customer or responsible personnel)
* [ ] Credential format has been verified as correct

#### During Setup Confirmation

* [ ] Headers format is correct (use the Format button to check)
* [ ] All required fields are filled in
* [ ] No extraneous or incorrect content
* [ ] No error messages appear after formatting

#### Post-Setup Confirmation

* [ ] Green "Configured" label appears to the right of the tool name
* [ ] Tool has been tested and works correctly
* [ ] Setup information has been recorded (date, contact, tool name)
* [ ] Relevant personnel have been notified of the completed setup, if needed


---

# 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://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/tools/setup-contacts-mcp-credentials.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.
