Skip to main content
Glama
Hydra DB MCP Server

Hydra DB MCP Server

by hydra-db

Hydra DB — MCP Server

MCP (Model Context Protocol) server for Hydra DB, the state-of-the-art agentic memory. Provides tools for storing, recalling, and managing memories with knowledge-graph enriched context.

Run it two ways, same tools either way:

  • Local (stdio) — the npx @hydradb/mcp binary each client spawns. No server to operate; credentials live in the client's config. This is the default and everything below the Configuration section documents it.

  • Remote (HTTP) — one hosted process behind a URL like https://mcp.hydradb.com that many clients point at, with nothing to install. See Remote / hosted server.

Available Tools

Tool

What it does

hydradb_query

Search memories and knowledge together, with knowledge-graph context

hydradb_ingest

Save a note, a document, or a conversation

hydradb_update

Merge metadata or replace the access list of one existing item

hydradb_list

Enumerate what is stored — memories, knowledge sources, or both in one page

hydradb_inspect

Fetch one source's full content by id

hydradb_delete

Remove one or more items by id, irreversibly

hydradb_status

Check whether an ingested source has finished indexing

hydradb_subgraph

Everything connected to one item — its thread, replies, parents, children, links

hydradb_relations

The knowledge-graph relations of one item or a whole collection, page by page

hydradb_feedback

Report whether a query's results were useful, by its request_id

hydradb_databases

List databases this connection can address

hydradb_database_create

Create a database with an optional metadata schema and embedding dimension

hydradb_database_delete

Delete a database irreversibly

hydradb_database_readiness

Check whether database provisioning finished

hydradb_database_stats

Read database-wide knowledge and memory row counts

hydradb_database_schema_inspect

Read the metadata fields declared for a database

hydradb_database_schema_update

Add fields to a database metadata schema (additive only)

hydradb_list_collections

List collections inside a database

hydradb_delete_collection

Delete one collection irreversibly

Ids flow between these: hydradb_query, hydradb_list and hydradb_subgraph emit them; hydradb_inspect, hydradb_update, hydradb_delete, hydradb_status, hydradb_subgraph and hydradb_relations accept them.

Connector tools

Tool

What it does

hydradb_connector_provider_list

List the connector providers HydraDB supports

hydradb_connector_provider_inspect

Read one provider's setup guide and credential field schema

hydradb_connector_list

List connected sources, optionally with health

hydradb_connector_inspect

Read one connector's configuration and lifecycle

hydradb_connector_health

Explain connector and resource sync health in plain words

hydradb_connector_connect

Return a secure dashboard link for connecting a provider

hydradb_connector_reconnect

Return a secure dashboard link for replacing a connector's credentials

hydradb_connector_update

Update noncredential connector settings

hydradb_connector_delete

Permanently delete a connector

hydradb_connector_sync

Start a connector sync

hydradb_connector_pause

Pause connector syncing

hydradb_connector_resume

Resume connector syncing

hydradb_connector_discover

Discover resources available upstream in a connected provider account

hydradb_connector_resource_list

List resources already added to a connector

hydradb_connector_resource_add

Add one or more discovered resources and start syncing them

hydradb_connector_resource_update

Replace one resource's ACL or instructions

hydradb_connector_resource_delete

Permanently remove one resource from a connector

The names follow the connector section of CONTRACT.md: noun first, verb last, the same words the CLI (hydradb connector resource add) and the plugin (/hydradb:connector-resource-add) use.

Connector tools are on by default. Set HYDRADB_MCP_CONNECTOR_TOOLS=0 to withhold the whole family. A confined OAuth connection sees only connectors assigned to an allowed database and collection. Connectors with no destination stay hidden, and every by-ID read checks the connector before reading status, discovery, or resources. Resource listings also check each resource's database_override and collection_override, then inherit the connector destination.

Connector endpoints cannot enforce database or collection grants atomically with a mutation. Write tools therefore fail closed for every database- or collection-confined OAuth connection and send no connector API request. Use an organization-wide connection for connector mutations. Connector deletion, connector settings, resource add, resource updates, and resource deletion are marked destructive; resource add is also non-idempotent because it can start time-relative work. Sync, pause, and resume are non-destructive writes. Resource add updates the submitted resources; unlisted resources remain unchanged.

The provider-detail tool returns credential schema metadata, not credential values. Do not paste provider credentials into chat or any MCP tool argument. Defaults, examples, constants, and unknown schema extensions are removed before the schema reaches model context. hydradb_connector_connect accepts only a provider and returns /connectors?connect=<provider>. hydradb_connector_reconnect authorizes the connector and returns /connectors?open=<connector_id>; open the drawer and select Reconnect. Both flows set completed: false because the dashboard, not MCP, performs the credential-bearing request. HYDRADB_OAUTH_ISSUER selects the dashboard origin for both completion links and defaults to https://app.hydradb.com.

Graph tools (Cypher)

Hydra DB also runs property graphs you model and own end to end, queried in Cypher. This is a different product surface from the memory and knowledge above, and nothing crosses between them: hydradb_query cannot see graph data, and hydradb_graph_query cannot see memories.

Tool

What it does

hydradb_graph_query

Run Cypher — reads and writes

hydradb_graph_collections

List the graphs in a graph database

hydradb_graph_admin

Create a graph database; drop a collection or a database

