π SSH-based Model Context Protocol server for Odoo.sh - Build custom apps with AI assistance using Git workflow tools
- π SSH-Based Access: Secure connection via SSH keys (no API token needed)
- πΏ Branch Operations: View branches, get current branch, commit history
- ποΈ Build Management: Trigger builds, monitor status, view logs
- πΎ Database Access: List PostgreSQL databases and sizes
- π» System Monitoring: Hostname, uptime, disk, memory, versions
- π Odoo Shell: Execute Python code in Odoo environment
- π File Management: Create, read, update files with base64 encoding
- π Directory Operations: Create directory structures for modules
- π Git Status: Check modified, staged, and untracked files
- β Git Add: Stage files for commit (single or multiple)
- β Git Commit: Commit changes with custom messages
- π Git Push: Push commits to remote Odoo.sh repository
- πΏ Git Checkout: Switch branches or create new feature branches
- π Git Pull: Sync changes from remote
- π οΈ AI-Assisted Development: Let AI agents build complete Odoo modules
- Quick Start
- Installation
- Configuration
- Usage
- Available Tools
- Prompts
- Development
- Troubleshooting
- Architecture
- Contributing
- License
# 1. Install dependencies
npm install
# 2. Configure environment
cp .env.example .env
# Edit .env and add your ODOO_SH_API_TOKEN
# 3. Build
npm run build
# 4. Add to your MCP client config (e.g., Claude Desktop)
# See Configuration section below- Node.js >= 18.0.0
- npm (comes with Node.js)
- Odoo.sh Account with SSH access
- OpenSSH client installed (included in Windows 10+, macOS, Linux)
- MCP Client (Warp, Claude Desktop, Cline, Continue, etc.)
-
Clone or download this repository
-
Install dependencies:
npm install
-
Set up SSH access:
- Add your SSH public key to Odoo.sh (Settings β Collaborators β SSH Keys)
- Get your build ID and hostname from Odoo.sh (format:
BUILD_ID@project-name.dev.odoo.com) - Save your private key to a secure location
-
Build the project:
npm run build
Create a .env file or set environment variables:
ODOO_SH_SSH_HOST=project-name.dev.odoo.com
ODOO_SH_SSH_USER=BUILD_ID # e.g., 25357858
ODOO_SH_SSH_KEY_PATH=/path/to/ssh/key # Absolute path to private key
ODOO_SH_SSH_PORT=22 # Optional: default 22
ODOO_SH_SSH_PASSPHRASE= # Optional: if key has passphrase
SSH_TIMEOUT=30000 # Optional: milliseconds
LOG_LEVEL=info # Optional: debug, info, warn, errorπ Security Tip: Never commit your private SSH key. Use absolute paths and secure permissions (chmod 600).
Edit claude_desktop_config.json:
{
"mcpServers": {
"odoo-sh": {
"command": "node",
"args": [
"/absolute/path/to/Odoo.sh MCP/dist/index.js"
],
"env": {
"ODOO_SH_SSH_HOST": "project-name.dev.odoo.com",
"ODOO_SH_SSH_USER": "BUILD_ID",
"ODOO_SH_SSH_KEY_PATH": "/absolute/path/to/ssh/key"
}
}
}
}Add to VSCode settings:
{
"cline.mcpServers": {
"odoo-sh": {
"command": "node",
"args": ["/absolute/path/to/Odoo.sh MCP/dist/index.js"],
"env": {
"ODOO_SH_SSH_HOST": "${env:ODOO_SH_SSH_HOST}",
"ODOO_SH_SSH_USER": "${env:ODOO_SH_SSH_USER}",
"ODOO_SH_SSH_KEY_PATH": "${env:ODOO_SH_SSH_KEY_PATH}"
}
}
}
}Note: Use absolute paths to dist/index.js.
Once configured, your AI assistant can use Odoo.sh tools directly:
Check project info:
"Show me my Odoo.sh project information"
Check build status:
"What's the status of recent builds?"
View build logs:
"Show me the recent Odoo logs"
Create a new Odoo module:
"Create a new custom Odoo module called 'my_custom_app' with the basic structure"
The AI agent can:
- Create directory structure:
my_custom_app/,my_custom_app/models/, etc. - Create
__init__.py,__manifest__.pyfiles - Create model files with Python code
- Create XML view files
- Stage all files with
git add - Commit with descriptive message
- Push to trigger Odoo.sh build
Modify existing module:
"Add a new field 'phone' to the Partner model in my_custom_app"
Complete development workflow example:
"I want to build a customer feedback module:
1. Create module structure for 'customer_feedback'
2. Add a Feedback model with fields: customer_id, rating, comment, date
3. Create list and form views
4. Add menu items
5. Commit and push to main branch"
The server provides 19 tools for Odoo.sh operations via SSH, including complete Git workflow support for building custom apps:
get_project_info: Get project information including branch list- Returns: project name, repository, list of branches
- π‘ Use this to list branches (recommended over
list_branches)
get_current_branch: Get the currently checked out branch- Returns: current branch name
list_branches: List branches with commit info- Returns: branch names with last commit hash and message
β οΈ Known issue: May not work in some MCP clients (useget_project_infoinstead)
get_build_history: Get commit/build history for a branch- Parameters:
branch(e.g., "main"),limit(default: 10) - Returns: commit hash, author, date, message
- Parameters:
trigger_build: Trigger a new build by creating empty commit- Parameters:
branch - Returns: git push output
- Parameters:
list_databases: List all PostgreSQL databases- Returns: database names and sizes
get_logs: Get Odoo logs from the server- Parameters:
log_type("odoo", "install", "pip"),lines(default: 100) - Returns: log entries with timestamps
- Parameters:
execute_odoo_shell: Execute Python code in Odoo shell- Parameters:
python_code - Returns: shell output
- Parameters:
get_system_info: Get system information- Returns: hostname, uptime, disk usage, memory, Python version, Odoo version
git_status: Get git status showing modified, staged, and untracked files- Returns: git status output
write_file: Create or update a file with given content- Parameters:
filePath(relative to~/src/user),content - Returns: success message
- π‘ Uses base64 encoding to safely transfer file content via SSH
- Parameters:
read_file: Read the contents of a file- Parameters:
filePath(relative to~/src/user) - Returns: file content
- Parameters:
list_files: List files and directories in a path- Parameters:
dirPath(optional, default:., relative to~/src/user) - Returns:
ls -laoutput
- Parameters:
create_directory: Create a directory (including parent directories)- Parameters:
dirPath(relative to~/src/user) - Returns: success message
- Parameters:
git_add: Stage files for commit- Parameters:
files(array of file paths or.for all) - Returns: git add output
- Parameters:
git_commit: Commit staged changes- Parameters:
message - Returns: git commit output
- Parameters:
git_push: Push commits to remote repository- Parameters:
branch(optional, defaults to current branch) - Returns: git push output
- Parameters:
git_checkout: Switch to a branch or create a new branch- Parameters:
branch,createNew(optional, default: false) - Returns: git checkout output
- Parameters:
git_pull: Pull changes from remote repository- Returns: git pull output
Guided workflows for common tasks:
Comprehensive build status check for a project:
- Lists all branches
- Shows recent builds
- Highlights failures
- Displays build trends
Usage: check_build_status with project_id
Step-by-step deployment guidance:
- Checks current branch status
- Verifies pending builds
- Validates database backups
- Guides through deployment
- Provides verification steps
Usage: deploy_workflow with project_id and environment
# Build TypeScript
npm run build
# Development mode (auto-rebuild)
npm run dev
# Run tests
npm test
# Watch tests
npm test:watch
# Lint code
npm run lint
# Format code
npm run formatodoo-mcp-server/
βββ src/
β βββ index.ts # MCP server implementation
β βββ odoo-client.ts # Odoo.sh API client
βββ tests/ # Test files (to be added)
βββ docs/
β βββ Runbook.md # Setup and usage guide
β βββ DECISIONS.md # Architectural decisions
β βββ Troubleshooting.md # Known issues
β βββ Docs-Index.md # External references
βββ dist/ # Compiled JavaScript (generated)
βββ package.json
βββ tsconfig.json
βββ .env.example
Tests are located in the tests/ directory. Run with:
npm test1. SSH Connection Failed
Error: SSH connection error
Solution:
- Verify SSH key path is correct and absolute
- Check key permissions:
chmod 600 /path/to/key(Unix) oricacls(Windows) - Verify hostname format:
BUILD_ID@project-name.dev.odoo.com - Test manually:
ssh -i /path/to/key BUILD_ID@host
2. list_branches Tool Not Working in Warp
Empty response from list_branches
Solution: Use get_project_info instead - it returns the branch list and works reliably in all MCP clients.
3. Antivirus Blocking SSH Commands (Windows)
Bitdefender: Malicious command line detected
Solution: Whitelist the SSH command or the project directory in your antivirus settings.
4. Server Not Appearing
- Verify JSON syntax in MCP client config
- Check absolute path to
dist/index.js - Verify environment variables are set
- Restart MCP client
5. Module Not Found
Error: Cannot find module '@modelcontextprotocol/sdk/server/index.js'
Solution: Run npm install and npm run build
See docs/Troubleshooting.md for more issues and solutions.
- Runtime: Node.js >= 18.0.0
- Language: TypeScript 5.3
- Protocol: Model Context Protocol (MCP)
- SSH Client: OpenSSH (subprocess)
- Validation: Zod
- Transport: stdio
Key architectural decisions are documented in docs/DECISIONS.md and docs/SSH-MIGRATION.md:
- dec-20251107T160000Z-ssh-over-api: SSH-based access instead of REST API
- Why OpenSSH subprocess was chosen over Node.js ssh2 library
- How Windows % escaping issues were resolved
- Git command optimization for performance
Contributions are welcome! Please:
- Follow existing code style (use
npm run format) - Add tests for new features
- Update documentation (README, Runbook, DECISIONS.md)
- Document issues in Troubleshooting.md
MIT License - see LICENSE file for details.
- Odoo.sh Documentation: https://www.odoo.com/documentation/17.0/administration/odoo_sh.html
- MCP Specification: https://spec.modelcontextprotocol.io/
- MCP TypeScript SDK: https://github.com/modelcontextprotocol/typescript-sdk
Maintained by: Odoo MCP Server Contributors
Version: 0.1.0