Skip to main content

An MCP server for MonkDB

Project description

MonkDB MCP Server

Python Stable Version Last Updated

An MCP (Modular Command Protocol) server for interacting with MonkDB, enabling Claude like LLMs to execute database-related tools such as querying, table inspection, and server health checks.

Features

Tools

  • run_select_query

    • Execute SQL queries on your MonkDB cluster.
    • Input: sql (string): The SQL query to execute.
    • Rejects non-select queries
  • list_tables

    • List all tables in monkdb schema.
  • health_check

    • Does a health check ping on MonkDB.
    • Returns either ok or an error message.
  • get_server_version

    • Returns the server version of MonkDB.
  • describe_table

    • Describe a table's columns in MonkDB.

Configuration

  1. Open the Claude Desktop configuration file located at:

    • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • On Windows: %APPDATA%/Claude/claude_desktop_config.json
  2. Add the following:

{
  "mcpServers": {
    "mcp-monkdb": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-monkdb",
        "--python",
        "3.13",
        "mcp-monkdb"
      ],
      "env": {
        "MONKDB_HOST": "<monkdb-host>",
        "MONKDB_API_PORT": "<monkdb-port>",
        "MONKDB_USER": "<monkdb-user>",
        "MONKDB_PASSWORD": "<monkdb-password>",
      }
    }
  }
}

Update the environment variables to point to your own MonkDB cluster.

  1. Locate the command entry for uv and replace it with the absolute path to the uv executable. This ensures that the correct version of uv is used when starting the server. On a mac, you can find this path using which uv.

  2. Restart Claude Desktop to apply the changes.

Note: you may also use poetry instead of uv.

"mcpServers": {
  "mcp-monkdb": {
    "command": "poetry",
    "args": [
      "run",
      "python",
      "-m",
      "mcp_monkdb"
    ],
    "env": {
      "MONKDB_HOST": "<monkdb-host>",
      "MONKDB_API_PORT": "<monkdb-port>",
      "MONKDB_USER": "<monkdb-user>",
      "MONKDB_PASSWORD": "<monkdb-password>"
    }
  }
}

Environment Variables

The following environment variables are used to configure the MonkDB connection:

Required Variables

  • MONKDB_HOST: The hostname of your MonkDB server
  • MONKDB_USER: The username for authentication
  • MONKDB_PASSWORD: The password for authentication
  • MONKDB_API_PORT: The API port of MonkDB which is 4200.

[!CAUTION] It is important to treat your MCP database user as you would any external client connecting to your database, granting only the minimum necessary privileges required for its operation. The use of default or administrative users should be strictly avoided at all times.

Optional Variables

  • MONKDB_SCHEMA: The schema of MonkDB. By default, MonkDB provides a universal schema monkdb under which tables are created. Access to these tables are restricted by RBAC policies provided by MonkDB.

Example Configurations

MONKDB_HOST=xx.xx.xx.xxx #update the hostname or ip address of monkdb
MONKDB_USER=testuser
MONKDB_PASSWORD=testpassword
MONKDB_API_PORT=4200

# Not needed as by default it is monkdb.
MONKDB_SCHEMA=monkdb

You can set these variables in your environment, in a .env file, or in the Claude Desktop configuration:

{
  "mcpServers": {
    "mcp-monkdb": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "mcp-monkdb",
        "--python",
        "3.13",
        "mcp-monkdb"
      ],
      "env": {
        "MONKDB_HOST": "<monkdb-host>",
        "MONKDB_API_PORT": "<monkdb-port>",
        "MONKDB_USER": "<monkdb-user>",
        "MONKDB_PASSWORD": "<monkdb-password>",
      }
    }
  }
}

Running tests

cd in to mcp_monkdb folder and then run the below command to execute unit tests.

python3 -m unittest discover -s tests 

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_monkdb-0.1.2.tar.gz (27.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_monkdb-0.1.2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_monkdb-0.1.2.tar.gz.

File metadata

  • Download URL: mcp_monkdb-0.1.2.tar.gz
  • Upload date:
  • Size: 27.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for mcp_monkdb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 f179dab4c97170671ec9eb2cfcce8758cbd8f54b24f0adaaf09f2b22d47f865e
MD5 9cb56e7ad23fff92cfbaa15531a7c3ca
BLAKE2b-256 12e7870ffb2e0b9654f3035fd7e4bf2fbdb41ec88c658a4f3928fdaa88bf2cbe

See more details on using hashes here.

File details

Details for the file mcp_monkdb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: mcp_monkdb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.1 CPython/3.13.2 Darwin/24.5.0

File hashes

Hashes for mcp_monkdb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eb15d33b09dc34b21a6270a63b31d932deef92f562906e7a812fe4b3b8d6746e
MD5 28674ed9558e8bdaa26476c40b036f31
BLAKE2b-256 d06a5be89ac812f375f29c80a0d5d16d8659b9ba84a96438731344924e50539f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page