hydradb_graph_query is annotated destructiveHint, because it runs arbitrary Cypher and DELETE is as reachable through it as MATCH. There is deliberately no separate read-only Cypher tool and no read-only mode: both would mean classifying Cypher text client-side to decide what to refuse, which is a heuristic — a promise the server can keep and a client cannot. This server does not inspect your query at all; it sends it and reports what HydraDB says. To lock the graph surface down, withhold the tools (below) — that is a real guarantee.

// Everyone Alice knows within four hops
{"query": "MATCH (a:Person {name:$n})-[:KNOWS*1..4]->(r) RETURN DISTINCT r.name AS name",
 "params": {"n": "Alice"}}

// Bulk load, re-runnable after a failure
{"query": "UNWIND $rows AS row MERGE (p:Person {ext_id: row.ext_id}) SET p += row",
 "params": {"rows": [{"ext_id": "a", "name": "Alice"}]}}

Differences from Neo4j worth knowing before you write Cypher. Each is rejected before execution, so a rejected query changes nothing and fails identically on retry:

  • Procedure calls (CALL db.*, CALL apoc.*) are rejected by the server, before it executes anything. CALL { ... } subqueries are fine. There is no schema tool and no apoc.meta.schema(); to learn a collection's structure, query it — MATCH (n) UNWIND labels(n) AS l RETURN l, count(*) AS c ORDER BY l.

  • LOAD CSV is rejected — pass data through params instead.

  • Existence checks are bare pattern predicates (WHERE (p)-[:KNOWS]->()); EXISTS { ... } and exists() are not accepted.

  • shortestPath belongs in RETURN/WITH, not MATCH p = ..., and must be directed.

  • EXPLAIN/PROFILE execute the query rather than planning it — do not use them to preview one.

Collections auto-create on first write, so there is no create-collection call. Requests are capped at 256 KiB (enforced locally, before upload) and large result sets are truncated server-side — paginate with ORDER BY ... SKIP $offset LIMIT $limit.

To turn the graph tools off entirely:

HYDRADB_MCP_GRAPH_TOOLS=0   # withhold all three

Deprecated aliases

The previous hydra_db_* tool names are no longer registered by default as of 1.2.0. If your mcp.json still calls them, set:

HYDRADB_MCP_LEGACY_TOOLS=1

Deprecated alias

Use instead

hydra_db_search

hydradb_query

hydra_db_store, hydra_db_ingest_conversation

hydradb_ingest

hydra_db_list_memories, hydra_db_list_sources

hydradb_list

hydra_db_fetch_content

hydradb_inspect

hydra_db_delete_memory

hydradb_delete

Database tools

Database tools are available over stdio, API-key HTTP, and OAuth HTTP connections. hydradb_databases marks the connection default. On a confined OAuth connection, it returns only approved databases, and every database tool refuses other names before sending an API request. A connection limited to specific collections cannot create or delete a whole database or change its database-wide metadata schema.

Tool

Required input

Notes

hydradb_databases

None

Lists accessible databases and marks the default

hydradb_database_create

database

Optional embeddings_dimension and database_metadata_schema; creation is asynchronous

hydradb_database_delete

database

Destructive. Refuses the connection default

hydradb_database_readiness

None

Optional database; poll until ready_for_ingestion is true

hydradb_database_stats

None

Optional database; returns knowledge and memory row counts

hydradb_database_schema_inspect

None

Optional database; returns declared field names and types

hydradb_database_schema_update

add_fields

Optional database; additive only, with no delete, rename, or retype

Metadata fields use name and data_type. Supported types are BOOL, INT8, INT16, INT32, INT64, FLOAT, DOUBLE, VARCHAR, and JSON. Optional settings are max_length, enable_match, enable_dense_embedding, and enable_sparse_embedding.

After hydradb_database_create accepts a request, call hydradb_database_readiness until the database is ready. A 403 from a write tool can indicate missing write permission. Read-only credentials cannot perform database writes; verify the credential's permissions or reconnect with write permission.

To turn the database management tools off entirely:

HYDRADB_MCP_DATABASE_TOOLS=0   # withhold the six database management tools

hydradb_databases, hydradb_list_collections and hydradb_delete_collection stay registered.

hydradb_query

Searches both memories and ingested knowledge sources. Returns matching chunks with their source id, a relevance score, and knowledge-graph context.

Parameter

Type

Required

Description

query

string

Yes

What you want to know, as a question or topic

kind

string

No

memory, knowledge, or all (default: all)

max_results

number

No

Maximum chunks to return (1-50, default: 10)

mode

string

No

fast, thinking (default), or auto

detail

string

No

compact (default) trims each chunk; full returns them whole

structured

boolean

No

Also return structuredContent (resolved_scope, request_id, sources with inspect_args). Default: false — text only

graph_context

boolean

No

Include knowledge-graph relations (default: true)

operator

string

No

or, and, or phrase. Switches the query to keyword retrieval (query_by=text), which is the only mode Hydra DB accepts an operator on — semantic matching is off for that query. Unset (the default) is hybrid semantic search

source_ids

array

No

Restrict the search to these sources

titles

array

No

Restrict to exact document titles (case-insensitive); resolved to source IDs before normal search

metadata_filters

object

No

Exact-match filters over stored metadata

num_related_chunks

number

No

Adjacent chunks to attach per match (0-5, default: 0)

recency_bias

number

No

Favour recently-updated sources when ranking, 0-1 (default: 0). Re-ranks only; it never excludes older sources

query_apps

boolean

No

