mcp-aiven is a Model Context Protocol (MCP) server for the Aiven cloud data platform, used to let AI assistants interact directly with data services on Aiven.
Purpose Through this MCP server, you can manage PostgreSQL, Apache Kafka, applications, and other Aiven services in AI assistants such as Claude, Cursor, and VS Code Copilot.
Main capabilities
- Manage Aiven services such as PostgreSQL, Apache Kafka, ClickHouse, and OpenSearch.
- Support creating, modifying, and deleting Aiven services and data.
- Provide two operating modes: remote hosting (HTTP) and local stdio.
- Support enabling read-only mode via a URL query parameter (read_only=true), excluding all write operations.
- Support narrowing the range of tools exposed to the AI agent via the services_scope parameter. Optional values include all, core, pg, kafka, application, integrations; core (project/service discovery) is always implicitly included; all cannot be combined with other scopes.
- In read-only mode, specific write tools (such as creating a Kafka topic) can be re-enabled via the write_allowlist parameter, with multiple tool names separated by commas; this parameter is ignored when read-only is not enabled.
- If Aiven is subscribed to through a cloud marketplace, the marketplace identifier can be added to the URL path segment to use the correct console login, for example https://mcp.aiven.live/mcp/gcp?services_scope=pg&read_only=true。
Usage Method 1: Remote (hosted by Aiven) The MCP server is hosted at https://mcp.aiven.live/mcp。MCP The client will prompt for authorization on Aiven. It can also be manually added to the Cursor MCP settings, or added in the .vscode/mcp.json of a VS Code / Copilot workspace.
Method 2: stdio (local) Run the server locally as a subprocess of the MCP client, requiring Node.js 18+. The Aiven API token must be provided via the AIVEN_TOKEN environment variable. It can be configured in Cursor (Cursor Settings > MCP Servers) or VS Code (workspace .vscode/mcp.json).
Method 3: Local development Run a locally built server, which listens on port 3000 by default, and the MCP client connects to http://localhost:3000/mcp。可通过设置 MCP_HOST points a remote deployment to a custom host.
Environment variables In remote (HTTP) mode, AIVEN_TOKEN is not required; the MCP client sends it as a Bearer token in each request. Production HTTP traffic has two layers of rate limiting: Cloudflare limits by client IP, and the server applies MCP_HTTP_RATE_LIMIT_* limits to POST /mcp by Bearer token.
Edge protection When EXTRA_PROTECTION=true, if MCP_EDGE_AUTH_SECRET does not match the X-Edge-Auth value injected by Cloudflare, all requests except GET /health return 403. Enabling order: first set X-Edge-Auth in a Cloudflare Transform Rule (and also X-Client-IP if used for PG tools), then deploy the server and set the same MCP_EDGE_AUTH_SECRET (without enabling EXTRA_PROTECTION for now), and finally enable EXTRA_PROTECTION=true. Key rotation requires updating both Cloudflare and MCP_EDGE_AUTH_SECRET at the same time, or temporarily disabling EXTRA_PROTECTION. If EXTRA_PROTECTION=true at startup and MCP_EDGE_AUTH_SECRET is missing, the process will immediately error out and exit. While rejections continue, the server logs a configuration error warning at most once every 15 minutes.
Use cases
- Directly operate services such as PostgreSQL, Kafka, ClickHouse, and OpenSearch on Aiven in AI assistants.
- Scenarios that require read-only access or a limited service scope to control the AI agent's context and permissions.
- Local development and testing of the MCP server.
Limitations and security
- This MCP server can create, modify, and delete Aiven services and data on behalf of the user. AI agents may perform destructive operations based on prompts (such as deleting databases, deleting services, or producing messages), and users are fully responsible for operations performed through this tool.
- Access permissions are constrained by the Aiven user permissions corresponding to the authenticated account, and the MCP server can only perform that user'sOperations that the account is allowed to perform.
- AI agents may need access credentials (database connection strings, stream tokens) to act on behalf of users. In production environments, agent behavior should be reviewed, organizational security policies should be followed, and a risk assessment should be conducted before granting access to sensitive resources.
- For more information on development setup, running locally, and adding new tools, see CONTRIBUTING.md.