此内容没有您所选择的语言版本。
Chapter 2. Configuring the Ansible VS Code extension MCP server
As an automation developer, you can enable the Ansible MCP (Model context protocol) server to work with the Ansible VS Code extension. Doing so empowers Ansible development tools to give customized suggestions tuned specifically to your working environment.
You can enable the MCP server through the VS Code command palette, or the Settings menu.
2.1. Prerequisites 复制链接链接已复制到粘贴板!
- VS Code is installed and running.
- The GitHub Copilot extension is installed, running, and enabled in Agent Mode.
- The Ansible VS Code extension is installed.
Take the following steps to enable the MCP server through the VS Code command palette.
Procedure
-
In VS Code, click into the command palette at the top of the window, or type
ctrl + Shift + PorCmd + Shift + P. Find and select Ansible: Enable Ansible development tools MCP Server.
A message confirms that you have successfully enabled the MCP server and that it is now available for AI assistants that support MCP.
- Find and select MCP: List servers in the command palette. In the list you should see an entry for Ansible development tools MCP Server.
- Select Ansible development tools MCP Server to start the server.
Verification
Verify that the server has started by looking for Discovered 10 tools in your VS Code output window.
Take the following steps to enable the MCP server through the VS Code settings menu.
Procedure
- In VS Code, select the Extensions icon in the left menu.
- Find the Ansible VS Code extension and click the settings wheel.
- Select Settings from the menu that appears.
- In the Settings window, select Extensions > Ansible > MCP Server.
Click the checkbox next to Enable the Ansible development tools MCP server for AI integration.
A message confirms that the MCP server is enabled.
Find and select Ansible: Enable Ansible development tools MCP Server.
A message confirms that you have successfully enabled the MCP server and that it is now available for AI assistants that support MCP.
- Find and select MCP: List servers in the command palette at the top of the window. In the list that appears you should see an entry for Ansible development tools MCP Server.
- Select Ansible development tools MCP Server to start the server.
Verification
Verify that the server has started by looking for Discovered 10 tools in your VS Code output window.
2.4. Disable the MCP server 复制链接链接已复制到粘贴板!
Take the following steps to disable the MCP server in VS Code.
Procedure
- To disable the server from the VS Code command palette, find and select Disable Ansible development tools MCP Server.
- To disable the server from the Ansible VS Code settings menu, navigate to Extensions > Ansible > MCP Server, and clear the checkbox next to Enable the Ansible MCP server for AI integration.