# Contact MCP Credential Setup

### 1. Feature Overview

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

#### What is the MCP Credentials Feature

The MCP credentials feature is like "setting up an exclusive access pass for each customer." When multiple customers need to use the same tool to query their own data, each person needs their own "key" (credentials) to ensure that each person can only see their own data and not others'.

**Simple Analogy**\
It's like an apartment building where all residents use the same elevator (MCP tool), but each person must swipe their own access card (credentials) to enter their own floor.

#### Why is This Feature Needed

* **Protect Customer Privacy** — Each customer uses their own credentials to ensure data is not mixed together
* **Personalized Service** — Different customers can have different usage permissions
* **Easy Management** — When a customer's credentials expire or need to be changed, only that customer's settings need to be updated

#### Usage Examples

**Scenario 1: Personal Data Query**\
Customer A and Customer B both want to query their own purchase records, but they each have 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 data

***

### 2. Feature Location and Setup Preparation

#### Where to Find This Feature

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

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

**Important Reminder**\
The contact must be created and saved first before MCP credentials can be set up (to ensure credentials are correctly bound to the contact)

#### Pre-Setup Preparation

Before you begin setup, please confirm the following:

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

   <figure><img src="/files/eS2AOfZR1mL4KnvNDSyP" alt=""><figcaption></figcaption></figure>
2. The contact you want to configure credentials for 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" functional permissions according to organizational needs.

***

### 3. Operation 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" tag appears next to the tool name
* **Not Yet Configured** → No tag appears next to the tool name

***

#### 3.2 Add or Modify Credentials

**Step 1: Open Configuration Section**

Click the "Edit" button (pencil icon) on the right side of the tool to expand the configuration area

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

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

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

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

{% hint style="info" %}
**What are Headers?**\
Headers are "identity documents" that contain the contact's exclusive key. Just like you need to bring your ID when going to the bank, the system needs these Headers to verify "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 it to you directly, and you just need to copy and paste.
{% endhint %}

**Step 3: Important Notes**

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

{% hint style="info" %}
**Important**: Different MCP tools require different Header formats. Please make sure the credentials you received match the format required by this tool
{% endhint %}

**Step 4: Save or Cancel**

**Save Settings**

* After confirming everything is correct, click the "**Save**" button in the bottom right
* The system will check if the format is correct
* After successful save:
  * The edit area will automatically collapse
  * A **green "Configured" tag** will appear next to the tool name (only when configuring for the first time)

**Cancel Edit**

* 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 are no longer needed, you can reset them.

**How to Operate**

1. Click the tool's "Edit" button to expand the edit area
2. If this tool has already been configured with credentials (has a green "Configured" tag), a red "**Reset Credentials**" button will appear in the bottom left
3. Click and confirm to clear the credentials
4. After clearing, the green "Configured" tag next to the tool name will disappear

**⚠️ Important Reminder**

* **Cannot be undone** after reset
* It's recommended to copy and save the Headers content before resetting
* If you just want to modify the content, edit it directly without resetting

***

### 4. Operation Examples

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

**Scenario**

Customer A wants to query their own purchase records, and you have obtained 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 code
5. Click "Format JSON" to ensure the format is correct
6. Click save

***

#### Example 2: Setting Up Department-Specific Query Credentials

**Scenario**

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

**Headers Content**

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

**Field Explanation**

* `X-API-Key` — Sales department's exclusive key
* `X-Department` — Indicates this is being used by the sales department

***

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

**Headers Content**

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

**Field Explanation**

* `Authorization` — Primary authentication key
* `X-Client-ID` — Customer ID
* `Content-Type` — Data format specification (usually fixed as this value)

***

### 5. Contact MCP vs Tool MCP Differences

#### Feature Comparison Table

