|
| 1 | +--- |
| 2 | +title: Manage Aiven services using MCP |
| 3 | +sidebar_label: Aiven MCP server |
| 4 | +--- |
| 5 | + |
| 6 | +import Tabs from '@theme/Tabs'; |
| 7 | +import TabItem from '@theme/TabItem'; |
| 8 | +import CodeBlock from '@theme/CodeBlock'; |
| 9 | +import {cursorDeepLink, mcpUrl} from '@site/src/components/mcpAivenLiveConstants'; |
| 10 | + |
| 11 | +Use the Aiven Model Context Protocol (MCP) server to create and manage Aiven services from |
| 12 | +AI assistants, such as Cursor and Claude Code. |
| 13 | + |
| 14 | +## Prerequisites |
| 15 | + |
| 16 | +- An [Aiven account](https://console.aiven.io/signup) |
| 17 | +- An organization with MCP access enabled |
| 18 | +- An MCP-compatible client, such as Cursor, Claude Code, Claude Desktop, or |
| 19 | + Visual Studio Code |
| 20 | + |
| 21 | +## MCP server URL |
| 22 | + |
| 23 | +Use the following server URL when configuring your client: |
| 24 | + |
| 25 | +<CodeBlock language="text">{mcpUrl}</CodeBlock> |
| 26 | + |
| 27 | +## Configure your MCP client |
| 28 | + |
| 29 | +<Tabs groupId="mcp-clients"> |
| 30 | +<TabItem value="cursor" label="Cursor" default> |
| 31 | + |
| 32 | +<!-- vale off --> |
| 33 | +<a |
| 34 | + href={cursorDeepLink} |
| 35 | + style={{display: 'inline-flex', alignItems: 'center', gap: '10px', padding: '10px 20px', backgroundColor: '#2d2d2d', color: 'white', borderRadius: '8px', textDecoration: 'none', fontSize: '16px', fontWeight: 500, border: 'none', lineHeight: '20px'}} |
| 36 | +> |
| 37 | + <svg |
| 38 | + xmlns="http://www.w3.org/2000/svg" |
| 39 | + width="20" |
| 40 | + height="20" |
| 41 | + viewBox="0 0 24 24" |
| 42 | + fill="none" |
| 43 | + aria-hidden="true" |
| 44 | + focusable="false" |
| 45 | + style={{display: 'block', flex: 'none'}} |
| 46 | + > |
| 47 | + <path d="M21 7.5L12 2L3 7.5M21 7.5L12 13M21 7.5V16.5L12 22M3 7.5L12 13M3 7.5V16.5L12 22M12 13V22" stroke="currentColor" strokeWidth="2" strokeLinejoin="round" strokeLinecap="round"/> |
| 48 | + </svg> |
| 49 | + <span>Add to Cursor</span> |
| 50 | +</a> |
| 51 | +<!-- vale on --> |
| 52 | +
|
| 53 | +<br /><br /> |
| 54 | + |
| 55 | +To add the server manually: |
| 56 | + |
| 57 | +1. In your project root, create or edit `.cursor/mcp.json`. |
| 58 | +1. Add the following configuration: |
| 59 | + |
| 60 | + <!-- vale off --> |
| 61 | + <CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 62 | + <!-- vale on --> |
| 63 | + |
| 64 | +1. Save the file. |
| 65 | +1. Restart Cursor. |
| 66 | +1. Open **Settings** > **Tools & MCP**. |
| 67 | +1. Select **aiven** and click **Connect**. |
| 68 | + |
| 69 | +</TabItem> |
| 70 | +<TabItem value="claude-code" label="Claude Code"> |
| 71 | + |
| 72 | +1. Open a terminal. |
| 73 | +1. Run the following command: |
| 74 | + |
| 75 | + <CodeBlock language="bash">{`claude mcp add --transport http aiven ${mcpUrl}`}</CodeBlock> |
| 76 | + |
| 77 | +1. Run `/mcp` in Claude Code to verify the server is registered. |
| 78 | +1. The first time you use the server, your browser opens. |
| 79 | +1. Sign in to Aiven and select your organization. |
| 80 | + |
| 81 | +For more information, see the [Claude Code MCP documentation](https://docs.anthropic.com/en/docs/claude-code/tutorials/set-up-mcp). |
| 82 | + |
| 83 | +</TabItem> |
| 84 | +<TabItem value="claude-desktop" label="Claude Desktop"> |
| 85 | + |
| 86 | +1. Open the Claude Desktop configuration file. If it does not exist, create it: |
| 87 | + |
| 88 | + - **macOS:** |
| 89 | + `~/Library/Application Support/Claude/claude_desktop_config.json` |
| 90 | + |
| 91 | + - **Windows:** |
| 92 | + `%APPDATA%\Claude\claude_desktop_config.json` |
| 93 | + |
| 94 | +1. Add the following configuration to the file: |
| 95 | + |
| 96 | + <!-- vale off --> |
| 97 | + <CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 98 | + <!-- vale on --> |
| 99 | + |
| 100 | +1. Save the file and restart Claude Desktop. |
| 101 | + |
| 102 | +For more information, see the [Claude Desktop MCP documentation](https://modelcontextprotocol.io/quickstart/user). |
| 103 | + |
| 104 | +</TabItem> |
| 105 | +<TabItem value="vscode" label="VS Code"> |
| 106 | + |
| 107 | +:::note |
| 108 | +Requires Visual Studio Code 1.102 or later with the GitHub Copilot extension installed |
| 109 | +and enabled. |
| 110 | +::: |
| 111 | + |
| 112 | +1. Open your workspace in Visual Studio Code. |
| 113 | +1. In the workspace root, create a `.vscode` directory if it does not exist. |
| 114 | +1. In the `.vscode` directory, create or edit `mcp.json`. |
| 115 | +1. Add the following configuration: |
| 116 | + |
| 117 | + <!-- vale off --> |
| 118 | + <CodeBlock language="json">{JSON.stringify({servers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 119 | + <!-- vale on --> |
| 120 | + |
| 121 | +1. Save the file. |
| 122 | +1. Reload Visual Studio Code. |
| 123 | +1. Open the Command Palette and run **MCP: List Servers**. |
| 124 | +1. Confirm that **aiven** appears in the list. |
| 125 | + |
| 126 | +For more information, see the [VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers). |
| 127 | + |
| 128 | +</TabItem> |
| 129 | +<TabItem value="other" label="Other clients"> |
| 130 | + |
| 131 | +1. Open your MCP client configuration. |
| 132 | +1. Add the Aiven MCP server using the following URL: |
| 133 | + |
| 134 | + <CodeBlock language="text">{mcpUrl}</CodeBlock> |
| 135 | + |
| 136 | +Most clients use a configuration similar to: |
| 137 | + |
| 138 | +<!-- vale off --> |
| 139 | +<CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 140 | +<!-- vale on --> |
| 141 | + |
| 142 | +1. Save the file and restart your client. |
| 143 | + |
| 144 | +Some clients require a transport type, such as `"type": "http"`. If the configuration |
| 145 | +fails, see your client documentation. |
| 146 | + |
| 147 | +</TabItem> |
| 148 | +</Tabs> |
| 149 | + |
| 150 | +## Verify the connection |
| 151 | + |
| 152 | +<Tabs groupId="mcp-clients"> |
| 153 | +<TabItem value="cursor" label="Cursor" default> |
| 154 | + |
| 155 | +1. Open Cursor Chat with **Cmd+L** on macOS or **Ctrl+L** on Windows/Linux. |
| 156 | +1. Try a prompt such as: |
| 157 | + |
| 158 | + > List my Aiven projects. |
| 159 | +
|
| 160 | +1. If prompted to allow tool execution, click **Allow**. |
| 161 | +1. To confirm the server is registered, go to **Settings** > **Tools & MCP** and |
| 162 | + check that **aiven** appears with a connected status. |
| 163 | + |
| 164 | +</TabItem> |
| 165 | +<TabItem value="claude-code" label="Claude Code"> |
| 166 | + |
| 167 | +1. Run `/mcp` in Claude Code to verify the server is registered. |
| 168 | +1. Try a prompt such as: |
| 169 | + |
| 170 | + > List my Aiven projects. |
| 171 | +
|
| 172 | +1. If your client prompts you to allow tool execution, approve the request. |
| 173 | + |
| 174 | +</TabItem> |
| 175 | +<TabItem value="claude-desktop" label="Claude Desktop"> |
| 176 | + |
| 177 | +1. Open a new conversation. |
| 178 | +1. Verify that the MCP tools icon appears in the input area. |
| 179 | +1. Try a prompt such as: |
| 180 | + |
| 181 | + > List my Aiven projects. |
| 182 | +
|
| 183 | +1. If prompted to allow tool execution, click **Allow**. |
| 184 | + |
| 185 | +</TabItem> |
| 186 | +<TabItem value="vscode" label="VS Code"> |
| 187 | + |
| 188 | +1. Open Copilot Chat in Visual Studio Code. |
| 189 | +1. Open the Command Palette and run **MCP: List Servers**. |
| 190 | +1. Confirm that **aiven** appears in the list. |
| 191 | +1. Try a prompt such as: |
| 192 | + |
| 193 | + > List my Aiven projects. |
| 194 | +
|
| 195 | +1. If prompted to allow tool execution, click **Allow**. |
| 196 | + |
| 197 | +</TabItem> |
| 198 | +<TabItem value="other" label="Other clients"> |
| 199 | + |
| 200 | +1. Open your AI assistant. |
| 201 | +1. Try a prompt such as: |
| 202 | + |
| 203 | + > List my Aiven projects. |
| 204 | +
|
| 205 | +1. If your client prompts you to allow tool execution, approve the request. |
| 206 | +1. Verify that the response includes information about your Aiven projects. |
| 207 | + |
| 208 | +</TabItem> |
| 209 | +</Tabs> |
| 210 | + |
| 211 | +## Authentication |
| 212 | + |
| 213 | +The Aiven MCP server uses OAuth 2.0 with Proof Key for Code Exchange (PKCE) for |
| 214 | +authentication. The first time you use the server, your browser opens so you can sign in |
| 215 | +to Aiven and select your organization. The server refreshes tokens automatically. |
| 216 | + |
| 217 | +## Security and responsibility |
| 218 | + |
| 219 | +:::warning |
| 220 | +MCP tools can perform destructive operations on your Aiven services, including |
| 221 | +creating, modifying, and deleting services, databases, topics, and data. AI agents can |
| 222 | +run operations from natural language prompts that are easy to misinterpret. Using the |
| 223 | +Aiven MCP server can result in damage to or loss of data. Whether to enable MCP access |
| 224 | +is your organization's decision. Evaluate the risks before you grant AI agents access |
| 225 | +to your resources. |
| 226 | +::: |
| 227 | + |
| 228 | +Under the [shared responsibility model](https://aiven.io/responsibility-matrix), |
| 229 | +security and compliance for MCP usage are shared between Aiven and your organization. |
| 230 | +Aiven secures the platform and API. You are responsible for the following: |
| 231 | + |
| 232 | +- **Deciding whether to enable MCP** in your organization and evaluating the |
| 233 | + associated risks. |
| 234 | +- **Controlling access** by scoping API tokens to the minimum permissions needed |
| 235 | + (principle of least privilege) and rotating them regularly. |
| 236 | +- **Reviewing AI agent actions** before they run, especially for write or delete |
| 237 | + operations on production resources. |
| 238 | +- **Configuring MCP servers securely**, including choosing |
| 239 | + [read-only mode](/docs/tools/mcp#read-only-mode) where appropriate to |
| 240 | + restrict the server to non-destructive operations. |
| 241 | + |
| 242 | +## Supported tools |
| 243 | + |
| 244 | +### Service management |
| 245 | + |
| 246 | +Create, update, and delete Aiven services across all supported service types. |
| 247 | +Browse available plans and pricing, view service metrics and logs, and manage |
| 248 | +service configurations and cloud regions. |
| 249 | + |
| 250 | +### PostgreSQL® |
| 251 | + |
| 252 | +Create and manage PostgreSQL databases, execute read and write SQL queries, |
| 253 | +and manage PgBouncer connection pools. Get AI-powered query optimization |
| 254 | +recommendations, view query performance statistics, and list available extensions. |
| 255 | + |
| 256 | +### Apache Kafka® |
| 257 | + |
| 258 | +Create and manage Kafka topics, produce and consume messages, and configure |
| 259 | +Kafka Connect connectors. Browse Schema Registry subjects and manage |
| 260 | +connector lifecycle operations including pause, resume, and restart. |
| 261 | + |
| 262 | +## Read-only mode |
| 263 | + |
| 264 | +To restrict the server to read-only operations, set the `AIVEN_READ_ONLY` |
| 265 | +environment variable to `true` in your MCP client configuration: |
| 266 | + |
| 267 | +<!-- vale off --> |
| 268 | +<CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl, env: {AIVEN_READ_ONLY: "true"}}}}, null, 2)}</CodeBlock> |
| 269 | +<!-- vale on --> |
| 270 | + |
| 271 | +In read-only mode, the server only allows operations that read data, such as |
| 272 | +listing services, viewing metrics, and running SELECT queries. The server blocks |
| 273 | +write operations, such as creating services or modifying data. |
0 commit comments