Skip to content

Commit ab269fc

Browse files
sownakgitbook-bot
authored andcommitted
GITBOOK-363: change request with no subject merged in GitBook
1 parent 9260451 commit ab269fc

File tree

4 files changed

+156
-112
lines changed

4 files changed

+156
-112
lines changed
Loading

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
* [Direct interaction with ledger code](advanced/tooling/advanced.md)
158158
* [VDR Tools CLI with cheqd (deprecated)](advanced/tooling/vdr-tools.md)
159159
* [Demo Wallet for identity setup](advanced/tooling/demo-wallet.md)
160+
* [MCP Server Setup](advanced/tooling/mcp-server-setup.md)
160161

161162
## ⚛️ Network
162163

advanced/did-registrar/create-resource.md

+9-112
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,15 @@
22

33
Follow these instructions to create a new Resource linked to a DID using DID registrar. This tutorial will use the cheqd did regisrtar swagger API's and the Veramo CLI.
44

5-
> ⚠️ **Before you begin...**
6-
> Make sure you've completed [creating a DID](./create-did.md) for this tutorial for Veramo CLI
5+
> ⚠️ **Before you begin...** Make sure you've completed [creating a DID](create-did.md) for this tutorial for Veramo CLI
76
87
## 1. Request Create Operation
98

109
Use the `/{did}/create-resource` api to publish a new DID-Linked Resource
1110

1211
1. Paste the DID in the did path parameter
1312
2. Generate request body by providing name, type and base64 encoded data
14-
<details>
15-
<summary>Request</summary>
16-
17-
```json
18-
{
19-
"data": "SGVsbG8gV29ybGQ=",
20-
"name": "ResourceName",
21-
"type": "TextDocument"
22-
}
23-
```
24-
25-
</details>
26-
27-
3. Click on execute to perform the request
28-
<details>
29-
<summary>Response</summary>
30-
31-
```json
32-
{
33-
"jobId": "79638705-da04-492c-aeb4-5e66cfaba0f8",
34-
"resourceState": {
35-
"did": "d4d4404b-6f7f-4e02-8d41-b81afb1f05ed",
36-
"state": "action",
37-
"action": "signPayload",
38-
"description": "Please sign the following payload with the keys in verificationMethod and Add the signingResponse in secret",
39-
"signingRequest": [
40-
{
41-
"kid": "did:cheqd:testnet:d4d4404b-6f7f-4e02-8d41-b81afb1f05ed#key-1",
42-
"type": "Ed25519VerificationKey2020",
43-
"alg": "EdDSA",
44-
"serializedPayload": "CgtIZWxsbyBXb3JsZBIkZDRkNDQwNGItNmY3Zi00ZTAyLThkNDEtYjgxYWZiMWYwNWVkGiQxZGM1ODBmNS1hNWNhLTRhMzMtYWY4My00MzEyNmZlYTZmMmQiDFJlc291cmNlTmFtZTIMVGV4dERvY3VtZW50"
45-
}
46-
],
47-
"secret": {
48-
"signingResponse": [
49-
"e.g. { verificationMethodId: did:cheqd:testnet:qsqdcansoica#key-1, signature: aca1s12q14213casdvaadcfas }"
50-
]
51-
}
52-
}
53-
}
54-
```
55-
56-
</details>
13+
3. Click on execute to perform the request
5714

5815
This response requests an `action` for you to sign the serialized payload again in a CLI. This is a security feature which means you are not passing your private key to the Registrar. Note down the serialized payload, jobId from the response.
5916

@@ -73,6 +30,7 @@ Fill in the prompts
7330
4. enconding: Select `base64`
7431

7532
<details>
33+
7634
<summary>Example Response</summary>
7735

