# Issue a Verifiable Credential

Follow these instructions to Issue a new Credential from your MCP Client (e.g. Claude Desktop) using the MCP Toolkit.

> ⚠️ **Before you begin...**
>
> Make sure you have configured the [MCP Client as per the setup instructions](/product/getting-started/ai-agents/trust-registry/setup-mcp.md#getting-started).

## Step 1: Start your Holder Agent

Our [docker-compose file](https://github.com/cheqd/mcp-toolkit/blob/main/docker/docker-compose.yml) contains "demo" profile, which includes a Holder ACA-py Agent setup. Start the Holder Agent with the following command

```bash
// from mcp-toolkit folder 
cd docker
docker compose --profile demo up -d
```

## Step 2: Create Connection between Holder and Claude Desktop.

Although, either agents can start the connection, in this tutorial we will start the invite from Holder.

Open the Holder API at <http://localhost:4001/api/doc> or use Postman, to create a new connection request. Copy the `invitation_url` from the response.

{% openapi src="/files/VIzToYXSCuPwCrpBbLYU" path="/out-of-band/create-invitation" method="post" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}

**Parameters and Request Body**

For automated acceptance, pass the following parameters:

<details>

<summary>auto_accept</summary>

Set this to true.

</details>

A simple request body is below:

```json
{
    "alias": "Faber",
    "handshake_protocols": ["https://didcomm.org/didexchange/1.1"],
    "use_public_did": false,
    "my_label": "Invitation to Faber"
}
```

## Step 3: Claude Desktop accepts the invitation <a href="#id-1b-holder-receives-invitation" id="id-1b-holder-receives-invitation"></a>

Go to Claude Desktop, and accept the connection by pasting the `invitation_url` value.

{% hint style="success" %}
Always "Allow for this chat" or "Allow once" when the prompt appears. This is a security feature to have human interaction for MCP tools.
{% endhint %}

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

## Step 4: Ask Claude to issue a Credential

Now you can ask Claude Desktop to issue a Credential Offer to the connection. Claude will interpret the message automatically and do all the steps necessary to issue a Credential Offer.

For this tutorial, we asked Claude to create a credential offer with **score as 80 and subject as Mathematics**.

<figure><img src="/files/4zhvqAOo1XHfLjmPPIpv" alt=""><figcaption></figcaption></figure>

When all the steps are completed, a Credential Offer will be sent to Holder agent.

## Step 5: Holder accepts and stores the Credential.

The rest of the steps are from the Holder to accept the credential offer and store the credential. This can be achieved by the following API Calls from the Holder API at <http://localhost:4001/api/doc> or Postman.

{% openapi src="/files/VIzToYXSCuPwCrpBbLYU" path="/issue-credential-2.0/records" method="get" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}

**Parameters**

Filter on "offer-received" state

<details>

<summary>state</summary>

Set this to "offer-received".

</details>

Copy and save the `cred_ex_id` from the response and pass that in the next request to Accept the Offer.

{% openapi src="/files/VIzToYXSCuPwCrpBbLYU" path="/issue-credential-2.0/records/{cred\_ex\_id}/send-request" method="post" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}

Now, store the received Credential into the Holder wallet.

{% openapi src="/files/VIzToYXSCuPwCrpBbLYU" path="/issue-credential-2.0/records/{cred\_ex\_id}/store" method="post" %}
[swagger.json](https://3569764573-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FPVAMvpKH7PYzvXA6u6Cn%2Fuploads%2F6otKdslTxD5vA4zstkSG%2Fswagger.json?alt=media\&token=4be3b6bb-f452-4d59-b61c-c6dc0e597b74)
{% endopenapi %}


---

# 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.cheqd.io/product/getting-started/ai-agents/trust-registry/setup-mcp/advanced/issue-credential.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.
