Hashgrid DNA (local) — Claude Code MCP server: search and setup
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.
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 hashgridWhat Hashgrid DNA (local) 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.
What it helps with
- 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 for the agent
- Search the index for notes about configuring the project build.
- Add
photos/beach.jpgto the local index. - Rate the first result as relevant and the second as irrelevant.
How to install Hashgrid DNA (local)
Platform CLI
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 hashgridReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>
Platform CLI
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 hashgridReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>
Config file
{
"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>
Config file
{
"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>
Platform CLI
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 hashgridReplace <…> with your own values. uvx runs the command named after the package; if the README names another one, use uvx --from hashgrid <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Hashgrid DNA (local)
How do I install Hashgrid DNA (local) in Claude Code?
Run `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`. The environment variables configure the key, embedder, and index.
What does Hashgrid DNA (local) do?
It indexes text and images locally, searches that index, and sends DNA vectors rather than the content. Ratings affect the ranking of later searches.
Do I need an API key for local search?
The local embedders in hashgrid[local] do not require an account. DNA uses a grid key; without one, the server can create a grid and save its key in the local index.