# Hashgrid DNA (local)

This local MCP server searches text and images, then uses result ratings to shape later rankings. Connect it when an agent needs search over a local index.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 4
- Author: hashgrid-labs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/hashgrid-labs/sdk
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/hashgrid-dna-local

## What it does

Hashgrid DNA (local) puts items in an index, retrieves matches for a query, and accepts ratings for the results. Searches can be limited by a key prefix. Image search requires an embedder that handles images; a text query can retrieve them too.

The index keeps content and embeddings on the machine, while DNA receives vectors. The default local embedder runs on the CPU and requires `hashgrid[local]`. Choosing OpenAI or Voyage sends content to that provider, so the matching API key is needed. That changes where project content goes, which matters when data must stay on the machine.

The server communicates over stdio. Add it to Claude Code with the command below; environment variables configure the DNA key, embedder, and index path. Without a key, the server can create a grid and store its key in the local index.

## Requirements
- Needs: Python and uv (commands run via uvx)
- Environment variables: `HASHGRID_API_KEY`, `HASHGRID_EMBEDDER`, `OPENAI_API_KEY`, `VOYAGE_API_KEY`, `HASHGRID_INDEX` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env HASHGRID_API_KEY=<HASHGRID_API_KEY> --env HASHGRID_EMBEDDER=<HASHGRID_EMBEDDER> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env VOYAGE_API_KEY=<VOYAGE_API_KEY> --env HASHGRID_INDEX=<HASHGRID_INDEX> --transport stdio hashgrid-dna-local -- uvx hashgrid
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>

### Codex

**Platform CLI**
```bash
codex mcp add hashgrid-dna-local --env HASHGRID_API_KEY=<HASHGRID_API_KEY> --env HASHGRID_EMBEDDER=<HASHGRID_EMBEDDER> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env VOYAGE_API_KEY=<VOYAGE_API_KEY> --env HASHGRID_INDEX=<HASHGRID_INDEX> -- uvx hashgrid
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "hashgrid-dna-local": {
            "command": "uvx",
            "args": [
                "hashgrid"
            ],
            "env": {
                "HASHGRID_API_KEY": "<HASHGRID_API_KEY>",
                "HASHGRID_EMBEDDER": "<HASHGRID_EMBEDDER>",
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "VOYAGE_API_KEY": "<VOYAGE_API_KEY>",
                "HASHGRID_INDEX": "<HASHGRID_INDEX>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "hashgrid-dna-local": {
            "type": "stdio",
            "command": "uvx",
            "args": [
                "hashgrid"
            ],
            "env": {
                "HASHGRID_API_KEY": "<HASHGRID_API_KEY>",
                "HASHGRID_EMBEDDER": "<HASHGRID_EMBEDDER>",
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "VOYAGE_API_KEY": "<VOYAGE_API_KEY>",
                "HASHGRID_INDEX": "<HASHGRID_INDEX>"
            }
        }
    }
}
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e HASHGRID_API_KEY=<HASHGRID_API_KEY> -e HASHGRID_EMBEDDER=<HASHGRID_EMBEDDER> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e VOYAGE_API_KEY=<VOYAGE_API_KEY> -e HASHGRID_INDEX=<HASHGRID_INDEX> hashgrid-dna-local uvx hashgrid
```
Replace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>

## When to use it
- retrieve local index entries from a text query
- find images using text or another image
- limit a search by key prefix
- rate results to affect later rankings

## Example prompts
- Search the index for notes about configuring the project build.
- Add `photos/beach.jpg` to the local index.
- Rate the first result as relevant and the second as irrelevant.

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 392262
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33989
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89609
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81163
- [Front-End Checklist](https://affpapa.org/en/nevibecode/mcp/front-end-checklist.md) — MCP server · ★ 74569
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89899

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