App-aware retrieval over connector sources — exact IDs and actors, thread reconstruction, linked and parent/child items (on by default: Hydra DB applies it when omitted; pass false to skip)

collections

array

No

Search several collections at once. Pass either this or collection, never both

additional_context

string

No

Background text prepended to the query to steer retrieval; not searched for itself

alpha

number or auto

No

Hybrid balance, 0 (keyword) to 1 (vector), or auto (default: 0.8). Hybrid only: refused with operator or query_by: text

query_by

string

No

hybrid (default) or text (keyword only). Setting operator implies text

query_forceful_relations

boolean

No

In thinking mode, also follow relations declared at ingest and return their chunks

temporal_reasoning

boolean

No

Resolve time-based questions using dated facts (Hydra DB default: true)

response_format

string

No

structured (the default rendering, with source ids) or markdown (Hydra DB's own Markdown rendering, returned as-is, without per-chunk ids)

Results are text only by default: each chunk carries its source id and collection, and the header names the resolved scope. With structured: true, results also include structured resolved_scope and per-source inspect_args when the source's collection is known. Copy those arguments, including your ACL, to follow-up calls; tools never inherit a previous call's scope. With multiple collections, an ID alone is not enough: use the collection attached to that source. If it is missing, resolve the collection before inspecting. Explicit scope is never widened.

hydradb_ingest

Saves information so it outlives the session. Provide exactly one of text, turns, items, app_knowledge, or file. A batch contains 1 to 100 same-kind items and sends one API request. Batch text has an 8 MiB total UTF-8 limit.

Parameter

Type

Required

Description

text

string

No*

A note, fact, decision, or document body

turns

array

No*

Conversation turns, each with user and assistant

items

array

No*

Batch of 1 to 100 items; each item has exactly one of text or turns

app_knowledge

array

No*

Batch of 1 to 100 structured app records with kind, fields, and optional ACL data; split databases only

file

object

No*

A PDF, Word, PowerPoint, spreadsheet, image or text file, ingested as knowledge. See below

kind

string

No

memory (default) or knowledge for a document

title

string

No

Label shown in later search results — always set it

source_id

string

No

Identifier for this entry. Reusing one REPLACES what is stored under it

overwrite

boolean

No

Allow that replacement (default: true)

infer

boolean

No

Extract insights and graph entities (default: true)

is_markdown

boolean

No

Chunk on markdown structure (default: false)

metadata

object

No

Key/value metadata, matchable later via metadata_filters

additional_metadata

object

No

Free-form fields stored with the item; supported on memory and knowledge

custom_instructions

string

No

Memory extraction guidance, up to 4000 characters; replaces the MCP default and requires inference

graph

object

No

Caller-supplied entities and relations; MCP keys it by the item id

observation_date

string

No

When the fact was true, as YYYY-MM-DD (e.g. 2026-07-04), vs when it was stored

user_name

string

No

What to call the user, used with turns (default: User)

* Combining any input modes is an error. Each single item or items entry requires exactly one of text or turns. Knowledge items require text.

Use plain text with kind: "knowledge" for an unstructured document. Use app_knowledge for structured email, message, ticket, knowledge_base, comment, meeting, or custom records. Each app record supports id, title, description, url, timestamp, provider, external_id, fields, metadata, additional_metadata, attachments, relations, and acl.

An omitted app-record acl makes the item unrestricted. Send ["__private__"] for private ingest or ["__public__"] for public ingest. An empty list is refused. Re-ingesting an existing id without acl removes its previous access list. If __public__ appears with other principals, the item is public and HydraDB drops the other principals.

Files. file takes filename (with its real extension) and one of the two below. The document's title is title when set, otherwise the filename.

  • content_base64: the file's bytes as base64, up to 8 MB. Works on every transport, and is the only way on the hosted server, which cannot read your disk.

  • path: an absolute path to a file on your machine, up to 50 MB (the API's own limit). Local (stdio) server only: the bytes go straight to Hydra DB instead of through the conversation. The hosted server refuses it.

A larger file, or a format Hydra DB cannot read (.heic, .html, .zip, ...), is refused before anything is uploaded. source_id sets the document's id and overwrite applies as usual; infer, metadata and the other memory options do not apply to files.

To keep a file above the inline limit whole, use the local path option or send multipart POST /context/ingest directly.

Ingestion is asynchronous — content is not searchable the instant it is saved. Use hydradb_status to confirm.

Schemas for uploaded tables (preview). On an enabled organization, supply record_type on the same ingest call as the file. For example:

{
  "database": "finance",
  "collection": "statements",
  "file": { "filename": "october.csv", "content_base64": "..." },
  "record_type": {
    "name": "bank_transaction",
    "fields": {
      "date": { "type": "date", "required": true, "date_order": "DMY" },
      "description": "string",
      "debit": "decimal",
      "credit": "decimal"
    }
  }
}

Replace the placeholder with the file's base64 bytes. Use decimal for exact fixed-point amounts, with up to nine fractional digits. Subsequent uploads in that database can send "record_type": "bank_transaction". After indexing, call hydradb_inspect with the returned ID to see the inferred column mapping and rejected rows. For a PDF, table_extraction reports partial or unverified coverage. A table query over such rows carries the same warning. Use structured: true on hydradb_query to return table records and citations as JSON.

hydradb_update

Edits one existing item without re-ingesting it. Copy id from hydradb_query, hydradb_list, or hydradb_inspect; never guess an id.

Parameter

Type

Required

Description

id

string

Yes

Existing context id to edit

database_metadata

object

No*

Keys to merge into schema-controlled database metadata

additional_metadata

object

No*

Free-form keys to merge into additional metadata

acl

array or null

No*

Complete replacement ACL. [] or null makes the item private; ["__public__"] makes it public to identified callers; omission leaves access unchanged

* Provide at least one of database_metadata, additional_metadata, or acl. Metadata maps merge only the supplied keys. ACL updates replace the complete list, so include every principal that must retain access. The edit is idempotent. Retry the identical request if Hydra DB reports a partial commit or search-index synchronization failure.

hydradb_list

Enumerates memories, knowledge sources, or both together (kind: "all"). These are separate corpora: listing memories tells you nothing about which knowledge sources exist.

Parameter

Type

Required

Description

kind

string

Yes

memory, knowledge, or all (both in one page, as source rows)

ids

array

No

Restrict to these ids

source_ids

array

No

Deprecated alias for ids

external_id

string

No

Exact originating-system ID, such as a Confluence page ID or Drive file ID; knowledge only

parent_external_id

string

No

Exact provider parent ID; returns indexed direct children only. Requires kind: "knowledge", provider and connector_id

connector_id

string

No

Exact originating connector instance from stored additional_metadata.connector_id; required for parent lookup, optional for other knowledge lookups

url

string

No

Exact original URL stored at ingestion; knowledge only, not a live web fetch

provider

string

No

Connector provider, such as confluence or google_drive; knowledge only

page

number

No

Page to return, 1-indexed (default: 1)

page_size

number

No

Items per page (1-100)

metadata

object

No

Exact-match filter on each item's metadata, as {key: value}

additional_metadata

object

No

Exact-match filter on each item's additional_metadata; merged with connector_id

include_fields

array

No

Return only these fields per row (plus id): title, type, description, note, timestamp, relations, metadata, additional_metadata, context_category. Knowledge and all only

group_threads

boolean

No

Nest comments and replies under the item they belong to (default false). Knowledge and all only

The response reports how many of the total it showed and how to reach the rest.

For a known document link, resolve its provider ID or exact stored URL first, then use the returned HydraDB source ID with hydradb_inspect or hydradb_query.source_ids:

{
  "name": "hydradb_list",
  "arguments": {
    "kind": "knowledge",
    "external_id": "123456",
    "provider": "confluence",
    "database": "your_database",
    "collection": "your_collection"
  }
}

Supplied selectors are combined with AND and preserve the caller's permissions. URL matching does not normalize links, follow redirects or fetch external pages. Multiple sites or copies may match an ID; inspect the candidates and pagination. No visible match in a scope is not proof a document was never ingested. For a document known only by name, use hydradb_query.titles or ordinary search instead. These selectors are rejected for kind: "memory", never silently ignored.

To enumerate indexed children, resolve the parent first, then use parent_external_id with its provider ID, provider, connector_id, and the same database, collection and ACL. Provider IDs can repeat across sites/accounts; never guess a connector ID. Missing connector metadata needs investigation before safely enumerating children. Follow next_args while has_more is true. Returned identity fields (external_id, provider, parent_external_id, connector_id) are included when stored. For descendants, use each child's children_args, track visited identities, and inspect each document separately. This is not a live provider tree: absent/stale parent metadata, permissions or incomplete ingestion can omit children. hydradb_subgraph includes other relationships and bounded traversal; it is not an exhaustive child listing.

hydradb_inspect

Fetches one source's full content by id.

Parameter

Type

Required

Description

id

string

Yes

The source id, from hydradb_query or hydradb_list

source_id

string

No

Deprecated alias for id

mode

string

No

content (default), url for a download link, or both

offset

number

No

Character offset to read from (default: 0)

limit

number

No

Maximum characters to return (max 20000)

expiry_seconds

number

No

How long a url link stays valid

Long sources come back in slices, and binary sources are never inlined — you get their type and size, and mode: "url" returns a download link.

Text and structured output expose the same bounded slice. Follow next_args until has_more is false, keeping the same scope and ACL. Offsets count UTF-16 code units; a 125,000-character source needs seven default-size calls, not three. complete means the current response contains the whole text. Each slice re-fetches current content; compare content_sha256 and restart if it changes. There is no pinned snapshot across calls. Reading a document index does not read every linked document.

hydradb_feedback

Records whether a query's results were actually useful. Correlated to that query by its request_id, which hydradb_query prints at the end of its output — copy it verbatim, it cannot be guessed or reconstructed.

Parameter

Type

Required

Description

request_id

string

Yes

The id hydradb_query printed for the query being rated

feedback

string

No

What was wrong, missing or good, in plain words (max 8000)

rating

string

No

positive, negative or neutral

ground_truth_answer

string

No

The answer a correct system would have given

ground_truth_source_ids

string[]

No

Sources that actually contain the answer (max 100)

metadata

object

No

Your own string labels, e.g. an eval run name (max 20)

database, collection

string

No

Scope overrides

Send text, ground truth, or both — a submission with neither records nothing and is refused. Ground truth is worth far more than prose because it is machine-checkable: source_ids turns one submission into a retrieval judgement (did the query surface these, at what rank, at all?), which is recall measured on real traffic rather than on a benchmark that stops resembling production the day it is written.

Feedback never changes the result of the query it describes and never alters stored data. Rows are labelled source: agent, because everything reaching this server came from a model — agent feedback is a different population from human feedback and is separated at write time.

hydradb_relations

Returns the knowledge-graph relations Hydra DB extracted from stored content — (entity) —predicate→ (entity) triplets, each with the passage that evidences it — for one item, or for the whole collection when id is omitted (GET /context/relations).

Parameter

Type

Required

Description

id

string

No

The item to read, from hydradb_query or hydradb_list. Omit for the whole collection

kind

string

No

knowledge (default) or memory — the two graphs are separate

limit

number

No

Relations per call (default 50, max 200)

cursor

number

No

The next_cursor of the previous call, to read the next page

acl

array

No

Principals to answer as; only relations from sources they may see are returned

database, collection

string

No

Scope overrides

structuredContent carries each relation as {from, from_type, predicate, to, to_type, evidence, chunk_id}, plus has_more, next_cursor and ready-made next_args for the next page.

hydradb_subgraph

Returns the connected subgraph of one item: every item reachable from it through item-level links — explicit relations declared at ingest, a shared thread, parent/child hierarchy — traversed breadth-first. Use it when one result is not enough and you need what surrounds it: the rest of a Slack thread, the replies under a ticket, the documents a page links to.

Parameter

Type

Required

Description

id

string

Yes

The item to start from, from hydradb_query or hydradb_list

kind

string

No

knowledge (default) or memory — the two graphs are separate

depth

number

No

Hops to traverse (default 5, max 10)

max_sources

number

No

Cap on members returned (default 200, max 1000)

database, collection

string

No

Scope overrides

Each member carries its id, title, depth from the start item and how it was reached — discovered_relation is the mechanism (same_thread, parent, child, or a relates_to type such as reply_to) and discovered_via the id of the member it was reached from, so the list is also a tree. structuredContent carries those same members, in the same order, plus relations: the edges among them as {from, to, type}, so a client can rebuild the graph and not just the list. truncated means max_sources clipped the traversal; structural_link_count and structural_truncated report the structural graph (entities, comments, attachments, actors) around the members. Chunk-level entity relations are not included; those come from hydradb_query.

hydradb_delete

Removes items by id. Irreversible.

Parameter

Type

Required

Description

ids

array

No*

The ids to delete — accepts several at once

id

string

No*

A single id

kind

string

No

memory (default) or knowledge

* Provide one of them.

hydradb_status

Checks whether ingested sources have finished indexing.

Parameter

Type

Required

Description

ids

array

Yes

The source ids to check

Related MCP server: MCP-Mem0

Configuration

Get Your Credentials

  1. Get your Hydra DB API Key from Hydra DB

  2. Get your database name from the Hydra DB dashboard

Environment Variables

Variable

Description

Default

HYDRADB_API_KEY

Your Hydra DB API key

Required

HYDRADB_DATABASE

Your Hydra DB database (tenant scope)

Required

HYDRADB_COLLECTION

Collection (sub-tenant) for partitioning

none — unset means the workspace's own collection; the model can also name one per call via collection/collections (see hydradb_list_collections)

HYDRADB_BASE_URL

Base URL override

https://api.hydradb.com

HYDRADB_LOG_LEVEL

Log level: DEBUG, INFO, WARN, ERROR

ERROR

HYDRADB_TIMEOUT_SECONDS

Deadline for a whole tool call, every attempt and retry wait included

45

HYDRADB_MAX_RETRIES

Retries per request, inside that deadline (0 disables)

2

HYDRADB_MCP_LEGACY_TOOLS

Register the deprecated hydra_db_* tools

off

HYDRADB_GRAPH_DATABASE

Default graph database for the Cypher tools

HYDRADB_DATABASE

HYDRADB_GRAPH_COLLECTION

Default graph collection

default

HYDRADB_MCP_GRAPH_TOOLS

Register the graph tools (0 withholds them)

on

HYDRADB_MCP_CONNECTOR_TOOLS

Register the connector tools (0 withholds them)

on

HYDRADB_OAUTH_ISSUER

Authorization server and connector-completion dashboard origin

https://app.hydradb.com for connector links

HYDRADB_MCP_DATABASE_TOOLS

Register the database management tools (0 withholds them)

on

Timeouts, retries and cancellation

One deadline (HYDRADB_TIMEOUT_SECONDS, default 45s) covers a whole tool call, so with the defaults a call ends before the 60s most MCP hosts wait. When the deadline passes, the error names it and lists every attempt.

  • Reads are retried after 429, 408, 5xx and dropped connections.

  • Writes that are not safe to repeat (ingest, Cypher, feedback, creating or deleting a database or collection) are retried only when the failure shows Hydra DB did not act on them (429, 408, connection refused). After a 5xx, a dropped connection or the deadline, the error says the outcome is unknown: check before sending it again.

  • Retry-After (seconds or HTTP date) sets the wait. If the wait would end past the deadline, the call fails at once with Hydra DB's answer.

  • Cancelling a tool call stops the request in flight and starts no new attempt, on stdio and on the hosted HTTP server.

A graph database is a different namespace from the memory database: the same name can exist as both, and Cypher aimed at the wrong one reads an empty graph rather than failing. Every graph tool also takes database and collection per call, overriding these defaults.

The legacy HYDRA_DB_* names — HYDRA_DB_API_KEY, HYDRA_DB_TENANT_ID, HYDRA_DB_SUB_TENANT_ID, HYDRA_DB_BASE_URL, HYDRA_DB_LOG_LEVEL — remain honoured as deprecated aliases (canonical wins when both are set; using an alias prints a one-time warning naming its replacement).

Claude Desktop

{
  "mcpServers": {
    "hydradb": {
      "command": "npx",
      "args": ["-y", "@hydradb/mcp@latest"],
      "env": {
        "HYDRADB_API_KEY": "your-api-key",
        "HYDRADB_DATABASE": "your-database"
      }
    }
  }
}

Cursor & Windsurf

Client

Config File

Cursor

~/.cursor/mcp.json

Windsurf

~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "hydradb": {
      "command": "npx",
      "args": ["-y", "@hydradb/mcp@latest"],
      "env": {
        "HYDRADB_API_KEY": "your-api-key",
        "HYDRADB_DATABASE": "your-database"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json:

{
  "servers": {
    "hydradb": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@hydradb/mcp@latest"],
      "env": {
        "HYDRADB_API_KEY": "your-api-key",
        "HYDRADB_DATABASE": "your-database"
      }
    }
  }
}

Custom Sub-Tenant

To partition data, set the HYDRADB_COLLECTION environment variable:

{
  "mcpServers": {
    "hydradb": {
      "command": "npx",
      "args": ["-y", "@hydradb/mcp@latest"],
      "env": {
        "HYDRADB_API_KEY": "your-api-key",
        "HYDRADB_DATABASE": "your-database",
        "HYDRADB_COLLECTION": "my-project"
      }
    }
  }
}

Remote / hosted server

Everything above spawns the server locally over stdio. The same server also runs as a long-lived HTTP endpoint that many clients reach at one URL — nothing to install or update per user. This is what powers a hosted deployment like https://mcp.hydradb.com, and what you run yourself with npm run start:http or the Docker image.

The tool surface is identical; only how a client connects and authenticates changes.

Point a client at a URL

MCP clients that support a remote (streamable-http) server take a URL and headers instead of a command:

{
  "mcpServers": {
    "hydradb": {
      "url": "https://mcp.hydradb.com",
      "headers": {
        "Authorization": "Bearer YOUR_HYDRADB_API_KEY",
        "X-HydraDB-Database": "your-database"
      }
    }
  }
}

Every request carries its own credentials, so one hosted process serves any number of independent users. The headers a request may send:

Header

Maps to

Required

Authorization: Bearer <key>

Hydra DB API key (X-HydraDB-Api-Key also accepted)

Yes*

X-HydraDB-Database

Default database (tenant scope)

Yes*

X-HydraDB-Collection

Default collection (sub-tenant); unset means the workspace's own collection

No

X-HydraDB-Graph-Database

Default graph database for the Cypher tools; defaults to the request's database

No

X-HydraDB-Graph-Collection

Default graph collection; defaults to default

No

* Unless the server was started with HYDRADB_API_KEY / HYDRADB_DATABASE in its environment (single-tenant self-host, below), in which case a request may omit them and fall back to the server's own credentials. A request that supplies neither a header nor a server-side default is refused: 401 with no key, 400 with a key but no database.

Every tool additionally accepts optional database and collection parameters directly in its arguments (e.g. hydradb_query with {"query": "...", "database": "tenant_b"}), allowing multi-tenant agents to switch tenant scope per tool call while falling back to the session defaults when omitted.

Base URL, request timeout and retry count are operator settings read from the server's environment and are never taken from a request header.

Run the HTTP server

Node:

npm ci && npm run build
# Single-tenant: the server holds one account; clients send no credentials.
HYDRADB_API_KEY=your-key HYDRADB_DATABASE=your-database npm run start:http
# Multi-tenant: no account in the env; every client sends its own headers.
BIND_ADDRESS=0.0.0.0 ALLOWED_HOSTS=mcp.hydradb.com npm run start:http

Docker:

docker build -t hydradb-mcp .
# Single-tenant
docker run -p 8080:8080 -e HYDRADB_API_KEY=your-key -e HYDRADB_DATABASE=your-database hydradb-mcp
# Multi-tenant (clients authenticate per request)
docker run -p 8080:8080 -e ALLOWED_HOSTS=mcp.hydradb.com hydradb-mcp

The primary MCP endpoint is / (with /mcp supported as an alias); GET /health is an unauthenticated liveness probe. The image binds 0.0.0.0 inside the container (the host controls exposure with -p) and runs as an unprivileged user.

Sign in with HydraDB (OAuth)

With three extra variables the hosted server also speaks the MCP authorization flow: a client that arrives with no credentials gets a 401 pointing at protected-resource metadata, discovers the HydraDB dashboard as its authorization server, opens the browser, and the user signs in and picks a database. No key is ever pasted into a client.

Set all three OAuth variables to enable the flow:

HYDRADB_OAUTH_ISSUER=https://app.hydradb.example \
HYDRADB_MCP_PUBLIC_URL=https://company.internal/hydra/mcp \
HYDRADB_OAUTH_INTROSPECTION_SECRET=replace-me \
ALLOWED_HOSTS=company.internal \
npm run start:http

HYDRADB_MCP_PUBLIC_URL is the exact public MCP endpoint and OAuth resource. The server keeps / and /mcp, and also serves the configured pathname. It supports a reverse proxy that preserves /hydra/mcp, strips /hydra and sends /mcp, or strips the complete prefix and sends /.

The 401 challenge advertises metadata under the same public proxy prefix:

https://company.internal/hydra/mcp/.well-known/oauth-protected-resource

The server also serves the RFC 9728 section 3.1 path-inserted form for clients that construct it themselves:

https://company.internal/.well-known/oauth-protected-resource/hydra/mcp

Route both public metadata URLs to this server. A proxy that forwards only /hydra cannot deliver the origin-root RFC URL without an explicit route. All metadata aliases return resource: "https://company.internal/hydra/mcp". Token audience checks remain unchanged, including tolerance for a trailing slash on an otherwise equal audience.

The process fails before listening when a complete HYDRADB_MCP_PUBLIC_URL contains an unsupported layout, such as credentials, a query string, a fragment, a backslash, dot path segments, or percent-encoded path characters. The error names HYDRADB_MCP_PUBLIC_URL and the reason. Partial OAuth configuration keeps the existing behavior: the server warns and leaves OAuth disabled.

Variable

Description

HYDRADB_OAUTH_ISSUER

Authorization server and connector-completion dashboard origin, e.g. https://app.hydradb.com. Must match its NEXTAUTH_URL exactly for OAuth

HYDRADB_MCP_PUBLIC_URL

This server's public URL as clients see it, e.g. https://mcp.hydradb.com. Tokens minted for any other audience are refused

HYDRADB_OAUTH_INTROSPECTION_SECRET

Shared secret the issuer's /api/oauth/introspect expects; must equal the dashboard's MCP_INTROSPECTION_SECRET

All three are required together. With any of them missing, OAuth stays off and the server behaves exactly as before: no new routes, no new headers. Token introspection answers are memoised for up to 30 seconds, so disconnecting an app from the dashboard takes effect within that window.

OAuth is purely additive. API keys in Authorization / X-HydraDB-Api-Key headers, the X-HydraDB-Database header and the single-tenant environment fallback all keep working unchanged on the same URL.

Server environment variables

These configure the HTTP process itself (the stdio server ignores them). All the HYDRADB_* variables from Environment Variables also apply — as the single-tenant default and as operator settings.

Variable

Description

Default

PORT

Port to listen on

8080

BIND_ADDRESS

Interface to bind (0.0.0.0 to accept off-host)

127.0.0.1

ALLOWED_HOSTS

Extra Host headers to accept (comma-separated); loopback always allowed

(loopback only)

ALLOWED_ORIGINS

CORS origins for browser clients (comma-separated; * allows any)

(none)

TRUST_PROXY

Express trust proxy when behind a reverse proxy: a hop count, true, or a subnet preset (loopback)

off

Security

The defaults are safe for local use and must be widened deliberately for a public deployment — see SECURITY.md:

  • Bind loopback by default. BIND_ADDRESS stays 127.0.0.1 until you set otherwise; 0.0.0.0 exposes the server on every interface and logs a warning.

  • Host allowlist. Requests whose Host is not loopback or in ALLOWED_HOSTS get 421 Misdirected Request — a DNS-rebinding defence. Add your public hostname when binding publicly.

  • CORS is closed by default. No cross-origin browser request is accepted until you list its origin in ALLOWED_ORIGINS. Non-browser clients (no Origin header) are unaffected.

  • Terminate TLS in front. Run the server behind a reverse proxy / load balancer that handles HTTPS; do not expose plain HTTP to the internet.

How It Works

The server talks to Hydra DB through the generated @hydradb/sdk (pinned exactly), behind a thin hand-owned wrapper in src/hydra. The wrapper owns scope injection, envelope unwrapping and error translation; the tools call it and render the results.

  • hydradb_query retrieves relevant memories and returns graph-enriched context (entity paths, chunk relations, extra context). Supports fast and thinking recall modes.

  • hydradb_ingest stores a note (text), conversation (turns), file such as a PDF or DOCX (file), structured app records (app_knowledge), or a batch of up to 100 items. It supports caller extraction instructions, additional metadata, and a caller-supplied graph.

  • hydradb_list browses stored memories (kind: memory) or ingested knowledge sources (kind: knowledge, with an optional source_ids filter).

  • hydradb_inspect retrieves the original ingested content of a source, with mode options (content, url, or both).

  • hydradb_delete removes a memory or knowledge source by ID.

Development

npm ci
npm run build
HYDRADB_API_KEY=your-key HYDRADB_DATABASE=your-database npm start

For development with auto-reload:

HYDRADB_API_KEY=your-key HYDRADB_DATABASE=your-database npm run dev

To run the HTTP transport locally (see Remote / hosted server):

HYDRADB_API_KEY=your-key HYDRADB_DATABASE=your-database npm run dev:http
# then: curl localhost:8080/health

Testing

# unit + conformance tests (wrapper driven against a mocked SDK transport)
npm test

# just the shared conformance vectors
npm run test:conformance

# live integration test against Hydra DB (drives the wrapper end to end)
RUN_LIVE_TESTS=true HYDRADB_API_KEY=your-key HYDRADB_DATABASE=your-database npm run test:integration

Troubleshooting

  • API Key Issues: Ensure HYDRADB_API_KEY is set correctly

  • Connection Errors: Check your internet connection and API key validity

  • Tool Not Found: Make sure the package is installed and the command path is correct

  • Debug Logging: Set HYDRADB_LOG_LEVEL=DEBUG for verbose output

Contributing / Developer Setup

Get up and running quickly with the bootstrap script:

git clone https://github.com/usecortex/hydradb-mcp.git
cd hydradb-mcp
make bootstrap

This will install dependencies, build the project, and create a .env file from .env.example. Edit .env with your HydraDB credentials, then:

make dev          # Start MCP server in dev mode (auto-reload)
make test         # Run unit tests
make test-all     # Run unit + integration tests
make check-types  # Type-check without emitting

Run make help to see all available targets.

Available Tools

12 tools
hydradb_deleteDelete from Hydra DBB

Delete a memory or knowledge source from Hydra DB by its ID. Use kind to select which family the ID belongs to. This action is irreversible.

Inputs: id (required), kind.

hydra_db_delete_memoryDelete Memory (deprecated)A

DEPRECATED — use hydradb_delete instead. Delete a specific user memory from Hydra DB by its memory ID. This action is irreversible.

Inputs: memory_id (required).

hydra_db_fetch_contentFetch Source Content (deprecated)A
Read-onlyIdempotent

DEPRECATED — use hydradb_inspect instead. Fetch the full content of a specific source by its source ID from Hydra DB. Returns the original text content that was ingested. Use this to retrieve the complete content of a previously stored source.

Inputs: source_id (required), mode.

hydradb_ingestIngest into Hydra DBA

Save important information to Hydra DB State-of-the-art agentic memory. Use this to persist facts, preferences, decisions, notes, or any text the user wants remembered across sessions. Hydra DB automatically extracts insights, preferences, and builds a knowledge graph from the stored content. Supports plain text and markdown. To ingest a conversation instead of a single note, provide turns (user/assistant pairs) rather than text.

Inputs: text, infer, title, turns, +3 more.

hydra_db_ingest_conversationIngest Conversation (deprecated)A

DEPRECATED — use hydradb_ingest instead. Ingest one or more user-assistant conversation turns into Hydra DB memory. Hydra DB will extract insights, preferences, and knowledge graph entities from the conversation. Use this to store conversation history so it can be recalled later. Each turn is a pair of user message and assistant response.

Inputs: turns (required), source_id (required), user_name.

hydradb_inspectInspect Hydra DB SourceA
Read-onlyIdempotent

Fetch the full content of a specific source by its source ID from Hydra DB. Returns the original text content that was ingested. Use this to retrieve the complete content of a previously stored source.

Inputs: source_id (required), mode.

hydradb_listList Hydra DB ContextA
Read-onlyIdempotent

List stored memories or ingested knowledge sources in Hydra DB. Use kind to choose which family to browse.

Inputs: kind, source_ids.

hydra_db_list_memoriesList Memories (deprecated)A
Read-onlyIdempotent

DEPRECATED — use hydradb_list instead. List all stored user memories in Hydra DB. Returns memory IDs and their content. Use this to browse what has been stored, verify memories exist, or find memory IDs for deletion.

Inputs: no named parameters.

hydra_db_list_sourcesList Sources (deprecated)A
Read-onlyIdempotent

DEPRECATED — use hydradb_list instead. List all ingested sources in Hydra DB memory. Returns source IDs, titles, types, and metadata. Use this to see what data sources have been ingested and to find source IDs for fetching content.

Inputs: source_ids.

hydradb_queryQuery Hydra DBA
Read-onlyIdempotent

Search through Hydra DB State-of-the-art agentic memories. Returns relevant chunks with graph-enriched context including entity paths and knowledge graph relations. Use this to find previously stored information, past conversations, user preferences, or any knowledge that has been ingested into Hydra DB memory. Supports both fast semantic search and deeper thinking mode with graph traversal.

Inputs: query (required), mode, max_results, graph_context.

hydra_db_storeStore to Hydra DB Memory (deprecated)A

DEPRECATED — use hydradb_ingest instead. Save important information to Hydra DB State-of-the-art agentic memory. Use this to persist facts, preferences, decisions, notes, or any text the user wants remembered across sessions. Hydra DB automatically extracts insights, preferences, and builds a knowledge graph from the stored content. Supports plain text and markdown.

Inputs: text (required), infer, title, source_id, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 12 tools

    Disambiguation5/5

    The five current tools (hydradb_query, hydradb_ingest, hydradb_list, hydradb_inspect, hydradb_delete) each have a clear, distinct purpose. Deprecated tools are explicitly marked and can be ignored, so an agent can easily select the correct active tool.

    Naming Consistency2/5

    There are two naming conventions: current tools use 'hydradb_' prefix with a single verb, while deprecated tools use 'hydra_db_' prefix with varying verb_noun structures. This inconsistency and the presence of both sets create confusion.

    Tool Count4/5

    With 12 tools, many are deprecated duplicates. The effective set of 5 tools is well-scoped for a memory database server. The count is slightly bloated by deprecated items, but still reasonable.

    Completeness3/5

    The tool set covers create (ingest), read (query, list, inspect), and delete, but lacks an update/modify tool. This is a notable gap for full lifecycle management, though the surface is otherwise sufficient.

    Maintenance

    ActivityActive
    ResponsivenessMostly unanswered

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides local-first memory storage and retrieval with automatic embedding, vector search, and knowledge graph capabilities. Enables agents to store memories locally and retrieve relevant context through hybrid search with optional Neo4j graph traversal.
      -
    • A
      license
      Not graded
      quality
      Not graded
      maintenance
      Provides AI agents with persistent long-term memory capabilities using semantic search. Enables storing, retrieving, and searching memories through three core tools integrated with Mem0 and vector storage.
      MIT