A Model Context Protocol (MCP) server that provides structured access to AsciiDoc documents for Large Language Models (LLMs).
This MCP server implements the architecture outlined in ADR-001 for providing specialized AsciiDoc document analysis capabilities to LLMs. It enables AI assistants to understand document structure, resolve include dependencies, validate cross-references, and perform semantic analysis of AsciiDoc content.
The server provides the following tools:
analyze_document_structure
- Parse and analyze the hierarchical structure of AsciiDoc documents, including heading levels and section organizationfind_includes
- Discover and resolve include directives and their dependencies recursivelyextract_metadata
- Extract document attributes, author information, and file metadatasearch_content
- Perform semantic search within AsciiDoc documents with context
validate_cross_references
- Validate internal cross-references and linksanalyze_assets
- Analyze embedded images, diagrams, and other assets
- Clone the repository:
git clone https://github.com/docToolchain/AsciiDoc-MCP.git
cd AsciiDoc-MCP
- Install the package:
pip install -e .
uvx --from git+https://github.com/docToolchain/AsciiDoc-MCP asciidoc-mcp-server
Configure your MCP client (like Claude Desktop) to use the AsciiDoc MCP server:
{
"mcpServers": {
"asciidoc-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/docToolchain/AsciiDoc-MCP", "asciidoc-mcp-server"]
}
}
}
You can also run the server directly:
asciidoc-mcp-server
This server is designed to work alongside Serena MCP for comprehensive code and documentation analysis:
{
"mcpServers": {
"serena": {
"command": "uvx",
"args": ["--from", "git+https://github.com/oraios/serena", "serena-mcp-server"]
},
"asciidoc-mcp": {
"command": "uvx",
"args": ["--from", "git+https://github.com/docToolchain/AsciiDoc-MCP", "asciidoc-mcp-server"]
}
}
}
# Tool: analyze_document_structure
{
"file_path": "docs/manual.adoc",
"include_content": true
}
Returns hierarchical structure of headings, sections, and optionally their content.
# Tool: find_includes
{
"file_path": "main.adoc",
"recursive": true
}
Returns all include directives and their resolved paths, useful for understanding document dependencies.
# Tool: extract_metadata
{
"file_path": "document.adoc"
}
Returns document attributes, author information, revision details, and file metadata.
# Tool: search_content
{
"query": "architecture decision",
"file_path": "docs/decisions.adoc",
"case_sensitive": false
}
Searches for content with context, showing surrounding lines for better understanding.
- Python 3.8+
- MCP SDK
- AsciiDoc Python package
- Clone and install in development mode:
git clone https://github.com/docToolchain/AsciiDoc-MCP.git
cd AsciiDoc-MCP
pip install -e ".[dev]"
- Run tests:
pytest
- Format code:
black src/
ruff check src/
The server consists of:
server.py
- Main MCP server implementation with tool registration and request handlingasciidoc_processor.py
- Core AsciiDoc processing logic and document analysis__init__.py
- Package initialization and version information
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Ensure code formatting with Black and Ruff
- Submit a pull request
MIT License - see LICENSE file for details.
- Serena MCP - Code intelligence MCP server
- docToolchain - Documentation toolchain
- AsciiDoc - Text document format
- Model Context Protocol - Protocol specification