Ansible MCP Server

by tarnover
MIT License
1
  • Linux
  • Apple

Integrations

  • Allows AI assistants to execute Ansible playbooks, view and manage inventory, validate playbook syntax, and preview tasks that would be executed by a playbook.

  • Serves as the runtime environment for the MCP server, allowing the Ansible integration to operate.

Ansible MCP 서버

Ansible 자동화를 위한 모델 컨텍스트 프로토콜(MCP) 서버입니다. 이 서버를 통해 AI 어시스턴트는 Ansible과 상호 작용하고, 플레이북을 실행하고, 인벤토리를 관리하고, 기타 Ansible 작업을 직접 수행할 수 있습니다.

특징

  • Ansible 플레이북 실행 : 인벤토리, 추가 변수, 태그 및 제한과 같은 매개변수를 지원하는 Ansible 플레이북을 실행합니다.
  • 인벤토리 목록 : Ansible 인벤토리 파일에서 호스트 및 그룹 보기
  • 구문 확인 : 실행 없이 Ansible 플레이북 구문 검증
  • 작업 목록 : 플레이북에서 실행될 작업을 미리 봅니다.
  • 기본 인벤토리 액세스 : 리소스 API를 통해 기본 Ansible 인벤토리 파일에 액세스합니다.

요구 사항

  • Node.js 18 이상
  • npm 또는 yarn
  • Ansible이 설치되고 PATH에 있음
  • @modelcontextprotocol/sdk (자동으로 설치됨)

설치

1. 저장소를 복제합니다.

지엑스피1

2. 종속성 설치

npm install

3. 서버를 구축하세요

npm run build

4. MCP 설정 구성

MCP 설정 구성 파일에 Ansible MCP 서버를 추가합니다.

Claude 확장 기능이 있는 VSCode의 경우:

  • ~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json 파일을 편집하세요.

Claude Desktop 앱의 경우:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json 편집하세요.
  • Windows: %APPDATA%\Claude\claude_desktop_config.json 편집하세요.
  • Linux: ~/.config/Claude/claude_desktop_config.json 편집하세요.

mcpServers 섹션에 다음을 추가합니다.

{ "mcpServers": { "ansible": { "command": "node", "args": ["/absolute/path/to/mcp-ansible/build/index.js"], "env": {} } } }

/absolute/path/to/mcp-ansible 실제 설치 경로로 바꿔야 합니다.

사용 예

MCP 서버를 설치하고 구성하면 AI 어시스턴트에 다음 도구가 제공됩니다.

1. 플레이북 실행

<use_mcp_tool> <server_name>ansible</server_name> <tool_name>run_playbook</tool_name> <arguments> { "playbook": "/path/to/your/playbook.yml", "inventory": "/path/to/inventory.ini", "extraVars": { "var1": "value1", "var2": "value2" }, "tags": "setup,configure", "limit": "webservers" } </arguments> </use_mcp_tool>

2. 재고 목록

<use_mcp_tool> <server_name>ansible</server_name> <tool_name>list_inventory</tool_name> <arguments> { "inventory": "/path/to/inventory.ini" } </arguments> </use_mcp_tool>

3. 플레이북 구문 확인

<use_mcp_tool> <server_name>ansible</server_name> <tool_name>check_syntax</tool_name> <arguments> { "playbook": "/path/to/your/playbook.yml" } </arguments> </use_mcp_tool>

4. 플레이북에 작업 나열

<use_mcp_tool> <server_name>ansible</server_name> <tool_name>list_tasks</tool_name> <arguments> { "playbook": "/path/to/your/playbook.yml" } </arguments> </use_mcp_tool>

5. 기본 인벤토리 리소스에 액세스

<access_mcp_resource> <server_name>ansible</server_name> <uri>ansible://inventory/default</uri> </access_mcp_resource>

개발

프로젝트 구조

mcp-ansible/ ├── src/ │ ├── index.ts # Main entry point │ └── ansible-mcp-server/ │ └── index.ts # Ansible MCP server implementation ├── package.json # Project configuration and dependencies ├── tsconfig.json # TypeScript configuration └── README.md # Documentation

새로운 기능 추가

MCP 서버에 새로운 Ansible 기능을 추가하려면:

  1. src/ansible-mcp-server/index.ts 수정하세요
  2. setupToolHandlers 메서드에 새 도구를 추가합니다.
  3. 도구에 대한 핸들러 기능을 구현하세요
  4. npm run build 로 다시 빌드하세요

특허

MIT 라이선스 - 자세한 내용은 라이선스를 참조하세요.

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

이 모델 컨텍스트 프로토콜 서버를 통해 AI 어시스턴트는 Ansible과 직접 상호 작용하여 플레이북을 실행하고, 인벤토리를 관리하고, 구문을 확인하고, 기타 Ansible 작업을 수행할 수 있습니다.

  1. 특징
    1. 요구 사항
      1. 설치
        1. 1. 저장소를 복제합니다.
        2. 2. 종속성 설치
        3. 3. 서버를 구축하세요
        4. 4. MCP 설정 구성
      2. 사용 예
        1. 1. 플레이북 실행
        2. 2. 재고 목록
        3. 3. 플레이북 구문 확인
        4. 4. 플레이북에 작업 나열
        5. 5. 기본 인벤토리 리소스에 액세스
      3. 개발
        1. 프로젝트 구조
        2. 새로운 기능 추가
      4. 특허

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          A Model Context Protocol server that allows secure execution of pre-approved commands, enabling AI assistants to safely interact with the user's system.
          Last updated -
          1
          3
          18
          JavaScript
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that enables AI assistants to access Flow blockchain data and perform operations such as checking balances, resolving domains, executing scripts, and submitting transactions.
          Last updated -
          JavaScript
          • Linux
          • Apple
        • -
          security
          F
          license
          -
          quality
          A Model Context Protocol server that provides persistent task management capabilities for AI assistants, allowing them to create, update, and track tasks beyond their usual context limitations.
          Last updated -
          1
          TypeScript
        • -
          security
          A
          license
          -
          quality
          A Model Context Protocol server that connects AI assistants like Claude to Moneybird accounting software, enabling management of contacts, financial data, products, and business operations through natural language.
          Last updated -
          1
          JavaScript
          MIT License
          • Apple

        View all related MCP servers

        ID: vkbe70d98s