Tutorial: Connect Your AI Agent to Access Server Using the MCP Server
Overview
Use the Access Server MCP server to connect an AI agent such as Claude Code to OpenVPN Access Server through the Web API.
The Model Context Protocol (MCP) is an open standard that lets AI applications connect to external tools and data sources. The Access Server MCP server exposes Access Server information as MCP tools, letting you query your server in natural language rather than manually constructing Web API requests.
The as-mcp-server package currently provides read-only access. You can use it to retrieve server information, users and groups, connection activity, authentication failures, and other operational data, but it doesn't change Access Server configuration.
This tutorial uses Claude Code as the primary MCP client. The server can also work with other MCP-compatible clients such as Claude Desktop, Codex, VS Code, Gemini CLI, Cursor, and OpenCode.
The MCP server runs through uvx. uvx, included with Astral's uv, runs Python command-line tools such as as-mcp-server in an isolated environment, so you don't need to install the package globally.
You can review the source in the OpenVPN/as-mcp-server repository.
Use cases
Audience | Use case |
|---|---|
Developers | Explore and test Access Server information through natural-language queries. |
IT administrators and DevOps engineers | Check server status, investigate VPN connections, review authentication failures, and retrieve operational information through an AI assistant. |
Organizations | Give administrators another read-only interface to retrieve Access Server information and investigate issues. |
Where the MCP server runs
This tutorial uses the stdio MCP transport.
With stdio, the MCP client launches as-mcp-server as a local child process and communicates with it through standard input and output. The MCP server therefore runs on the same machine as Claude Code or your other MCP client. It doesn't listen on a separate network port.
A Windows, macOS, or Linux workstation.
An on-premises server.
A cloud VM or other host.
Whichever system you use needs network access to your Access Server.
Prerequisites
Before you begin, ensure you have:
Access Server 3.1.0 or newer.
A dedicated Access Server administrative account that uses local, PAM, RADIUS, or LDAP authentication.
An MCP-compatible client. This tutorial uses Claude Code.
Network access from the MCP client host to the Access Server web services.
Optional but recommended: TOTP MFA enabled for the administrative account.
For TOTP MFA, refer to Tutorial: Turn On TOTP Multi-Factor Authentication. Access Server supports built-in TOTP MFA with local, PAM, LDAP, and RADIUS authentication.
The Access Server Web API is reached through the web services. Ensure the MCP client host can reach TCP 943, or TCP 443 when web service forwarding is enabled.