nellika-lab/odoo-mcp-doc
If you are the rightful owner of odoo-mcp-doc 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.
AI-powered access to Odoo documentation through Model Context Protocol (MCP).
Odoo Documentation MCP Server
AI-powered access to Odoo documentation through Model Context Protocol (MCP).
Overview
This project provides instant, AI-assisted access to Odoo 18 and 19 documentation for developers. It consists of two main components:
- Indexer: Python tool that parses Odoo RST documentation and creates a searchable SQLite database
- MCP Server: TypeScript server that exposes the documentation through MCP tools for Claude and other AI assistants
Features
Available Tools
-
search_docs: Full-text search across all Odoo documentation
- Filter by version (18/19), category, module, content type
- Returns ranked results with snippets
-
get_api_reference: Get detailed API documentation
- Method signatures and parameters
- Code examples
- Version-specific information
-
get_code_examples: Find working code examples
- Filter by topic and language
- Ready-to-use snippets
- Context and explanations
Project Structure
odoo-doc-mcp/
├── PROJECT_PLAN.md # Detailed project plan and API design
├── TODO.md # Implementation checklist
├── PROMPT_INDEXER.md # Instructions for building the indexer
├── PROMPT_MCP_SERVER.md # Instructions for building the MCP server
├── README.md # This file
├── indexer/ # Python indexer (to be built)
│ ├── parse_rst.py
│ ├── extract_metadata.py
│ ├── extract_code.py
│ ├── extract_api.py
│ ├── build_index.py
│ └── cli.py
├── server/ # TypeScript MCP server (to be built)
│ ├── src/
│ │ ├── index.ts
│ │ ├── db/query.ts
│ │ ├── tools/
│ │ └── types/
│ └── build/
└── odoo-docs.db # Generated SQLite database
Quick Start
Prerequisites
- Python 3.8+
- Node.js 18+
- Odoo documentation repos cloned:
/Users/dgoo2308/git/odoo-documentation-18//Users/dgoo2308/git/odoo-documentation-19/
Phase 1: Build the Indexer
# Create virtual environment
cd /Users/dgoo2308/git/odoo-doc-mcp
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run indexer
python -m indexer.cli index --version all
# Test search
python -m indexer.cli search "computed field"
Phase 2: Build the MCP Server
# Install dependencies
cd server
npm install
# Build
npm run build
# Test locally
node build/index.js
Phase 3: Configure Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"odoo-docs": {
"command": "node",
"args": [
"/Users/dgoo2308/git/odoo-doc-mcp/server/build/index.js"
]
}
}
}
Restart Claude Desktop and the tools will be available!
Usage Examples
Once configured, you can ask Claude:
"Search Odoo docs for how to create computed fields"
"Get API reference for fields.Many2one in Odoo 18"
"Show me examples of creating wizards"
"Find documentation about sale module workflows"
"How do I use @api.depends decorator?"
Development Workflow
Building the Indexer
Follow the detailed instructions in PROMPT_INDEXER.md. The indexer:
- Parses ~2000 RST files
- Extracts metadata, code examples, and API definitions
- Creates a searchable SQLite database with FTS5
- Takes ~5-10 minutes to index both versions
Building the MCP Server
Follow the instructions in PROMPT_MCP_SERVER.md. The server:
- Exposes 3 core tools initially (more planned)
- Queries the SQLite database
- Returns formatted, AI-friendly responses
- Handles concurrent requests efficiently
Database Schema
The indexer creates these key tables:
- docs: Main documentation table with metadata
- docs_fts: Full-text search index (FTS5)
- code_examples: Extracted code snippets with context
- api_definitions: Structured API information
See PROJECT_PLAN.md for complete schema details.
Roadmap
✅ Phase 1: Core Search (Current)
- Basic indexing
- search_docs tool
- get_api_reference tool
- get_code_examples tool
🚧 Phase 2: Enhanced Search
- Better code categorization
- Pattern recognition
- Improved relevance ranking
📋 Phase 3: Templates & Scaffolding
- get_module_template tool
- get_best_practices tool
- Boilerplate generation
📋 Phase 4: Learning & Discovery
- explain_concept tool
- find_related tool
- Learning path suggestions
📋 Phase 5: Version Comparison
- compare_versions tool
- Migration guides
- Change detection
Performance
Expected performance after indexing:
- Database size: ~50-100MB
- Search query time: < 100ms
- Tool response time: < 200ms
- Memory usage: ~50MB
Contributing
This is a personal project, but contributions and suggestions are welcome!
Key Areas for Improvement
- Parser enhancements: Better RST/Sphinx directive handling
- Search relevance: Improved ranking algorithms
- Code extraction: Smarter context detection
- API extraction: More complete parameter parsing
- Additional tools: Implement planned features
Troubleshooting
Indexer Issues
- ImportError: Check virtual environment is activated
- File not found: Verify documentation paths
- Parsing errors: Some RST files may have syntax issues (safe to skip)
MCP Server Issues
- Database not found: Check path in src/db/query.ts
- Tools not showing in Claude: Restart Claude Desktop
- Query errors: Verify database was created successfully
Testing
# Test indexer
python -m indexer.cli stats
# Test search
python -m indexer.cli search "your query" --limit 5
# Test MCP server
cd server
npm test # (to be implemented)
Architecture Decisions
Why SQLite?
- No server setup required
- Excellent FTS5 full-text search
- Fast queries
- Single file deployment
- Perfect for read-heavy workloads
Why Python for Indexer?
- Excellent RST/docutils support
- Rich ecosystem for text processing
- Easy to maintain and extend
Why TypeScript for Server?
- MCP SDK is TypeScript-first
- Type safety for tool definitions
- Good async/await support
- Easy integration with Claude Desktop
License
MIT License - see LICENSE file for details
Resources
Support
For issues or questions:
- Check the troubleshooting section
- Review PROJECT_PLAN.md for design decisions
- Check TODO.md for known limitations
Status: 🚧 In Development
Last updated: 2025-01-18