Skip to main content

Quick Start

The fastest way in is Sign in with HydraDB: add one URL to your AI app and approve it in the browser. No API key needed.

Authenticating to the remote server

There are two ways to authenticate against https://mcp.hydradb.com, and the same URL serves both.

Sign in with HydraDB (OAuth)

Point your client at the URL with no credentials and it discovers the sign-in flow on its own: the server answers 401 with a pointer to its metadata, your client registers itself, and opens your browser. You sign in, choose a database, and approve. Your client stores a token that it refreshes silently, and you never handle a key. Disconnect any app from Connected apps in Settings. Its access ends within 30 seconds, once the server’s cached token check expires.

API key headers

Every request carries its own credentials, so one server serves any number of independent users. Send them as headers: * Required with an API key. Not needed, and not read, with an OAuth token. A request that authenticates nobody is refused with 401, and that refusal is what starts the sign-in flow for clients that support it. A request that carries an API key but names no database is refused with 400; an OAuth token needs no database header, because the database was chosen when you approved the app.
The API key and database resolve together: a request that supplies its own key must also supply its own X-HydraDB-Database, so your key is never paired with another tenant’s data. The base URL, request timeout, and retry count are operator settings on the server and are never read from a request header.
Per-call tenant switching: Multi-tenant agents serving multiple companies from a single session can pass database and collection directly in tool arguments (e.g. hydradb_query with {"query": "...", "database": "tenant_b"}). When omitted, calls fall back to the connection’s default scope: the X-HydraDB-Database / X-HydraDB-Collection headers for an API key, or what you approved for an OAuth connection.On an OAuth connection you approved with other databases not allowed, a per-call database or collection outside that scope is refused before the request leaves the server, and hydradb_databases shows what the connection may use.

Self-hosting the HTTP server

Prefer to run the remote server yourself instead of using mcp.hydradb.com? Use the npm binary or the Docker image. Set HYDRADB_API_KEY and HYDRADB_DATABASE in the environment for a single-tenant server (clients then send no credentials), or leave them unset for a multi-tenant one where every client authenticates with its own headers.
The primary endpoint is POST / (with /mcp supported as an alias); GET /health is an unauthenticated liveness probe.
The defaults are loopback-only. When you expose the server publicly, bind 0.0.0.0 deliberately, set ALLOWED_HOSTS to your hostname, list any browser origins in ALLOWED_ORIGINS, and terminate TLS in front of it. For a shared, public server, leave HYDRADB_API_KEY unset so every caller must authenticate with their own key rather than sharing yours.

Configuration

Environment Variables

The HYDRA_DB_* spellings still work. Each one is read as a deprecated alias of its canonical name and prints a single warning to stderr naming the replacement; if both are set, the canonical name wins.See the Glossary for why tenant became database.

Collections

Use HYDRADB_COLLECTION to partition data across projects within one database:
Give each project its own HYDRADB_COLLECTION to keep memory isolated, or point several projects at the same value to share context between them. Unset, the API uses your workspace’s own collection. To keep the old shared behavior, set it to hydra-db-mcp.

Available Tools

See the Glossary for database and collection terminology.

hydradb_query

Filtering by document title

Use titles when you know document names but not their source IDs. The titles are resolved to source IDs first, then the normal semantic or keyword query runs inside those sources.
  • Exact, complete titles: last-usage does not match last-usage.csv.
  • Case-insensitive: q3 roadmap.md matches Q3 Roadmap.md.
  • Several titles are ORed: Surrounding whitespace is trimmed; punctuation such as commas is part of the title.
  • No match returns an empty result rather than widening to the whole corpus.
Because matching ignores case, two documents whose names differ only by case (Report.md and report.md) are treated as the same title and both are returned.

hydradb_ingest

Provide exactly one of text or turns. Passing both is rejected.

hydradb_list

hydradb_inspect

hydradb_delete

hydradb_delete is irreversible.
A knowledge source cannot be deleted while it is still being indexed: the server refuses with “Source is still processing; retry deletion after ingestion completes”, and the tool passes that back rather than reporting a deletion that did not happen. Retry once ingestion finishes. This applies to freshly ingested sources only; a source is listable and inspectable before it is deletable.

hydradb_list_collections

hydradb_delete_collection

Permanently removes one collection and every memory, knowledge source, and graph node inside it. The parent database is left intact.

hydradb_status

hydradb_databases

Available on connections made with Sign in with HydraDB. Takes no parameters. Lists the databases this connection can address and marks the one it uses by default, so an agent working across several databases can find their names without asking you. If you approved the app with other databases not allowed, the list has one entry and any other name is refused.

Graph tools (BYOG openCypher)

HydraDB MCP also exposes property graph tools for querying and writing domain graphs in openCypher:
  • hydradb_graph_query: Run Cypher reads and writes (CREATE, MERGE, MATCH, traversals).
    • Parameters: query (string, required), params (object), database (string), collection (string), max_rows (number).
  • hydradb_graph_collections: List graph collections in a database.
    • Parameters: database (string).
  • hydradb_graph_admin: Manage graph databases and collections.
    • Parameters: action (create_database, drop_collection, drop_database), database (string), collection (string).

Deprecated tool names

The older hydra_db_* tool names are off by default. Set HYDRADB_MCP_LEGACY_TOOLS=1 on the server to register them again; each is marked deprecated so your agent prefers the canonical name. Use the canonical names in new integrations.

Source code

hydradb-mcp

View the source on GitHub.