Skip to content

Commit 0bae59b

Browse files
anusshuklaanushkshpre-commit-ci[bot]alisonlhartshatakshiiii
authored
MCP Server API (user) documentation (#2302)
* MCP Server API (user) documentation * chore: auto fixes from pre-commit.com hooks * fix cspell * added the tab in user docs * chore: auto fixes from pre-commit.com hooks * fixed th preflight issue * chore: auto fixes from pre-commit.com hooks * moved section up side down * chore: auto fixes from pre-commit.com hooks * fix the issue * docs: Address PR review feedback for MCP documentation - Simplify MCP section in main README, remove installation code - Add links to both MCP overview and API reference docs - Update status from 'testing and development' to 'technical preview' - Add server startup instructions with examples for Cursor and Claude Desktop - Remove 'Planned Implementation' section from API docs - Move API Reference Summary to top of API documentation - Remove planned WebSocket transport references * chore: Add 'bindep' to cspell dictionary --------- Co-authored-by: anushka-shukla-03 <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alison Hart <[email protected]> Co-authored-by: Shatakshi Mishra <[email protected]>
1 parent e6f9278 commit 0bae59b

File tree

6 files changed

+1694
-0
lines changed

6 files changed

+1694
-0
lines changed

.config/dictionary.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Tomasz
3030
Towncrier
3131
antsibull
3232
autofetch
33+
bindep
3334
cfgs
3435
checode
3536
chromedriver

.markdownlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
MD014: false # Dollar signs used before commands without showing output (we use mkdocs-material to add the real output)
55
MD013: false # Line length (we should only use reformatting tool for this, like prettier)
66
MD046: false # raises false possibilities with mkdocs-material admonitions https://squidfunk.github.io/mkdocs-material/reference/admonitions/
7+
MD060: false # Table column style - tables are valid even if not perfectly aligned

docs/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,23 @@ which you can learn more about at
363363
block structures, is not yet implemented. Basic YAML highlighting will apply
364364
within these blocks.
365365

366+
## Model Context Protocol (MCP) Server
367+
368+
The extension includes an MCP server that enables AI assistants and LLM-powered tools to interact with Ansible development workflows. The MCP server provides 11 specialized tools (across multiple branches) for:
369+
370+
- 🔍 Ansible playbook linting with automatic fixes
371+
- 🛠️ Development environment setup and management
372+
- 📦 Project scaffolding (playbooks and collections)
373+
- 🐳 Execution environment generation with schema validation
374+
- 📊 Environment diagnostics and information
375+
- 🚀 Playbook execution with ansible-navigator (auto-detection, Podman handling)
376+
- 📖 Ansible content best practices and guidelines
377+
378+
### Learn More
379+
380+
- **[MCP Server Overview](mcp/README.md)** - Features, architecture, and getting started guide
381+
- **[API Reference](mcp/api.md)** - Complete technical API documentation for all tools and resources
382+
366383
## Contact
367384

368385
We welcome your feedback, questions and ideas. Learn how to

docs/mcp/README.md

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# Ansible MCP Server
2+
3+
The Ansible MCP (Model Context Protocol) Server enables AI assistants and language models to interact with Ansible tooling through a standardized protocol. It provides intelligent automation capabilities for Ansible development workflows.
4+
5+
## What is MCP?
6+
7+
The Model Context Protocol (MCP) is an open protocol that standardizes how AI applications interact with external tools and data sources. The Ansible MCP Server implements this protocol to expose Ansible development tools to AI assistants.
8+
9+
## Features
10+
11+
The Ansible MCP Server provides the following capabilities:
12+
13+
### 📚 Information & Documentation
14+
15+
- **Zen of Ansible**: Access Ansible's design philosophy and principles
16+
- **Best Practices**: Get comprehensive guidelines for writing quality Ansible content
17+
- **Tool Discovery**: List all available MCP tools and their capabilities
18+
19+
### 🔧 Environment Management
20+
21+
- **Environment Info**: Check Python, Ansible, and development tool versions
22+
- **Setup Automation**: Automatically configure virtual environments and install dependencies
23+
- **Tool Installation**: Install and verify Ansible Development Tools (ADT)
24+
25+
### 🏗️ Project Scaffolding
26+
27+
- **Playbook Creation**: Generate new Ansible playbooks with proper structure
28+
- **Collection Creation**: Scaffold new Ansible collections with best practices
29+
30+
### ✅ Code Quality
31+
32+
- **Ansible Lint**: Automated linting with fix capabilities
33+
- **Execution Environment Builder**: Create and validate execution environment definitions
34+
35+
### ▶️ Playbook Execution
36+
37+
- **Ansible Navigator**: Execute playbooks with smart environment detection and container management
38+
39+
## Getting Started
40+
41+
The Ansible MCP Server is currently available as a technical preview.
42+
43+
The server runs as a child process and communicates via stdio transport.
44+
45+
### Requirements
46+
47+
- Python 3.11 or higher
48+
- Node.js 18 or higher
49+
- Ansible development tools (can be auto-installed)
50+
51+
### Starting the Server
52+
53+
The MCP server is automatically started by MCP-compatible AI assistants when configured. No manual installation or server management is required.
54+
55+
**For Cursor IDE:**
56+
57+
The extension automatically starts the MCP server when accessed from Cursor's MCP integration.
58+
59+
**For Claude Desktop:**
60+
61+
Add the following configuration to your Claude Desktop settings:
62+
63+
```json
64+
{
65+
"mcpServers": {
66+
"ansible": {
67+
"command": "node",
68+
"args": [
69+
"/path/to/vscode-ansible/out/mcp/index.js"
70+
],
71+
"env": {
72+
"WORKSPACE_ROOT": "/path/to/your/ansible/project"
73+
}
74+
}
75+
}
76+
}
77+
```
78+
79+
## Architecture
80+
81+
```text
82+
┌─────────────────┐
83+
│ AI Assistant │
84+
└────────┬────────┘
85+
│ MCP Protocol
86+
│ (JSON-RPC 2.0)
87+
┌────────▼────────┐
88+
│ Ansible MCP │
89+
│ Server │
90+
└────────┬────────┘
91+
92+
┌────┴────┐
93+
│ │
94+
┌───▼───┐ ┌──▼──────┐
95+
│Ansible│ │ Ansible │
96+
│ Tools │ │ APIs │
97+
└───────┘ └─────────┘
98+
```
99+
100+
### Usage with AI Assistants
101+
102+
The MCP server integrates with AI assistants that support the Model Context Protocol. When configured, AI assistants can:
103+
104+
- Answer questions about Ansible best practices
105+
- Help set up development environments
106+
- Generate and validate Ansible content
107+
- Lint and fix playbook issues
108+
- Execute playbooks with intelligent error handling

0 commit comments

Comments
 (0)