mcp-sphinx-docs
Converts Sphinx documentation (RST) to Markdown optimized for LLMs, providing tools for converting files, directories, and analyzing project structure.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-sphinx-docsconvert https://btrfs.readthedocs.io/en/latest/ to markdown"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Sphinx Docs
Un servidor MCP (Model Context Protocol) que convierte documentación de Sphinx a Markdown optimizado para consumo por LLMs.
🚀 Instalación y uso rápido
Como herramienta de línea de comandos
# Convertir documentación desde una URL
npx @zk-armor/mcp-sphinx-docs convert-url https://btrfs.readthedocs.io/en/latest/ ./converted-docs
# Convertir archivos locales
npx @zk-armor/mcp-sphinx-docs convert-local ./docs ./markdown-docsComo servidor MCP
Agrega a tu configuración MCP (ej. Claude Desktop):
{
"mcpServers": {
"mcp-sphinx-docs": {
"command": "npx",
"args": ["@zk-armor/mcp-sphinx-docs"]
}
}
}Related MCP server: sosumi.ai
🚀 Características
Conversión RST a Markdown: Convierte archivos reStructuredText de Sphinx a Markdown limpio
Optimización para LLMs: Aplica transformaciones específicas para mejorar el consumo por modelos de lenguaje
Procesamiento por lotes: Convierte directorios completos de documentación
Chunking inteligente: Divide documentos grandes en chunks apropiados para LLMs
Preservación de referencias: Mantiene enlaces internos y referencias cruzadas
Análisis de estructura: Analiza la estructura de proyectos Sphinx
📦 Instalación
Como dependencia local
npm install
npm run buildComo paquete global (para usar con npx)
npm install -g .
# O directamente desde este directorio:
npm link🛠️ Uso
Como servidor MCP
El servidor MCP proporciona las siguientes herramientas:
1. convert_sphinx_file
Convierte un archivo RST individual a Markdown.
Parámetros:
sourcePath(string, requerido): Ruta al archivo RSToutputPath(string, opcional): Ruta de salida para el archivo Markdownoptions(object, opcional):optimize(boolean, default: true): Aplicar optimizaciones para LLMchunkSize(number, default: 4000): Tamaño máximo de chunkpreserveReferences(boolean, default: true): Preservar referencias internas
2. convert_sphinx_directory
Convierte un directorio completo de documentación Sphinx.
Parámetros:
sourcePath(string, requerido): Ruta al directorio de documentación SphinxoutputPath(string, requerido): Directorio de salida para archivos Markdownoptions(object, opcional):recursive(boolean, default: true): Procesar subdirectoriosoptimize(boolean, default: true): Aplicar optimizaciones para LLMchunkSize(number, default: 4000): Tamaño máximo de chunkpreserveStructure(boolean, default: true): Preservar estructura de directorios
3. analyze_sphinx_structure
Analiza la estructura de un proyecto de documentación Sphinx.
Parámetros:
sourcePath(string, requerido): Ruta al directorio de documentacióndepth(number, default: 3): Profundidad máxima de análisis
Como CLI (futuro)
# Convertir un archivo
npx sphinx-to-llm-markdown convert file.rst output.md
# Convertir un directorio
npx sphinx-to-llm-markdown convert ./docs ./markdown-docs
# Analizar estructura
npx sphinx-to-llm-markdown analyze ./docs🏗️ Arquitectura
src/
├── index.ts # Servidor MCP principal
├── converters/
│ └── sphinx-converter.ts # Lógica de conversión RST → Markdown
├── optimizers/
│ └── llm-optimizer.ts # Optimizaciones específicas para LLMs
└── utils/
└── file-handler.ts # Utilidades para manejo de archivosComponentes principales
SphinxConverter: Parsea RST y convierte a Markdown
Maneja directivas Sphinx (toctree, note, warning, etc.)
Convierte referencias cruzadas
Preserva estructura de documentos
LLMOptimizer: Optimiza el Markdown para LLMs
Simplifica estructura (máximo 4 niveles de headers)
Elimina redundancias
Añade contexto a secciones
Implementa chunking inteligente
FileHandler: Maneja operaciones de archivos
Búsqueda recursiva de archivos RST
Análisis de estructura de directorios
Operaciones de E/S con manejo de errores
🧪 Ejemplo de uso
Probar con documentación BTRFS
# Clonar la documentación de BTRFS (ejemplo)
git clone https://github.com/kdave/btrfs-progs.git
cd btrfs-progs/Documentation
# Usar el servidor MCP para convertir
# (desde el cliente MCP, como Claude Desktop)Estructura de entrada típica (Sphinx)
docs/
├── conf.py
├── index.rst
├── introduction.rst
├── features/
│ ├── compression.rst
│ └── snapshots.rst
└── _static/Estructura de salida (Markdown optimizado)
markdown-docs/
├── index.md
├── introduction.md
└── features/
├── compression.md
└── snapshots.md🔧 Configuración para VS Code
El proyecto incluye configuración para depurar el servidor MCP:
.vscode/mcp.json: Configuración del servidor MCP.vscode/tasks.json: Tareas de build y watch.github/copilot-instructions.md: Instrucciones para GitHub Copilot
Depuración
# Compilar en modo watch
npm run watch
# En otra terminal, ejecutar el servidor
npm start📝 Formatos soportados
Entrada (RST/Sphinx)
✅ Headers con subrayado (=, -, ~, etc.)
✅ Listas con bullets y numeración
✅ Bloques de código con
::✅ Directivas básicas (note, warning, tip)
✅ Referencias doc (
:doc:reference`)✅ Referencias internas (
:ref:reference`)✅ Enlaces externos
✅ Énfasis y texto fuerte
⚠️ Tablas simples
⚠️ Autodoc (básico)
Salida (Markdown optimizado)
✅ Headers normalizados (máximo 4 niveles)
✅ Listas con bullets consistentes
✅ Bloques de código con hints de lenguaje
✅ Blockquotes para notas/warnings
✅ Enlaces con texto descriptivo
✅ Separadores de sección
✅ Contexto agregado para secciones profundas
🛣️ Roadmap
Fase actual: MVP ✅
Conversión básica RST → Markdown
Servidor MCP funcional
Optimizaciones básicas para LLM
Manejo de archivos y directorios
Próximas características
CLI independiente
Soporte mejorado para tablas complejas
Procesamiento de autodoc más sofisticado
Configuración personalizable
Tests automatizados
Publicación en NPM
Futuro
Soporte para otros formatos de documentación
Integración con APIs de LLM para validación
Dashboard web para conversiones
Plugins para diferentes frameworks de documentación
🤝 Contribución
Fork el proyecto
Crea una rama para tu feature (
git checkout -b feature/amazing-feature)Commit tus cambios (
git commit -m 'Add amazing feature')Push a la rama (
git push origin feature/amazing-feature)Abre un Pull Request
📄 Licencia
ISC License - ver archivo LICENSE para detalles.
🔗 Enlaces útiles
Available Tools
3 toolsanalyze_sphinx_structureB
Analyze the structure of a Sphinx documentation project
| Name | Required | Description | Default |
|---|---|---|---|
| depth | No | Maximum depth to analyze | |
| sourcePath | Yes | Path to the Sphinx documentation directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden but only says 'Analyze the structure'. It does not disclose side effects, return format, or the scope of analysis, which is a significant gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single, front-loaded sentence with no unnecessary words. The description is appropriately concise for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
There is no output schema, so the description should explain what 'structure' analysis returns, but it does not. The tool has only two well-documented parameters, but completeness is undermined by missing output/behavior details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with clear descriptions for sourcePath and depth. The description itself adds no parameter detail beyond what the schema already provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description uses specific verb 'Analyze' with resource 'structure of a Sphinx documentation project', clearly distinguishing it from sibling convert tools. It states exactly what the tool does.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies use for analyzing project structure but provides no explicit when-to-use or when-not-to-use guidance relative to sibling convert tools. No alternatives or exclusions are mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
convert_sphinx_directoryB
Convert an entire Sphinx documentation directory to LLM-optimized Markdown
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | ||
| outputPath | Yes | Output directory for converted Markdown files | |
| sourcePath | Yes | Path to the Sphinx documentation directory |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries full responsibility for behavioral disclosure. It only states 'Convert' without explaining whether the operation is read-only, whether it modifies the source files, what happens to existing output files, or how chunking and optimization affect the process. The lack of any side-effect or safety information leaves the agent under-informed.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, directly stated sentence. It front-loads the core action, resource, and result with no filler or redundant information. Every word contributes value, making it highly concise and well-structured.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (directory processing, multiple options, no output schema, no annotations), the description is too brief. It does not mention what the output looks like, how the conversion works, whether it's safe, or what 'LLM-optimized' entails. The agent would need to rely solely on the schema, which is insufficient for understanding the tool's full behavior and implications.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 67%, with sourcePath and outputPath described in the schema. The description adds no additional parameter semantics, and the 'options' parameter lacks a top-level schema description. Since coverage is in the moderate range, the description does not need to fully compensate but could have added clarity about options like recursive or preserveStructure, which it fails to do.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Convert an entire Sphinx documentation directory to LLM-optimized Markdown' clearly specifies the verb (Convert), the resource (Sphinx documentation directory), and the output (LLM-optimized Markdown). It distinguishes from the sibling tool 'convert_sphinx_file' by explicitly targeting directories.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for whole directories, but it does not explicitly state when to use this tool versus 'convert_sphinx_file' or 'analyze_sphinx_structure'. No exclusions or alternative recommendations are provided. The usage context is clear from 'entire directory' but lacks explicit guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
convert_sphinx_fileA
Convert a single Sphinx RST file to LLM-optimized Markdown
| Name | Required | Description | Default |
|---|---|---|---|
| options | No | ||
| outputPath | No | Output path for the converted Markdown file | |
| sourcePath | Yes | Path to the RST file to convert |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states the basic conversion action but does not explain side effects (e.g., whether outputPath is overwritten), error conditions, or what 'LLM-optimized' entails. This leaves significant behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that immediately states the tool's purpose. There is zero fluff or redundancy, and the key scoping term ('single') is front-loaded.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has a nested options object, no output schema, and no annotations. The description is too minimal to convey what the tool returns, how options like chunkSize and optimize affect output, or any side effects. This lack of completeness makes it hard for an agent to predict behavior for non-trivial conversions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds no parameter information at all. Schema coverage is 67% (sourcePath and outputPath have descriptions, but options object lacks a description). Since coverage is not high and the description does not compensate, it provides little value beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Convert') and resource ('a single Sphinx RST file') with a clear output ('LLM-optimized Markdown'). The word 'single' distinguishes it from the sibling tool convert_sphinx_directory, making it clear this is for individual files.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description clearly implies usage for a single file via 'single', providing context that this is for one RST file at a time. However, it does not explicitly mention alternatives like convert_sphinx_directory or exclusions, so it stops short of a 5.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v1.0.0- First observed
analyze_sphinx_structure - First observed
convert_sphinx_directory - First observed
convert_sphinx_file
TDQS
Each tool targets a distinct scope: single file conversion, directory conversion, and structural analysis. There is no overlap or ambiguity in their purposes.
All tools follow a consistent verb_sphinx_noun pattern (convert/analyze + sphinx + file/directory/structure), making the naming predictable and clear.
Three tools is a well-scoped set for a Sphinx documentation conversion server, covering the essential operations without unnecessary bloat.
The tool set covers the full conversion workflow (single file and whole directory) plus structural analysis, leaving no obvious dead ends for the stated purpose.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Convert PDF, DOCX, HTML, and URLs to clean, LLM-ready markdown with tables preserved
Convert documents and web pages to clean Markdown: PDF, DOCX, XLSX, EPUB, scanned files, any URL.
High-fidelity PDF to structured Markdown conversion and document field extraction.
Parse PDF/Word/PPT/HTML to Markdown; tables as JSON, image extraction, RAG chunking, page ranges.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceConverts web-based documentation into markdown format using jina.ai's conversion service, allowing users to scrape documentation from any URL and save it as markdown files.10-
- AlicenseNot gradedqualityAmaintenanceConverts Apple Developer documentation, HIG, WWDC transcripts, and external Swift-DocC pages into Markdown for AI consumption via MCP tools and HTTP API.1,468470MIT
- AlicenseNot gradedqualityAmaintenanceConverts documents (PDF, DOCX, XLSX, EPUB, etc.) to clean, structured Markdown, and retrieves document info, for use with AI agents.MIT
- AlicenseNot gradedqualityAmaintenanceMakes Fonto XML documentation accessible to AI tools by fetching underlying XML and converting it to clean Markdown on demand, enabling search and retrieval of docs pages.414MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/zk-armor/mcp-sphinx-docs'
If you have feedback or need assistance with the MCP directory API, please join our Discord server