iflow-mcp_vzeman-odoo-mcp-server 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/.dockerignore +73 -0
  2. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/.github/workflows/publish.yml +50 -0
  3. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/.gitignore +191 -0
  4. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/CLAUDE.md +112 -0
  5. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/Dockerfile +37 -0
  6. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/LICENSE +674 -0
  7. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/PKG-INFO +1044 -0
  8. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/README.md +1007 -0
  9. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/docker-compose.example.yml +57 -0
  10. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/docs/images/demo.gif +0 -0
  11. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/docs/images/odoo-demo.gif +0 -0
  12. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/docs/images/output-example.png +0 -0
  13. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/env.example +6 -0
  14. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/language.json +1 -0
  15. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/__init__.py +17 -0
  16. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/__main__.py +8 -0
  17. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/config.py +146 -0
  18. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/http_server.py +935 -0
  19. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/logger.py +67 -0
  20. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/odoo_client.py +199 -0
  21. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/server.py +333 -0
  22. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/services/__init__.py +6 -0
  23. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/services/cache_service.py +175 -0
  24. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/mcp_server_odoo/services/odoo_service.py +319 -0
  25. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/nginx.conf +64 -0
  26. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/package_name +1 -0
  27. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/push_info.json +5 -0
  28. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/pyproject.toml +70 -0
  29. iflow_mcp_vzeman_odoo_mcp_server-0.2.0/uv.lock +1100 -0
