GitHub - Aiven-Open/mcp-aiven: Model Context Protocol server for Aiven (original) (raw)

Aiven MCP Server

A Model Context Protocol (MCP) server for Aiven.

This provides access to the Aiven for PostgreSQL, Kafka, ClickHouse, Valkey and OpenSearch services running in Aiven and the wider Aiven ecosystem of native connectors. Enabling LLMs to build full stack solutions for all use-cases.

Features

Tools

Configuration for Claude Desktop

  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-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" } } } }

Update the environment variables:

  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.

Configuration for Cursor

  1. Navigate to Cursor -> Settings -> Cursor Settings
  2. Select "MCP Servers"
  3. Add a new server with
    • Name: mcp-aiven
    • Type: command
    • Command: uv --directory <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>R</mi><mi>E</mi><mi>P</mi><mi>O</mi><mi>S</mi><mi>I</mi><mi>T</mi><mi>O</mi><mi>R</mi><msub><mi>Y</mi><mi>D</mi></msub><mi>I</mi><mi>R</mi><mi>E</mi><mi>C</mi><mi>T</mi><mi>O</mi><mi>R</mi><mi>Y</mi><mi>r</mi><mi>u</mi><mi>n</mi><mo>−</mo><mo>−</mo><mi>w</mi><mi>i</mi><mi>t</mi><mi>h</mi><mo>−</mo><mi>e</mi><mi>d</mi><mi>i</mi><mi>t</mi><mi>a</mi><mi>b</mi><mi>l</mi><mi>e</mi></mrow><annotation encoding="application/x-tex">REPOSITORY_DIRECTORY run --with-editable </annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8333em;vertical-align:-0.15em;"></span><span class="mord mathnormal" style="margin-right:0.05764em;">REPOS</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">TOR</span><span class="mord"><span class="mord mathnormal" style="margin-right:0.22222em;">Y</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.3283em;"><span style="top:-2.55em;margin-left:-0.2222em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight" style="margin-right:0.02778em;">D</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal" style="margin-right:0.00773em;">RECTOR</span><span class="mord mathnormal" style="margin-right:0.22222em;">Y</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">u</span><span class="mord mathnormal">n</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.0833em;"></span><span class="mord">−</span><span class="mord mathnormal" style="margin-right:0.02691em;">w</span><span class="mord mathnormal">i</span><span class="mord mathnormal">t</span><span class="mord mathnormal">h</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">e</span><span class="mord mathnormal">d</span><span class="mord mathnormal">i</span><span class="mord mathnormal">t</span><span class="mord mathnormal">ab</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">e</span></span></span></span>REPOSITORY_DIRECTORY --python 3.13 mcp-aiven

Where $REPOSITORY_DIRECTORY is the path to the repository. You might need to add the AIVEN_BASE_URL, AIVEN_PROJECT_NAME and AIVEN_TOKEN as variables

Development

  1. Add the following variables to a .env file in the root of the repository.
AIVEN_BASE_URL=https://api.aiven.io
AIVEN_TOKEN=$AIVEN_TOKEN
  1. Run uv sync to install the dependencies. To install uv follow the instructions here. Then do source .venv/bin/activate.
  2. For easy testing, you can run mcp dev mcp_aiven/mcp_server.py to start the MCP server.

Environment Variables

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

Required Variables

Developer Considerations for Model Context Protocols (MCPs) and AI Agents

This section outlines key developer responsibilities and security considerations when working with Model Context Protocols (MCPs) and AI Agents within this system.Self-Managed MCPs:

AI Agent Security:

API Token Best Practices:

Key Takeaways: