Skip to main content
Glama
zk-armor
by zk-armor

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-docs

Como 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 build

Como 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 RST

  • outputPath (string, opcional): Ruta de salida para el archivo Markdown

  • options (object, opcional):

    • optimize (boolean, default: true): Aplicar optimizaciones para LLM

    • chunkSize (number, default: 4000): Tamaño máximo de chunk

    • preserveReferences (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 Sphinx

  • outputPath (string, requerido): Directorio de salida para archivos Markdown

  • options (object, opcional):

    • recursive (boolean, default: true): Procesar subdirectorios

    • optimize (boolean, default: true): Aplicar optimizaciones para LLM

    • chunkSize (number, default: 4000): Tamaño máximo de chunk

    • preserveStructure (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ón

  • depth (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 archivos

Componentes 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:

  1. .vscode/mcp.json: Configuración del servidor MCP

  2. .vscode/tasks.json: Tareas de build y watch

  3. .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

  1. Fork el proyecto

  2. Crea una rama para tu feature (git checkout -b feature/amazing-feature)

  3. Commit tus cambios (git commit -m 'Add amazing feature')

  4. Push a la rama (git push origin feature/amazing-feature)

  5. Abre un Pull Request

📄 Licencia

ISC License - ver archivo LICENSE para detalles.

🔗 Enlaces útiles

Available Tools

3 tools
analyze_sphinx_structureB

Analyze the structure of a Sphinx documentation project

ParametersJSON Schema
NameRequiredDescriptionDefault
depthNoMaximum depth to analyze
sourcePathYesPath to the Sphinx documentation directory

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
optionsNo
outputPathYesOutput directory for converted Markdown files
sourcePathYesPath to the Sphinx documentation directory

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
optionsNo
outputPathNoOutput path for the converted Markdown file
sourcePathYesPath to the RST file to convert

TDQS

A3.5/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

  1. 3 tool updatesv1.0.0
    • First observedanalyze_sphinx_structure
    • First observedconvert_sphinx_directory
    • First observedconvert_sphinx_file

TDQS

A3.9/5.0
Disambiguation5/5

Each tool targets a distinct scope: single file conversion, directory conversion, and structural analysis. There is no overlap or ambiguity in their purposes.

Naming Consistency5/5

All tools follow a consistent verb_sphinx_noun pattern (convert/analyze + sphinx + file/directory/structure), making the naming predictable and clear.

Tool Count5/5

Three tools is a well-scoped set for a Sphinx documentation conversion server, covering the essential operations without unnecessary bloat.

Completeness5/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • A
    license
    Not graded
    quality
    A
    maintenance
    Converts Apple Developer documentation, HIG, WWDC transcripts, and external Swift-DocC pages into Markdown for AI consumption via MCP tools and HTTP API.
    1,468
    470
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Converts documents (PDF, DOCX, XLSX, EPUB, etc.) to clean, structured Markdown, and retrieves document info, for use with AI agents.
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Makes 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.
    41
    4
    MIT

Latest Blog Posts

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