@@ -0,0 +1,73 @@
1
+ # Git
2
+ .git
3
+ .gitignore
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.so
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # Virtual environments
29
+ venv/
30
+ env/
31
+ ENV/
32
+ env.bak/
33
+ venv.bak/
34
+
35
+ # IDE
36
+ .vscode/
37
+ .idea/
38
+ *.swp
39
+ *.swo
40
+ *~
41
+
42
+ # OS
43
+ .DS_Store
44
+ .DS_Store?
45
+ ._*
46
+ .Spotlight-V100
47
+ .Trashes
48
+ ehthumbs.db
49
+ Thumbs.db
50
+
51
+ # Local files
52
+ .env
53
+ .env.local
54
+ .env.*.local
55
+ *.local
56
+
57
+ # Logs
58
+ logs/
59
+ *.log
60
+
61
+ # Test files
62
+ test_*.py
63
+ tests/
64
+
65
+ # Coverage
66
+ .coverage
67
+ .coverage.*
68
+ .cache
69
+ nosetests.xml
70
+ coverage.xml
71
+ *.cover
72
+ .pytest_cache/
73
+ .hypothesis/
@@ -0,0 +1,50 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+ inputs:
8
+ test_pypi:
9
+ description: 'Publish to Test PyPI instead of PyPI'
10
+ required: false
11
+ type: boolean
12
+ default: false
13
+
14
+ jobs:
15
+ build-and-publish:
16
+ runs-on: ubuntu-latest
17
+ steps:
18
+ - uses: actions/checkout@v4
19
+
20
+ - name: Set up Python
21
+ uses: actions/setup-python@v5
22
+ with:
23
+ python-version: '3.10'
24
+
25
+ - name: Install dependencies
26
+ run: |
27
+ python -m pip install --upgrade pip
28
+ pip install build twine
29
+
30
+ - name: Build package
31
+ run: python -m build
32
+
33
+ - name: Check package
34
+ run: twine check dist/*
35
+
36
+ - name: Publish to Test PyPI
37
+ if: github.event.inputs.test_pypi == 'true'
38
+ env:
39
+ TWINE_USERNAME: __token__
40
+ TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
41
+ run: |
42
+ twine upload --repository testpypi dist/*
43
+
44
+ - name: Publish to PyPI
45
+ if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_pypi != 'true')
46
+ env:
47
+ TWINE_USERNAME: __token__
48
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
49
+ run: |
50
+ twine upload dist/*
@@ -0,0 +1,191 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py,cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Django stuff:
57
+ *.log
58
+ local_settings.py
59
+ db.sqlite3
60
+ db.sqlite3-journal
61
+
62
+ # Flask stuff:
63
+ instance/
64
+ .webassets-cache
65
+
66
+ # Scrapy stuff:
67
+ .scrapy
68
+
69
+ # Sphinx documentation
70
+ docs/_build/
71
+
72
+ # PyBuilder
73
+ target/
74
+
75
+ # Jupyter Notebook
76
+ .ipynb_checkpoints
77
+
78
+ # IPython
79
+ profile_default/
80
+ ipython_config.py
81
+
82
+ # pyenv
83
+ .python-version
84
+
85
+ # pipenv
86
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
87
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
88
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
89
+ # install all needed dependencies.
90
+ #Pipfile.lock
91
+
92
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
93
+ __pypackages__/
94
+
95
+ # Celery stuff
96
+ celerybeat-schedule
97
+ celerybeat.pid
98
+
99
+ # SageMath parsed files
100
+ *.sage.py
101
+
102
+ # Environments
103
+ .env
104
+ .venv
105
+ env/
106
+ venv/
107
+ ENV/
108
+ env.bak/
109
+ venv.bak/
110
+
111
+ # Spyder project settings
112
+ .spyderproject
113
+ .spyproject
114
+
115
+ # Rope project settings
116
+ .ropeproject
117
+
118
+ # mkdocs documentation
119
+ /site
120
+
121
+ # mypy
122
+ .mypy_cache/
123
+ .dmypy.json
124
+ dmypy.json
125
+
126
+ # Pyre type checker
127
+ .pyre/
128
+
129
+ # IDE
130
+ .idea/
131
+ .vscode/
132
+ *.swp
133
+ *.swo
134
+ *~
135
+
136
+ # OS
137
+ .DS_Store
138
+ Thumbs.db
139
+
140
+ # Test files
141
+ test_*.py
142
+
143
+ # Local configuration
144
+ *.local
145
+ .env.local
146
+ .env.*.local
147
+
148
+ # Environment files
149
+ .env
150
+ .env.local
151
+ .env.*.local
152
+
153
+ # Docker Compose with credentials (keep example file)
154
+ docker-compose.yml
155
+ docker-compose.override.yml
156
+
157
+ # Logs
158
+ logs/
159
+ *.log
160
+
161
+ # Virtual environments
162
+ venv/
163
+ env/
164
+ ENV/
165
+ env.bak/
166
+ venv.bak/
167
+
168
+ # IDE
169
+ .vscode/
170
+ .idea/
171
+ *.swp
172
+ *.swo
173
+ *~
174
+
175
+ # OS
176
+ .DS_Store
177
+ Thumbs.db
178
+
179
+ # Test files
180
+ test_*.py
181
+ tests/
182
+
183
+ # Coverage
184
+ .coverage
185
+ .coverage.*
186
+ .cache
187
+ nosetests.xml
188
+ coverage.xml
189
+ *.cover
190
+ .pytest_cache/
191
+ .hypothesis/
@@ -0,0 +1,112 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
+
5
+ ## Project Overview
6
+
7
+ This is a hybrid MCP (Model Context Protocol) server for Odoo ERP integration. It supports both:
8
+ - **HTTP Streaming**: For web-based AI agents and remote access
9
+ - **stdio**: For local AI assistants like Claude Desktop
10
+
11
+ ## Architecture
12
+
13
+ ### Dual Implementation
14
+
15
+ 1. **HTTP Mode** (`http_server.py`):
16
+ - FastAPI-based HTTP server
17
+ - Supports ngrok for remote access
18
+ - Includes caching and advanced features
19
+ - Used for AI agents like Flowhunt
20
+
21
+ 2. **stdio Mode** (`server.py`):
22
+ - Standard MCP stdio implementation
23
+ - Direct integration with Claude Desktop
24
+ - Simpler, lightweight implementation
25
+
26
+ ### Core Components
27
+
28
+ - **`odoo_service.py`**: Advanced service for HTTP mode with caching
29
+ - **`odoo_client.py`**: Simple client for stdio mode
30
+ - **`config.py`**: Configuration management with Pydantic
31
+ - **`cache_service.py`**: Caching system for HTTP mode
32
+
33
+ ## Development Commands
34
+
35
+ ```bash
36
+ # Install dependencies
37
+ pip install -e .
38
+ pip install -e ".[dev]" # For development with test dependencies
39
+
40
+ # Run HTTP server
41
+ python -m mcp_server_odoo.http_server
42
+
43
+ # Run stdio server
44
+ python -m mcp_server_odoo
45
+
46
+ # Run tests
47
+ pytest
48
+ pytest --cov # With coverage report
49
+
50
+ # Type checking
51
+ mypy mcp_server_odoo
52
+
53
+ # Linting
54
+ ruff check .
55
+ ruff format .
56
+ ```
57
+
58
+ ## Environment Configuration
59
+
60
+ ### HTTP Mode
61
+ Uses comprehensive configuration via `config.py`:
62
+ - Odoo credentials
63
+ - Server settings
64
+ - Cache configuration
65
+
66
+ ### stdio Mode
67
+ Uses simple environment variables:
68
+ - `ODOO_URL`
69
+ - `ODOO_DB`
70
+ - `ODOO_USERNAME`
71
+ - `ODOO_API_KEY` or `ODOO_PASSWORD`
72
+
73
+ ## Usage Patterns
74
+
75
+ ### HTTP Mode (AI Agents)
76
+ ```python
77
+ # For Flowhunt and other AI platforms
78
+ # Configure MCP server URL: https://your-ngrok-url.ngrok-free.app
79
+ ```
80
+
81
+ ### stdio Mode (Claude Desktop)
82
+ ```json
83
+ {
84
+ "mcpServers": {
85
+ "odoo": {
86
+ "command": "python",
87
+ "args": ["-m", "mcp_server_odoo"],
88
+ "env": {
89
+ "ODOO_URL": "https://your-instance.odoo.com",
90
+ "ODOO_DB": "your-database",
91
+ "ODOO_USERNAME": "your-email@example.com",
92
+ "ODOO_API_KEY": "your-api-key"
93
+ }
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
99
+ ## Testing Approach
100
+
101
+ - Unit tests for both implementations
102
+ - Integration tests with mock Odoo responses
103
+ - Test MCP protocol compliance for both modes
104
+ - Validate error handling and edge cases
105
+
106
+ ## Security Considerations
107
+
108
+ - Never expose Odoo credentials in logs or error messages
109
+ - Validate and sanitize all inputs before sending to Odoo
110
+ - Use API keys instead of passwords when possible
111
+ - Implement proper SSL context handling
112
+ - Follow principle of least privilege for Odoo user permissions
@@ -0,0 +1,37 @@
1
+ # Use Python 3.11 slim image
2
+ FROM python:3.11-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Set environment variables
8
+ ENV PYTHONDONTWRITEBYTECODE=1 \
9
+ PYTHONUNBUFFERED=1 \
10
+ PIP_NO_CACHE_DIR=1 \
11
+ PIP_DISABLE_PIP_VERSION_CHECK=1
12
+
13
+ # Install system dependencies
14
+ RUN apt-get update && apt-get install -y \
15
+ gcc \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy all files first
19
+ COPY . .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir -e .
23
+
24
+ # Create non-root user
25
+ RUN useradd --create-home --shell /bin/bash app \
26
+ && chown -R app:app /app
27
+ USER app
28
+
29
+ # Expose port
30
+ EXPOSE 8000
31
+
32
+ # Health check
33
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
34
+ CMD python -c "import requests; requests.get('http://localhost:8000/health')" || exit 1
35
+
36
+ # Run the application
37
+ CMD ["python", "-m", "mcp_server_odoo.http_server"]