MyInvois MCP RAG
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
# MyInvois MCP RAG
An end-to-end pipeline for scraping and indexing MyInvois SDK documentation. Source of truth: https://sdk.myinvois.hasil.gov.my
Features
Generative RAG: Provides intelligent, documentation-grounded answers using a configurable LLM (Gemini by default).
MCP Server: Implements the Model Context Protocol (MCP) for native integration with Claude Desktop, Cursor, and other AI clients.
Sitemap-based Scraping: Automatically discovers and cleans content using
trafilatura.Change Detection: Efficient incremental updates via content hashing.
FastAPI Search: Standard REST interface for custom integrations.
Related MCP server: mcp-business-bot
Project Structure
data/ # Local cache for raw and processed docs (gitignored)
sample_data/ # Tiny synthetic snapshot for structure reference
scripts/ # Orchestration scripts
sync_docs.py # Main script to scrape and index
src/
mcp/ # MCP Server implementation
api/ # FastAPI service
indexer/ # LlamaIndex & Qdrant logic
scraper/ # Scraping pipeline
common/ # Configuration & Shared utilities
.env # API Keys & Local settings
docker-compose.yml # Local Qdrant setup
requirements.txt # Python dependencies
qdrant_storage/ # Local Qdrant data (gitignored)Setup Instructions
1. Prerequisites
Python 3.9+
Docker (for Qdrant)
An API key for your selected LLM provider (Gemini/OpenAI/Anthropic) or a local Ollama setup
2. Install & Start (and Regenerate Later)
pip install -r requirements.txt
docker-compose up -d
# Run once to pull documentation
$env:PYTHONPATH = "."; python scripts/sync_docs.pyFull data is generated locally. This writes to data/ and qdrant_storage/, which are gitignored. A tiny synthetic sample is included under sample_data/ for reference. To refresh later, rerun the same command (start Qdrant first if needed).
3. Usage Modes
A. MCP Mode (Recommended for AI Apps)
Integrate this system directly into your AI assistant (e.g., Cline). Add this to your mcp_config.json:
{
"mcpServers": {
"myinvois-mcp-rag": {
"command": "python",
"args": ["C:/path/to/MyInvois MCP RAG/src/mcp/server.py"],
"env": {
"PYTHONPATH": "C:/path/to/MyInvois MCP RAG",
"GOOGLE_API_KEY": "your_key_here"
}
}
}
}B. API Mode (For REST/Copilot Chat)
Start the FastAPI server:
$env:PYTHONPATH = "."; python src/api/main.pyAsk Q&A:
GET /ask?q=How do I validate a TIN?Search Docs:
GET /search?q=login token
4. API Examples
Search:
curl "http://localhost:8000/search?q=invoice%20validation"Example response:
{
"query": "invoice validation",
"results": [
{
"text": "...snippet...",
"source_url": "https://sdk.myinvois.hasil.gov.my/...",
"score": 0.78,
"metadata": { "file_name": "...", "url": "...", "title": "..." }
}
],
"answer": null,
"processing_time_ms": 123.45
}Ask:
curl "http://localhost:8000/ask?q=What%20is%20MyInvois%3F"Example response:
{
"query": "What is MyInvois?",
"results": [
{
"text": "...snippet...",
"source_url": "https://sdk.myinvois.hasil.gov.my/...",
"score": 0.81,
"metadata": { "file_name": "...", "url": "...", "title": "..." }
}
],
"answer": "...synthesized answer...",
"processing_time_ms": 156.12
}5. Model Configuration
Set these in .env to switch providers:
LLM_PROVIDER:gemini|openai|anthropic|ollamaLLM_MODEL: provider-specific model name (e.g.,gpt-4o-mini)EMBEDDING_PROVIDER:fastembed|openai|ollamaEMBEDDING_MODEL: provider-specific embedding model (e.g.,text-embedding-3-small)
6. Scheduling (Optional)
GitHub Actions (manual): The workflow in .github/workflows/monthly-sync.yml is manual-only and has artifact upload disabled by default. If you enable artifact upload in a public repo, those artifacts are public.
Windows Task Scheduler:
# Action: Start a program
# Program/script: python
# Add arguments: scripts/sync_docs.py
# Start in: C:\path\to\MyInvois MCP RAGMake sure Docker is running and Qdrant is up (docker compose up -d), and set API keys via system/user environment variables or a wrapper script.
Linux/macOS cron:
0 0 1 * * cd /path/to/MyInvois\ MCP\ RAG && docker compose up -d && python scripts/sync_docs.pyCron uses the machine timezone. Ensure your API keys are available in the cron environment.
Key Implementation Details
LLM: Configurable (Gemini/OpenAI/Anthropic/Ollama); default
models/gemini-2.5-flashEmbeddings: Configurable (FastEmbed/OpenAI/Ollama); default
BAAI/bge-small-en-v1.5Vector DB: Qdrant (Local)
License
MIT License. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and query nTop's knowledge base and engineering guides from AI applications.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
MCP server for querying Forkast documentation
PDF AI for your own documents: ask from any MCP client and get answers that cite the source.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides RAG (Retrieval Augmented Generation) access to technical documentation through MCP, enabling LLMs to search and retrieve relevant documentation on-demand.5MIT
- FlicenseNot gradedqualityDmaintenanceEnables querying company knowledge base using RAG, providing accurate answers from internal documents via MCP.-
- FlicenseAqualityDmaintenanceEnables MCP clients to retrieve authoritative AI Square documentation, API references, SDK examples, guides, and troubleshooting information through citation-safe hybrid search and static resources.11-
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to ask plain-language questions and receive answers grounded only in documents the configured role is cleared to read, with the same access-controlled tools available across any client.MIT