Navigate your Aiven projects and interact with the PostgreSQL®, Apache Kafka®, ClickHouse® and OpenSearch® services
This document details the Aiven Model Context Protocol (MCP) server, a crucial component for bridging the gap between Large Language Models (LLMs) and the rich ecosystem of Aiven services. By leveraging MCP, developers can create intelligent, context-aware applications that seamlessly interact with Aiven for PostgreSQL, Kafka, ClickHouse, Valkey, OpenSearch, and their associated native connectors. This enables the development of comprehensive, full-stack AI solutions tailored to diverse use cases.
The Aiven MCP server provides a suite of powerful tools designed to expose Aiven's capabilities to LLMs:
list_projects
: Retrieves a comprehensive list of all projects associated with your Aiven account. This allows LLMs to understand the organizational structure of your Aiven resources.list_services
: Enumerates all services within a specified Aiven project. This provides LLMs with a detailed inventory of available resources for a given project.get_service_details
: Fetches detailed configuration and status information for a specific Aiven service within a project. This enables LLMs to understand the capabilities and current state of individual services.The Aiven MCP server is designed for easy integration with popular LLM development environments, including Claude Desktop and Cursor. The following sections provide detailed configuration instructions for each platform.
Locate the Configuration File: The Claude Desktop configuration file is located in the following directories:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the MCP Server Configuration: Insert the following JSON snippet into the mcpServers
section of the configuration file:
{ "mcpServers": { "mcp-aiven": { "command": "uv", "args": [ "--directory", "$REPOSITORY_DIRECTORY", "run", "--with-editable", "$REPOSITORY_DIRECTORY", "--python", "3.13", "mcp-aiven" ], "env": { "AIVEN_BASE_URL": "https://api.aiven.io", "AIVEN_TOKEN": "$AIVEN_TOKEN" } } } }
Environment Variable Configuration: Update the following environment variables to reflect your specific environment:
$REPOSITORY_DIRECTORY
: The absolute path to the directory containing the Aiven MCP server repository.$AIVEN_TOKEN
: Your Aiven authentication token. You can generate a token from the Aiven console as described here.uv
Executable Path: Locate the command
entry for uv
and replace it with the absolute path to the uv
executable. This ensures that Claude Desktop uses the correct version of uv
. You can determine the path using the which uv
command on macOS or by examining your system's environment variables.
Restart Claude Desktop: Restart Claude Desktop to apply the configuration changes.
Access Cursor Settings: Navigate to Cursor -> Settings -> Cursor Settings
.
Select MCP Servers: Choose the "MCP Servers" option.
Add a New Server: Create a new server with the following configuration:
mcp-aiven
command
uv --directory $REPOSITORY_DIRECTORY run --with-editable $REPOSITORY_DIRECTORY --python 3.13 mcp-aiven
Replace $REPOSITORY_DIRECTORY
with the actual path to the Aiven MCP server repository.
Environment Variables (Optional): You may need to add the AIVEN_BASE_URL
, AIVEN_PROJECT_NAME
, and AIVEN_TOKEN
environment variables within the Cursor settings, depending on your environment configuration.
To contribute to the Aiven MCP server or to customize it for your specific needs, follow these steps to set up your development environment:
Environment Variables: Create a .env
file in the root directory of the repository and add the following variables:
AIVEN_BASE_URL=https://api.aiven.io
AIVEN_TOKEN=$AIVEN_TOKEN
Replace $AIVEN_TOKEN
with your actual Aiven API token.
Install Dependencies: Run uv sync
to install the required dependencies. If you don't have uv
installed, follow the instructions here. After installation, activate the virtual environment using source .venv/bin/activate
.
Run the MCP Server: For testing purposes, you can start the MCP server using the command mcp dev mcp_aiven/mcp_server.py
.
The Aiven MCP server relies on the following environment variables for proper configuration:
AIVEN_BASE_URL
: The base URL of the Aiven API endpoint (e.g., https://api.aiven.io
).AIVEN_TOKEN
: Your Aiven authentication token, granting access to your Aiven resources.When integrating LLMs with external systems via MCPs, it's paramount to understand the shared responsibility model and the associated security implications.
Self-Managed MCPs: User Responsibility
AI Agent Security: A Focus on Permissions
API Token Best Practices: Minimizing Risk
Key Takeaways: A Summary of Responsibilities
By carefully considering these security implications and adhering to best practices, developers can leverage the power of LLMs and Aiven services while maintaining a robust security posture.
🐍 ☁️ Biomedical research server providing access to PubMed, ClinicalTrials.gov, and MyVariant.info.
🐍 MCP server that provides SQL analysis, linting, and dialect conversion using [SQLGlot](https://github.com/tobymao/sqlglot)
🐍 🏠 All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks
Supabase MCP Server with support for SQL query execution and database exploration tools