7836
```json
@@ -88,7 +46,7 @@ Fill in the prompts
8846

8947
</details>
9048

91-
**NOTE:** If there are *n* verification methods for the controller then *n* signatures are required to publish a resource.
49+
**NOTE:** If there are _n_ verification methods for the controller then _n_ signatures are required to publish a resource.
9250

9351
Copy the Result value from the response.
9452

@@ -97,73 +55,12 @@ Copy the Result value from the response.
9755
Use the `/create-resource` api again
9856

9957
1. Create the payload using the following values
100-
* jobId
101-
* secret
102-
* signingResponse
103-
* verificationMethodId
104-
* signature
105-
106-
<details>
107-
<summary>Request</summary>
108-
109-
```json
110-
{
111-
"jobId": "79638705-da04-492c-aeb4-5e66cfaba0f8",
112-
"secret": {
113-
"signingResponse": [{
114-
"verificationMethodId": "did:cheqd:testnet:d4d4404b-6f7f-4e02-8d41-b81afb1f05ed#key-1",
115-
"signature": "RiJelgAtm26arp8-cYfLVyyYnvoAgnnaL1Lndf_6G_iuoQtrTRgt5TD1GCwJXb30y8Fc7L_jzN3hH4WZRzeqDw"
116-
}]
117-
}
118-
}
119-
```
120-
121-
</details>
122-
58+
* jobId
59+
* secret
60+
* signingResponse
61+
* verificationMethodId
62+
* signature
12363
2. Click on Execute
124-
125-
<details>
126-
<summary>Response</summary>
127-
128-
```json
129-
{
130-
"jobId": "79638705-da04-492c-aeb4-5e66cfaba0f8",
131-
"resourceState": {
132-
"resourceId": "1dc580f5-a5ca-4a33-af83-43126fea6f2d",
133-
"state": "finished",
134-
"secret": {
135-
"signingResponse": [
136-
{
137-
"verificationMethodId": "did:cheqd:testnet:d4d4404b-6f7f-4e02-8d41-b81afb1f05ed#key-1",
138-
"signature": "RiJelgAtm26arp8-cYfLVyyYnvoAgnnaL1Lndf_6G_iuoQtrTRgt5TD1GCwJXb30y8Fc7L_jzN3hH4WZRzeqDw"
139-
}
140-
]
141-
},
142-
"resource": {
143-
"collectionId": "d4d4404b-6f7f-4e02-8d41-b81afb1f05ed",
144-
"id": "1dc580f5-a5ca-4a33-af83-43126fea6f2d",
145-
"name": "ResourceName",
146-
"resourceType": "TextDocument",
147-
"data": {
148-
"0": 72,
149-
"1": 101,
150-
"2": 108,
151-
"3": 108,
152-
"4": 111,
153-
"5": 32,
154-
"6": 87,
155-
"7": 111,
156-
"8": 114,
157-
"9": 108,
158-
"10": 100
159-
}
160-
}
161-
}
162-
}
163-
```
164-
165-
</details>
166-
16764
3. The state in didState should be `finished` in the response, the DID is created successfully
16865

16966
## 4. Check your Resource is live

advanced/tooling/mcp-server-setup.md

+146
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# MCP Server Setup
2+
3+
> This is an **advanced** guide for those who want to integrate AI Agents with the Cheqd Network to create DIDs and Issue Verifiable Credentials.
4+
5+
## Overview
6+
7+
The **Cheqd MCP Server** is a specialised implementation of the [Model Context Protocol](https://modelcontextprotocol.io/introduction) (MCP) that integrates with the **cheqd** network to provide secure decentralised identity management capabilities for AI applications. Built on the powerful combination of MCP's standardised context protocol and **cheqd**'s robust identity infrastructure, this server enables AI agents to perform sophisticated identity operations while maintaining security, privacy, and verifiability.
8+
9+
Our MCP server is designed as a modular toolkit that can be easily integrated with existing AI workflows, particularly through Claude Desktop, Cursor, and other MCP-compatible client applications.&#x20;
10+
11+
### Benefits of using MCP with cheqd
12+
13+
* **Enhanced AI Trust and Verification**: Enable AI agents to create, resolve, and verify decentralised identities, establishing a foundation of trust for AI interactions.
14+
* **Verifiable Credential Management**: Simplify the issuance, verification, and management of verifiable credentials through standardised tools.
15+
* **Decentralised Identity Operations**: Leverage cheqd's blockchain infrastructure for creating and managing DIDs with cryptographic security.
16+
* **Standardised AI Context**: Utilise the Model Context Protocol to provide structured and verifiable context for AI interactions.
17+
* **Human-in-the-loop Security**: MCP's approval-based tool execution model ensures humans maintain oversight of sensitive identity operations.
18+
* **Interoperable Integration**: Seamlessly connect with existing identity ecosystems through the cheqd network and Credo Toolkit.
19+
20+
### Integration with Credo Toolkit
21+
22+
The server includes deep integration with the Credo Toolkit ([`@cheqd/mcp-toolkit-credo`](https://www.npmjs.com/package/@cheqd/mcp-toolkit-credo)), which provides a comprehensive set of tools for interacting with the cheqd network through the OpenWalletFoundation's Credo-TS framework. This integration enables:
23+
24+
* **DID Management**: Create, update, resolve, and deactivate DIDs on the cheqd network.
25+
* **Resource Operations**: Create and resolve DID-linked resources.
26+
* **Schema Management**: Define and retrieve credential schemas for standardised credential formats.
27+
* **Connection Management**: Establish secure DIDComm connections between identity holders and verifiers.
28+
* **Credential Issuance**: Generate and issue verifiable credentials with cryptographic proofs.
29+
* **Verification Protocols**: Implement zero-knowledge proof verification for enhanced privacy.
30+
31+
The Credo Toolkit abstracts the complexity of these operations, presenting them as simple, well-documented MCP tools that can be invoked by AI agents with appropriate permissions. By leveraging the Credo Toolkit integration, the MCP server provides comprehensive tools for managing the full lifecycle of decentralised identifiers (DIDs) and verifiable credentials on the cheqd network.
32+
33+
### Target Use Cases and Scenarios
34+
35+
The Cheqd MCP Server is particularly well-suited for scenarios requiring trusted AI interactions with verifiable identity information:
36+
37+
* **AI-Assisted Identity Verification**: Enable AI agents to verify user identities through cryptographically secured credentials.
38+
* **Credential Issuance Workflows**: Streamline the creation and issuance of verifiable credentials through AI-guided processes.
39+
* **Trusted Data Exchange**: Facilitate secure sharing of verified data between organisations using AI intermediaries.
40+
* **Identity-Aware AI Systems**: Build AI applications that respect privacy and understand the provenance of identity information.
41+
* **Cross-Domain Verification**: Enable verification of credentials across different systems and networks through the cheqd infrastructure.
42+
* **Self-Sovereign Identity Management**: Support user control over identity information while enabling AI assistance for complex operations.
43+
44+
## Getting Started
45+
46+
### Prerequisites
47+
48+
* An MCP Compatible Desktop based **AI Agent**. We have tested with [Claude Desktop](https://claude.ai/download).
49+
* **Node.js 20 or higher** (if running using npx).
50+
* **Docker Desktop** (if running using docker). This is preferred when running the ACA-Py demo.
51+
* **Working understanding of cheqd network**: Understanding of DID operations and verifiable credentials
52+
53+
### Configuration
54+
55+
The Cheqd MCP Server is configurable through environment variables:
56+
57+
#### Server Configuration Options
58+
59+
<table><thead><tr><th width="291.85546875">Variable</th><th width="314.66796875">Description</th><th>Default</th></tr></thead><tbody><tr><td><code>TOOLS</code></td><td>Comma-separated list of tools to enable</td><td>"credo"</td></tr></tbody></table>
60+
61+
#### Credo Tool Configuration Options
62+
63+
<table><thead><tr><th width="296.36328125">Variable</th><th width="314.140625">Description</th><th>Required</th></tr></thead><tbody><tr><td><code>CREDO_CHEQD_TESTNET_MNEMONIC</code></td><td>Mnemonic for cheqd testnet wallet</td><td>Yes</td></tr><tr><td><code>CREDO_PORT</code></td><td>Port for the Credo agent</td><td>No</td></tr><tr><td><code>CREDO_NAME</code></td><td>Name for the Credo agent</td><td>No</td></tr><tr><td><code>CREDO_ENDPOINT</code></td><td>Public endpoint for DIDComm connections</td><td>No</td></tr></tbody></table>
64+
65+
### Setup
66+
67+
#### 1. Get the code
68+
69+
Get the `docker-compose.yaml` specially designed for Claude:&#x20;
70+
71+
```bash
72+
# Clone the repository
73+
git clone https://github.com/cheqd/mcp-toolkit.git
74+
cd mcp-toolkit
75+
```
76+
77+
#### 2. Create Configuration File
78+
79+
Update your local `env.example` file with the required environment variables:
80+
81+
{% code title="./env.example" %}
82+
```env
83+
TOOLS="credo" # Required tool configuration
84+
CREDO_PORT="3000" # Port for the Credo agent
85+
CREDO_NAME="faber" # Name of the Credo agent
86+
CREDO_ENDPOINT="http://faber:3000" # Public endpoint connections
87+
CREDO_CHEQD_TESTNET_MNEMONIC="your-testnet-mnemonic" # Required for cheqd network access
88+
```
89+
{% endcode %}
90+
91+
Replace `your-testnet-mnemonic` with a valid mnemonic for the cheqd testnet. You can generate one using the cheqd CLI or get one from the cheqd faucet.
92+
93+
#### 3. Update Claude Config
94+
95+
Add the following configuration to your claude\_desktop\_config.json or .cursor/mcp.json
96+
97+
```json
98+
{
99+
"mcpServers": {
100+
"cheqd": {
101+
"command": "docker",
102+
"args": [
103+
"compose",
104+
"-f",
105+
"/path/to/repo/mcp-toolkit/docker/docker-compose.yml",
106+
"run",
107+
"--rm",
108+
"-p",
109+
"3000:3000",
110+
"-T",
111+
"mcp-server"
112+
]
113+
}
114+
}
115+
}
116+
```
117+
118+
#### 4. Restart Claude Desktop
119+
120+
When successfully started, the number of tools available to Claude Desktop will increase.
121+
122+
<figure><img src="../../.gitbook/assets/Screenshot 2025-03-28 at 16.46.59.png" alt=""><figcaption></figcaption></figure>
123+
124+
{% hint style="warning" %}
125+
There may be a error on top right corner, but it can be safely ignored. It is because of port binding, as Claude creates two processes for each MCP Server.
126+
{% endhint %}
127+
128+
### Connection to cheqd network
129+
130+
The server automatically connects to the cheqd testnet using the provided mnemonic. This connection is used for all DID operations and credential management.
131+
132+
#### Verifying Network Connection
133+
134+
To verify the connection to the cheqd network, you can use the server to create and resolve a DID. You can ask the following to the AI Agent:
135+
136+
> "Can you create a DID on the cheqd network?"
137+
138+
If configured correctly, the server will create a new DID and then display its complete DID document, confirming proper connection to the cheqd network.
139+
140+
## Next Steps
141+
142+
Now that you have the Cheqd MCP Server running, you can:
143+
144+
* Explore the available tools for DID management and credential operations
145+
* Create your first verifiable credential using the provided tools
146+
* Set up a complete identity verification workflow

0 commit comments

Comments
 (0)