MohamedHamed19m/capl-docs-parser-mcp
If you are the rightful owner of capl-docs-parser-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The MCP server hosts the Vector Documentation Parser as a remote tool, allowing users to access its functionality over a network.
Vector Documentation Parser
A Python package for extracting structured function information from Vector (CAPL) documentation in Markdown format and MCP Server to utilize this parser and offering tools for AI agents.
Overview
This tool parses Vector documentation files (such as CAPL function md docs) and extracts detailed function information into structured Python class objects. It automates the process of converting Markdown-based documentation into data that can be further processed, analyzed, or integrated into other systems.
Setup
This project includes a setup script (setup_mcp.py) to manage the MCP server configuration, allowing for both local (project-specific) and global installations in gemini settings.json (in future will support other agents like claude).
Usage:
# Install globally (checks existing config, appends or overwrites)
python setup_mcp.py install --global
# Install locally for this project only
python setup_mcp.py install --local
# Check current status of both local and global configs
python setup_mcp.py status
# Remove from global config (keeps other servers)
python setup_mcp.py uninstall --global
# Remove local config completely
python setup_mcp.py uninstall --local
Run python setup_mcp.py --help for more details on commands and options.
Environment Setup with uv
This project uses uv for efficient dependency management and virtual environment creation.
-
Create Virtual Environment:
uv venv -
Activate Environment:
- macOS/Linux:
source .venv/bin/activate - Windows (PowerShell):
.venv\Scripts\Activate.ps1
- macOS/Linux:
-
Synchronize Dependencies and Create Lock File:
uv syncThis command reads
pyproject.toml, createsuv.lock(if it doesn't exist), and installs dependencies into.venv. Commituv.lockto Git. -
Regenerate Lock File: If
pyproject.tomlis manually changed or branches are switched:uv lock -
Deactivate Environment:
deactivate
Features
- Comprehensive Markdown Parsing: Extracts function names, multiple syntax forms, descriptions, parameters, return values, code examples, and "Valid for" information.
- Structured Output: Stores all extracted data in well-defined Python dataclasses (
FunctionInfo,Parameter). - Handles Complex Docs: Supports multiple syntax forms, preserves code examples, and robustly parses various Markdown section formats.
- Batch Processing: Can parse a single file or all Markdown files in a directory.
- Pretty Printing: Includes
__str__methods for easy inspection of parsed data. - Error Handling: Designed to handle malformed or incomplete documentation gracefully.
Main Components
FunctionInfoclass: Stores all extracted information for a function, including:- Function name
- Multiple syntax forms
- Description
- Parameters (with names and descriptions)
- Return values
- Example code
- "Valid for" information
Parameterclass: Represents individual parameters with name and description.VectorDocParserclass: Handles the actual parsing logic for files and directories.
Usage
Parse a single file
parser = VectorDocParser()
func_info = parser.parse_file("path/to/file.md")
Parse all markdown files in a directory
functions = parser.parse_directory("./vector_docs")
Command-line usage
Run the script directly to parse a file or directory:
python main.py <file_path_or_directory>
- To parse a single file:
python main.py path/to/file.md - To parse a directory:
python main.py path/to/directory/
Requirements
- Python 3.7+
- No external dependencies (uses only the Python standard library)
Input Format
- Markdown files documenting Vector (CAPL) functions, with sections for syntax, parameters, return values, examples, etc.
Output
- Structured Python objects containing all extracted information, ready for further processing or integration.
Project Structure
main.py— Entry point for the parser (CLI and importable)setup_mcp.py— Setup script to configure the MCP server.mcp_app/— Contains the MCP server application.MCP_Server.py— Hosts the parsing logic as an MCP server for Gemini.
src/— Core Python source code for parsing and searching.docs/— Detailed documentation files.inputs/— Example input Markdown files.README.md— This file.
Documentation
This project includes an MCP (Model Context Protocol) server that exposes the documentation parsing and search functionality as a set of tools for AI agents.
For more details, see the documentation below:
- : Explains when and why to use this MCP server.
- : Provides detailed information on the server's tools and how to connect to it.
📘 Example CAPL Documentation
If you want to explore additional CAPL function documentation examples or test Markdown files, you can refer to the following public repository:
🔗 Sylphith/capl_docs — AUTOSAR Ethernet IL CAPL Functions [https://github.com/Sylphith/capl_docs/blob/main/IP/AUTOSARethIL/CAPLfunctionsAREthILOverview.md].
This repo contains real-world CAPL .md documentation files that you can use to test or validate the parser.
This project is maintained by MohamedHamed19m.