| Comparison Item           | Tools → MCP                                                         | Contacts → MCP Credentials                                                                    |
| ------------------------- | ------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| **What It Is**            | Create the tool itself                                              | Set up exclusive credentials for individual contacts                                          |
| **Configuration Scope**   | Available system-wide                                               | Only for specific contacts                                                                    |
| **Configuration Content** | <p>• Tool URL<br>• Default credentials<br>• Available functions</p> | <p>• Only this person's credentials<br>• Replaces default credentials</p>                     |
| **When to Use**           | When first integrating a new tool                                   | When each customer needs different credentials                                                |
| **Who Can Operate**       | Users with permissions                                              | Users with permissions                                                                        |
| **Where to Configure**    | Tool management page                                                | Contact edit page                                                                             |
| **Common Uses**           | <p>• Add a query tool<br>• Set up basic tool data</p>               | <p>• Each customer uses their own credentials<br>• VIP customers have special permissions</p> |

#### Simple Understanding: Computer Lab Analogy

Imagine a school computer lab:

**Tool MCP (Created by Authorized Personnel)**

* Install software in the computer lab
* Configure all computers to use this software
* Decide what features the software has

**Contact MCP Credentials**

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

#### Actual Workflow

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

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

#### Key Summary

* **Tool MCP** — Must have the "tool" before it can be used
* **Contact MCP Credentials** — Then give each person a "key"

***

### 6. Frequently Asked Questions

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

**Possible Reasons**

* You are in "Add Contact" mode (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
* Contact data has not been saved

**Solution**

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 if the Headers format is wrong?

**Common Error Examples**

* ❌ Wrong: `{'key': 'value'}` (uses single quotes)
* ❌ Wrong: `{key: value}` (no quotes)
* ❌ Wrong: `{"key": "value",}` (extra comma at the end)
* ✅ Correct: `{"key": "value"}`

**Solution**

1. Click the "Format JSON" button, the system will automatically check
2. If there are still issues, re-copy the credentials
3. Or ask the credential provider to verify the format again

***

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

**How to Obtain Credentials**

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

**⚠️ Don't Fill in Randomly**

Credentials have specific formats and content. Filling them in incorrectly will cause the tool to malfunction and may even result in data errors.

***

#### Q4: Why can't I see the "Configured" tag?

**Display Conditions**

* Only tools that have "already been configured with credentials" will show this green tag
* When configuring for the first time, you won't see it until after successful save
* The tag will appear after successful save

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

This means this contact hasn't configured any MCP credentials yet, which is normal.

***

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

**Display Conditions (Must Meet Both)**

1. This tool has already been configured with credentials (green "Configured" tag next to tool name)
2. You clicked the "Edit" button to expand the edit area

**Button Location**

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

**Tool hasn't been configured with credentials yet?**

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

***

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

**What Will Happen**

* This contact's exclusive credentials will be cleared
* The green "Configured" tag next to the tool name will disappear
* If the tool has default credentials, it will use the default (but usually there aren't any)
* ⚠️ **Cannot be undone after deletion**

**Recommended Practice**

* Copy and backup the Headers content first
* Think clearly about whether you really want to delete
* If you just want to modify the content, use "Edit" instead

***

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

**Technically Possible**

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

**But Not Recommended**

* Can't tell who is using it
* Data may get mixed up
* When someone has a problem, you won't know whose problem it is

**Correct Approach**

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

***

#### Q8: 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 need individual credential configuration)

**Solution**

1. Ask personnel with tool creation permissions to confirm if MCP tools have been created
2. Verify tool type settings are correct
3. If everything is normal but still can't see it, contact technical support

***

### Appendix: Operation Checklist

#### Pre-Setup Confirmation

* [ ] Contact has been created and saved
* [ ] System has available MCP tools
* [ ] Obtained credential information (from customer or authorized personnel)
* [ ] Confirmed credential format is correct

#### During Setup Confirmation

* [ ] Headers format is correct (can check with format button)
* [ ] All required fields are filled in
* [ ] No extra or incorrect content
* [ ] No error messages appear after clicking format

#### Post-Setup Confirmation

* [ ] Green "Configured" tag appears next to tool name
* [ ] Actual testing shows tool works normally
* [ ] Settings information recorded (date, contact, tool name)
* [ ] If needed, notify relevant personnel that setup is complete


---

# Agent Instructions: 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:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/tools/setup-contacts-mcp-credentials.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
