|
| 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 | + |
| 10 | +{/* Update mcpUrl to change the MCP server URL across all code samples on this page. */} |
| 11 | +export const mcpUrl = "https://aiven.io/mcp"; |
| 12 | +export const cursorDeepLink = `cursor://anysphere.cursor-deeplink/mcp/install?name=aiven-mcp&config=${typeof btoa !== "undefined" ? btoa(JSON.stringify({url: mcpUrl})) : ""}`; |
| 13 | + |
| 14 | +The Aiven MCP server lets you manage Aiven services directly from |
| 15 | +MCP-compatible AI assistants such as Cursor, Claude Code, Claude Desktop, |
| 16 | +and GitHub Copilot. Create and configure PostgreSQL® databases, Apache Kafka® |
| 17 | +clusters, and other Aiven services using natural language. |
| 18 | + |
| 19 | +## Prerequisites |
| 20 | + |
| 21 | +- An [Aiven account](https://console.aiven.io/signup) |
| 22 | +- An organization with MCP access enabled |
| 23 | +- An MCP-compatible client (Cursor, Claude Code, Claude Desktop, VS Code, or similar) |
| 24 | + |
| 25 | +## MCP server URL |
| 26 | + |
| 27 | +Use the following server URL when configuring your client: |
| 28 | + |
| 29 | +<CodeBlock language="text">{mcpUrl}</CodeBlock> |
| 30 | + |
| 31 | +## Configure your MCP client |
| 32 | + |
| 33 | +<Tabs groupId="mcp-clients"> |
| 34 | +<TabItem value="cursor" label="Cursor" default> |
| 35 | + |
| 36 | +<a |
| 37 | + href={cursorDeepLink} |
| 38 | + 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'}} |
| 39 | +> |
| 40 | + <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" style={{display: 'block', flex: 'none'}}> |
| 41 | + <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"/> |
| 42 | + </svg> |
| 43 | + <span>Add to Cursor</span> |
| 44 | +</a> |
| 45 | +
|
| 46 | +<br /><br /> |
| 47 | + |
| 48 | +Alternatively, add it manually: |
| 49 | + |
| 50 | +1. In your project root, create or edit `.cursor/mcp.json`. |
| 51 | +1. Add the following configuration: |
| 52 | + |
| 53 | + <CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 54 | + |
| 55 | +1. Save the file. |
| 56 | +1. Restart Cursor. |
| 57 | +1. Open **Settings** > **Tools & MCP**. |
| 58 | +1. Select **aiven** and click **Connect**. |
| 59 | + |
| 60 | +</TabItem> |
| 61 | +<TabItem value="claude-code" label="Claude Code"> |
| 62 | + |
| 63 | +1. Open a terminal. |
| 64 | +1. Run the following command: |
| 65 | + |
| 66 | + <CodeBlock language="bash">{`claude mcp add --transport http aiven ${mcpUrl}`}</CodeBlock> |
| 67 | + |
| 68 | +1. Run `/mcp` in Claude Code to verify the server is registered. |
| 69 | +1. On first use, a browser window opens where you sign in to Aiven and select your organization. |
| 70 | + |
| 71 | +For more information, see the [Claude Code MCP documentation](https://docs.anthropic.com/en/docs/claude-code/tutorials/set-up-mcp). |
| 72 | + |
| 73 | +</TabItem> |
| 74 | +<TabItem value="claude-desktop" label="Claude Desktop"> |
| 75 | + |
| 76 | +1. Open the Claude Desktop configuration file. If it does not exist, create it: |
| 77 | + |
| 78 | + - **macOS:** |
| 79 | + `~/Library/Application Support/Claude/claude_desktop_config.json` |
| 80 | + |
| 81 | + - **Windows:** |
| 82 | + `%APPDATA%\Claude\claude_desktop_config.json` |
| 83 | + |
| 84 | +1. Add the following to the configuration file: |
| 85 | + |
| 86 | + <CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 87 | + |
| 88 | +1. Save the file and restart Claude Desktop. |
| 89 | + |
| 90 | +For more information, see the [Claude Desktop MCP documentation](https://modelcontextprotocol.io/quickstart/user). |
| 91 | + |
| 92 | +</TabItem> |
| 93 | +<TabItem value="vscode" label="VS Code"> |
| 94 | + |
| 95 | +:::note |
| 96 | +Requires Visual Studio Code 1.102 or later with the GitHub Copilot extension installed |
| 97 | +and enabled. |
| 98 | +::: |
| 99 | + |
| 100 | +1. Open your workspace in Visual Studio Code. |
| 101 | +1. In the workspace root, create a `.vscode` directory if it does not exist. |
| 102 | +1. In the `.vscode` directory, create or edit `mcp.json`. |
| 103 | +1. Add the following configuration: |
| 104 | + |
| 105 | + <CodeBlock language="json">{JSON.stringify({servers: {aiven: {type: "http", url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 106 | + |
| 107 | +1. Save the file. |
| 108 | +1. Reload Visual Studio Code. |
| 109 | +1. Open the Command Palette and run **MCP: List Servers**. |
| 110 | +1. Confirm that **aiven** appears in the list. |
| 111 | + |
| 112 | +For more information, see the [VS Code MCP documentation](https://code.visualstudio.com/docs/copilot/customization/mcp-servers). |
| 113 | + |
| 114 | +</TabItem> |
| 115 | +<TabItem value="other" label="Other clients"> |
| 116 | + |
| 117 | +1. Open your MCP client configuration. |
| 118 | +1. Add the Aiven MCP server using the following URL: |
| 119 | + |
| 120 | + <CodeBlock language="text">{mcpUrl}</CodeBlock> |
| 121 | + |
| 122 | +Most clients accept a configuration similar to: |
| 123 | + |
| 124 | +<CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {url: mcpUrl}}}, null, 2)}</CodeBlock> |
| 125 | + |
| 126 | +1. Save the file and restart your client. |
| 127 | + |
| 128 | +Some clients require specifying the transport type, for example `"type": "http"`. Refer |
| 129 | +to your client documentation if the configuration fails. |
| 130 | + |
| 131 | +</TabItem> |
| 132 | +</Tabs> |
| 133 | + |
| 134 | +## Verify the connection |
| 135 | + |
| 136 | +<Tabs groupId="mcp-clients"> |
| 137 | +<TabItem value="cursor" label="Cursor" default> |
| 138 | + |
| 139 | +1. Open Cursor Chat (**Cmd+L** on macOS, **Ctrl+L** on Windows/Linux). |
| 140 | +1. Try a prompt such as: |
| 141 | + |
| 142 | + > List my Aiven projects. |
| 143 | +
|
| 144 | +1. If prompted to allow tool execution, click **Allow**. |
| 145 | +1. To confirm the server is registered, go to **Settings** > **Tools & MCP** and |
| 146 | + check that **aiven** appears with a connected status. |
| 147 | + |
| 148 | +</TabItem> |
| 149 | +<TabItem value="claude-code" label="Claude Code"> |
| 150 | + |
| 151 | +1. Run `/mcp` in Claude Code to verify the server is registered. |
| 152 | +1. Try a prompt such as: |
| 153 | + |
| 154 | + > List my Aiven projects. |
| 155 | +
|
| 156 | +1. If prompted to allow tool execution, confirm. |
| 157 | + |
| 158 | +</TabItem> |
| 159 | +<TabItem value="claude-desktop" label="Claude Desktop"> |
| 160 | + |
| 161 | +1. Open a new conversation. |
| 162 | +1. Verify that the MCP tools icon appears in the input area. |
| 163 | +1. Try a prompt such as: |
| 164 | + |
| 165 | + > List my Aiven projects. |
| 166 | +
|
| 167 | +1. If prompted to allow tool execution, click **Allow**. |
| 168 | + |
| 169 | +</TabItem> |
| 170 | +<TabItem value="vscode" label="VS Code"> |
| 171 | + |
| 172 | +1. Open Copilot Chat in Visual Studio Code. |
| 173 | +1. Open the Command Palette and run **MCP: List Servers**. |
| 174 | +1. Confirm that **aiven** appears in the list. |
| 175 | +1. Try a prompt such as: |
| 176 | + |
| 177 | + > List my Aiven projects. |
| 178 | +
|
| 179 | +1. If prompted to allow tool execution, click **Allow**. |
| 180 | + |
| 181 | +</TabItem> |
| 182 | +<TabItem value="other" label="Other clients"> |
| 183 | + |
| 184 | +1. Open your AI assistant. |
| 185 | +1. Try a prompt such as: |
| 186 | + |
| 187 | + > List my Aiven projects. |
| 188 | +
|
| 189 | +1. If prompted to allow tool execution, confirm. |
| 190 | +1. Verify that the response includes information about your Aiven projects. |
| 191 | + |
| 192 | +</TabItem> |
| 193 | +</Tabs> |
| 194 | + |
| 195 | +## Authentication |
| 196 | + |
| 197 | +The Aiven MCP server uses OAuth 2.0 with PKCE for authentication. When you |
| 198 | +first use the server, it opens a browser window where you sign in to Aiven and |
| 199 | +select your organization. The server manages token refresh automatically. |
| 200 | + |
| 201 | +## Supported tools |
| 202 | + |
| 203 | +### Service management |
| 204 | + |
| 205 | +Create, update, and delete Aiven services across all supported service types. |
| 206 | +Browse available plans and pricing, view service metrics and logs, and manage |
| 207 | +service configurations and cloud regions. |
| 208 | + |
| 209 | +### PostgreSQL® |
| 210 | + |
| 211 | +Create and manage PostgreSQL databases, execute read and write SQL queries, |
| 212 | +and manage PgBouncer connection pools. Get AI-powered query optimization |
| 213 | +recommendations, view query performance statistics, and list available extensions. |
| 214 | + |
| 215 | +### Apache Kafka® |
| 216 | + |
| 217 | +Create and manage Kafka topics, produce and consume messages, and configure |
| 218 | +Kafka Connect connectors. Browse Schema Registry subjects and manage |
| 219 | +connector lifecycle operations including pause, resume, and restart. |
| 220 | + |
| 221 | +## Read-only mode |
| 222 | + |
| 223 | +To restrict the server to read-only operations, set the `AIVEN_READ_ONLY` |
| 224 | +environment variable to `true` in your MCP client configuration: |
| 225 | + |
| 226 | +<CodeBlock language="json">{JSON.stringify({mcpServers: {aiven: {type: "http", url: mcpUrl, env: {AIVEN_READ_ONLY: "true"}}}}, null, 2)}</CodeBlock> |
| 227 | + |
| 228 | +In read-only mode, the server only allows operations that read data, such as |
| 229 | +listing services, viewing metrics, and running SELECT queries. Write |
| 230 | +operations like creating services or modifying data are blocked. |
0 commit comments