> For the complete documentation index, see [llms.txt](https://docs.origintrail.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.origintrail.io/connect-agents-and-systems/mcp.md).

# MCP Clients

Use DKG knowledge from the agent client you already work in. MCP exposes node tools so the agent can query relationships, inspect sources, and contribute knowledge through the normal sharing and publication lifecycle.

Use an installed MCP-aware client such as Cursor, Claude Code, Claude Desktop, Windsurf, VS Code with Copilot, Cline, or Codex CLI. DKG supplies tools over MCP stdio; the client supplies the model and conversation.

```bash
npm install -g @origintrail-official/dkg
dkg mcp setup --network testnet
```

Setup initializes a fresh node, starts it, and offers to register DKG in detected clients. Restart the chosen client. Existing nodes keep their network. Use `dkg mcp setup --dry-run` to inspect changes first.

## Verify

1. Run `dkg status` in the terminal.
2. Inspect the client's DKG tool list. Ask it to call the discovered status and Context Graph listing tools.
3. Complete the [quickstart](/start-here/quickstart.md), including retrieval in a new conversation.

If the client cannot find tools, confirm that setup detected the intended installation, restart it, and inspect its MCP logs. A source checkout and a globally installed CLI use different setup modes and homes; see the [package reference](https://github.com/OriginTrail/dkg/blob/main/packages/mcp-dkg/README.md).

## Remove the connection

```bash
dkg mcp uninstall --dry-run
dkg mcp uninstall
```

Removal disconnects clients; it does not delete graph data. For a single client, use the documented `--client` selector in the [CLI reference](/references/cli.md).


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.origintrail.io/connect-agents-and-systems/mcp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
