MCP server
Connect an AI agent to TeselaDB with the MongoDB MCP Server tools.
Every node has a Model Context Protocol server. It has the database tools of MongoDB MCP Server with the same names
and arguments: find, aggregate, count, insert-many, update-many, delete-many, create-index,
collection-indexes, collection-schema and the rest.
Requirements
- An API key created with
teseladb admin apikey createfor a user with the roles the agent needs. - Access from the MCP client to port 27080 of a node.
Two ways to connect
- Streamable HTTP at
https://<node>:27080/mcp, with an API key inAuthorization: Bearer. - stdio with
teseladb mcp, which forwards to the HTTP port. The credential goes in theTESELADB_API_KEYenvironment variable, never in the arguments.
JSON
{
"mcpServers": {
"teseladb": {
"command": "teseladb",
"args": ["mcp", "--uri", "https://node-01:27080"],
"env": { "TESELADB_API_KEY": "tdb_…" }
}
}
}Read-only by default
The MCP server starts read-only: the tools that write are not available until you turn them on with the mcpOptions
cluster parameter. aggregate rejects $out and $merge. The audit log records every call, and each tool checks the
privileges of the equivalent command with the key's roles before it runs.
Check
The MCP client lists the tools of the server. In the default mode, only the ones that read appear.
Common problems
- The client does not see the tools that write because the server starts read-only. Turn them on with the
mcpOptionscluster parameter. aggregaterefuses a pipeline with$outor$merge, which the MCP server does not accept.
See also
- Connect an agent with MCP, a step-by-step guide.
- REST API, which uses the same API keys.