mseep-odoo-mcp 0.0.3__py3-none-any.whl → 0.0.5__py3-none-any.whl

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.
@@ -0,0 +1,32 @@
1
+ Metadata-Version: 2.4
2
+ Name: mseep-odoo-mcp
3
+ Version: 0.0.5
4
+ Summary: MCP Server for Odoo Integration
5
+ Home-page:
6
+ Author: mseep
7
+ Author-email: mseep <support@skydeck.ai>
8
+ Maintainer-email: mseep <support@skydeck.ai>
9
+ License: MIT
10
+ Keywords: odoo,mcp,server
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Operating System :: OS Independent
15
+ Requires-Python: >=3.6
16
+ Description-Content-Type: text/markdown
17
+ License-File: LICENSE
18
+ Requires-Dist: mcp>=0.1.1
19
+ Requires-Dist: requests>=2.31.0
20
+ Requires-Dist: pypi-xmlrpc==2020.12.3
21
+ Provides-Extra: dev
22
+ Requires-Dist: black; extra == "dev"
23
+ Requires-Dist: isort; extra == "dev"
24
+ Requires-Dist: mypy; extra == "dev"
25
+ Requires-Dist: ruff; extra == "dev"
26
+ Requires-Dist: build; extra == "dev"
27
+ Requires-Dist: twine; extra == "dev"
28
+ Dynamic: author
29
+ Dynamic: license-file
30
+ Dynamic: requires-python
31
+
32
+ # Package managed by MseeP.ai
@@ -0,0 +1,10 @@
1
+ mseep_odoo_mcp-0.0.5.dist-info/licenses/LICENSE,sha256=_FwB4PGxcQWsToTqX33moF0HqnB45Ox6Fr0VPJiLyBI,1071
2
+ odoo_mcp/__init__.py,sha256=fw0VD6ow8QmzQ4L8DxyneEMqC6bgAEde62nvEUqiGgQ,102
3
+ odoo_mcp/__main__.py,sha256=H_46LG58iV38bLXANKQW-Hzi5iQ7Ww34RtgIVe3YMHk,1834
4
+ odoo_mcp/odoo_client.py,sha256=dc8QgFrYC_sLt0dAIE_iCkXd9WLrbtuNTAwBkNMQzfs,14534
5
+ odoo_mcp/server.py,sha256=f5ukjDgYLTN4wL96xJWTyoMak6qF-LV6AO8bYs16PvA,14995
6
+ mseep_odoo_mcp-0.0.5.dist-info/METADATA,sha256=OekAobuJ-lFqGR4lcT5B8KLqaRjtsIvqcl5LoTyBonI,962
7
+ mseep_odoo_mcp-0.0.5.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
8
+ mseep_odoo_mcp-0.0.5.dist-info/entry_points.txt,sha256=VAFapQ2i2fiMrM5fRcxVz1c9M3j-5RZ6QCJJT6taxQk,52
9
+ mseep_odoo_mcp-0.0.5.dist-info/top_level.txt,sha256=U9N8tvrkBgl0wl-xe8OmrJhxfpOdynRAVA7XFJIi7rk,9
10
+ mseep_odoo_mcp-0.0.5.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (78.1.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
odoo_mcp/odoo_client.py CHANGED
@@ -88,26 +88,22 @@ class OdooClient:
88
88
 
89
89
  # Xác thực và lấy user ID
90
90
  print(
91
- f"Authenticating with database: {
92
- self.db}, username: {self.username}",
91
+ f"Authenticating with database: {self.db}, username: {self.username}",
93
92
  file=os.sys.stderr,
94
93
  )
95
94
  try:
96
95
  print(
97
- f"Making request to {
98
- self.hostname}/xmlrpc/2/common (attempt 1)",
96
+ f"Making request to {self.hostname}/xmlrpc/2/common (attempt 1)",
99
97
  file=os.sys.stderr,
100
98
  )
101
99
  self.uid = self._common.authenticate(
102
100
  self.db, self.username, self.password, {}
103
101
  )
104
102
  if not self.uid:
105
- raise ValueError(
106
- "Authentication failed: Invalid username or password")
103
+ raise ValueError("Authentication failed: Invalid username or password")
107
104
  except (socket.error, socket.timeout, ConnectionError, TimeoutError) as e:
108
105
  print(f"Connection error: {str(e)}", file=os.sys.stderr)
109
- raise ConnectionError(
110
- f"Failed to connect to Odoo server: {str(e)}")
106
+ raise ConnectionError(f"Failed to connect to Odoo server: {str(e)}")
111
107
  except Exception as e:
112
108
  print(f"Authentication error: {str(e)}", file=os.sys.stderr)
113
109
  raise ValueError(f"Failed to authenticate with Odoo: {str(e)}")
@@ -161,8 +157,7 @@ class OdooClient:
161
157
 
162
158
  # Then read the model data with only the most basic fields
163
159
  # that are guaranteed to exist in all Odoo versions
164
- result = self._execute(
165
- "ir.model", "read", model_ids, ["model", "name"])
160
+ result = self._execute("ir.model", "read", model_ids, ["model", "name"])
166
161
 
167
162
  # Extract and sort model names alphabetically
168
163
  models = sorted([rec["model"] for rec in result])
@@ -337,11 +332,9 @@ class RedirectTransport(xmlrpc.client.Transport):
337
332
  )
338
333
  else:
339
334
  if self.use_https:
340
- connection = http.client.HTTPSConnection(
341
- host, timeout=self.timeout)
335
+ connection = http.client.HTTPSConnection(host, timeout=self.timeout)
342
336
  else:
343
- connection = http.client.HTTPConnection(
344
- host, timeout=self.timeout)
337
+ connection = http.client.HTTPConnection(host, timeout=self.timeout)
345
338
 
346
339
  return connection
347
340
 
@@ -370,8 +363,7 @@ class RedirectTransport(xmlrpc.client.Transport):
370
363
  print(f"Error during request: {str(e)}", file=os.sys.stderr)
371
364
  raise
372
365
 
373
- raise xmlrpc.client.ProtocolError(
374
- host + handler, 310, "Too many redirects", {})
366
+ raise xmlrpc.client.ProtocolError(host + handler, 310, "Too many redirects", {})
375
367
 
376
368
 
377
369
  def load_config():
@@ -425,8 +417,7 @@ def get_odoo_client():
425
417
  timeout = int(
426
418
  os.environ.get("ODOO_TIMEOUT", "30")
427
419
  ) # Increase default timeout to 30 seconds
428
- verify_ssl = os.environ.get("ODOO_VERIFY_SSL", "1").lower() in [
429
- "1", "true", "yes"]
420
+ verify_ssl = os.environ.get("ODOO_VERIFY_SSL", "1").lower() in ["1", "true", "yes"]
430
421
 
431
422
  # Print detailed configuration
432
423
  print("Odoo client configuration:", file=os.sys.stderr)
@@ -1,270 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mseep-odoo-mcp
3
- Version: 0.0.3
4
- Summary: MCP Server for Odoo Integration
5
- Home-page:
6
- Author: mseep
7
- Author-email: Lê Anh Tuấn <justin.le.1105@gmail.com>
8
- License: MIT
9
- Project-URL: Homepage, https://github.com/tuanle96/mcp-odoo
10
- Project-URL: Issues, https://github.com/tuanle96/mcp-odoo/issues
11
- Keywords: odoo,mcp,server
12
- Classifier: License :: OSI Approved :: MIT License
13
- Classifier: Programming Language :: Python :: 3
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Operating System :: OS Independent
16
- Requires-Python: >=3.6
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: mcp>=0.1.1
20
- Requires-Dist: requests>=2.31.0
21
- Requires-Dist: xmlrpc>=0.4.1
22
- Provides-Extra: dev
23
- Requires-Dist: black; extra == "dev"
24
- Requires-Dist: isort; extra == "dev"
25
- Requires-Dist: mypy; extra == "dev"
26
- Requires-Dist: ruff; extra == "dev"
27
- Requires-Dist: build; extra == "dev"
28
- Requires-Dist: twine; extra == "dev"
29
- Dynamic: author
30
- Dynamic: license-file
31
- Dynamic: requires-python
32
-
33
- # Odoo MCP Server
34
-
35
- An MCP server implementation that integrates with Odoo ERP systems, enabling AI assistants to interact with Odoo data and functionality through the Model Context Protocol.
36
-
37
- ## Features
38
-
39
- * **Comprehensive Odoo Integration**: Full access to Odoo models, records, and methods
40
- * **XML-RPC Communication**: Secure connection to Odoo instances via XML-RPC
41
- * **Flexible Configuration**: Support for config files and environment variables
42
- * **Resource Pattern System**: URI-based access to Odoo data structures
43
- * **Error Handling**: Clear error messages for common Odoo API issues
44
- * **Stateless Operations**: Clean request/response cycle for reliable integration
45
-
46
- ## Tools
47
-
48
- * **search_records**
49
- * Search for records in any Odoo model
50
- * Inputs:
51
- * `model` (string): The model name (e.g., 'res.partner')
52
- * `domain` (array): Search domain (e.g., [['is_company', '=', true]])
53
- * `fields` (optional array): Optional fields to fetch
54
- * `limit` (optional number): Maximum number of records to return
55
- * Returns: Matching records with requested fields
56
-
57
- * **read_record**
58
- * Read details of a specific record
59
- * Inputs:
60
- * `model` (string): The model name (e.g., 'res.partner')
61
- * `id` (number): The record ID
62
- * `fields` (optional array): Optional fields to fetch
63
- * Returns: Record data with requested fields
64
-
65
- * **create_record**
66
- * Create a new record in Odoo
67
- * Inputs:
68
- * `model` (string): The model name (e.g., 'res.partner')
69
- * `values` (object): Dictionary of field values
70
- * Returns: Dictionary with the new record ID
71
-
72
- * **update_record**
73
- * Update an existing record
74
- * Inputs:
75
- * `model` (string): The model name (e.g., 'res.partner')
76
- * `id` (number): The record ID
77
- * `values` (object): Dictionary of field values to update
78
- * Returns: Dictionary indicating success
79
-
80
- * **delete_record**
81
- * Delete a record from Odoo
82
- * Inputs:
83
- * `model` (string): The model name (e.g., 'res.partner')
84
- * `id` (number): The record ID
85
- * Returns: Dictionary indicating success
86
-
87
- * **execute_method**
88
- * Execute a custom method on an Odoo model
89
- * Inputs:
90
- * `model` (string): The model name (e.g., 'res.partner')
91
- * `method` (string): Method name to execute
92
- * `args` (optional array): Positional arguments
93
- * `kwargs` (optional object): Keyword arguments
94
- * Returns: Dictionary with the method result
95
-
96
- * **get_model_fields**
97
- * Get field definitions for a model
98
- * Inputs:
99
- * `model` (string): The model name (e.g., 'res.partner')
100
- * Returns: Dictionary with field definitions
101
-
102
- * **search_employee**
103
- * Search for employees by name.
104
- * Inputs:
105
- * `name` (string): The name (or part of the name) to search for.
106
- * `limit` (optional number): The maximum number of results to return (default 20).
107
- * Returns: List of matching employee names and IDs.
108
-
109
- * **search_holidays**
110
- * Searches for holidays within a specified date range.
111
- * Inputs:
112
- * `start_date` (string): Start date in YYYY-MM-DD format.
113
- * `end_date` (string): End date in YYYY-MM-DD format.
114
- * `employee_id` (optional number): Optional employee ID to filter holidays.
115
- * Returns: List of holidays found.
116
-
117
- ## Resources
118
-
119
- * **odoo://models**
120
- * Lists all available models in the Odoo system
121
- * Returns: JSON array of model information
122
-
123
- * **odoo://model/{model_name}**
124
- * Get information about a specific model including fields
125
- * Example: `odoo://model/res.partner`
126
- * Returns: JSON object with model metadata and field definitions
127
-
128
- * **odoo://record/{model_name}/{record_id}**
129
- * Get a specific record by ID
130
- * Example: `odoo://record/res.partner/1`
131
- * Returns: JSON object with record data
132
-
133
- * **odoo://search/{model_name}/{domain}**
134
- * Search for records that match a domain
135
- * Example: `odoo://search/res.partner/[["is_company","=",true]]`
136
- * Returns: JSON array of matching records (limited to 10 by default)
137
-
138
- ## Configuration
139
-
140
- ### Odoo Connection Setup
141
-
142
- 1. Create a configuration file named `odoo_config.json`:
143
-
144
- ```json
145
- {
146
- "url": "https://your-odoo-instance.com",
147
- "db": "your-database-name",
148
- "username": "your-username",
149
- "password": "your-password-or-api-key"
150
- }
151
- ```
152
-
153
- 2. Alternatively, use environment variables:
154
- * `ODOO_URL`: Your Odoo server URL
155
- * `ODOO_DB`: Database name
156
- * `ODOO_USERNAME`: Login username
157
- * `ODOO_PASSWORD`: Password or API key
158
- * `ODOO_TIMEOUT`: Connection timeout in seconds (default: 30)
159
- * `ODOO_VERIFY_SSL`: Whether to verify SSL certificates (default: true)
160
- * `HTTP_PROXY`: Force the ODOO connection to use an HTTP proxy
161
-
162
- ### Usage with Claude Desktop
163
-
164
- Add this to your `claude_desktop_config.json`:
165
-
166
- ```json
167
- {
168
- "mcpServers": {
169
- "odoo": {
170
- "command": "python",
171
- "args": [
172
- "-m",
173
- "odoo_mcp"
174
- ],
175
- "env": {
176
- "ODOO_URL": "https://your-odoo-instance.com",
177
- "ODOO_DB": "your-database-name",
178
- "ODOO_USERNAME": "your-username",
179
- "ODOO_PASSWORD": "your-password-or-api-key"
180
- }
181
- }
182
- }
183
- }
184
- ```
185
-
186
- ### Docker
187
-
188
- ```json
189
- {
190
- "mcpServers": {
191
- "odoo": {
192
- "command": "docker",
193
- "args": [
194
- "run",
195
- "-i",
196
- "--rm",
197
- "-e",
198
- "ODOO_URL",
199
- "-e",
200
- "ODOO_DB",
201
- "-e",
202
- "ODOO_USERNAME",
203
- "-e",
204
- "ODOO_PASSWORD",
205
- "mcp/odoo"
206
- ],
207
- "env": {
208
- "ODOO_URL": "https://your-odoo-instance.com",
209
- "ODOO_DB": "your-database-name",
210
- "ODOO_USERNAME": "your-username",
211
- "ODOO_PASSWORD": "your-password-or-api-key"
212
- }
213
- }
214
- }
215
- }
216
- ```
217
-
218
- ## Installation
219
-
220
- ### Python Package
221
-
222
- ```bash
223
- pip install odoo-mcp
224
- ```
225
-
226
- ### Running the Server
227
-
228
- ```bash
229
- # Using the installed package
230
- odoo-mcp
231
-
232
- # Using the MCP development tools
233
- mcp dev odoo_mcp/server.py
234
-
235
- # With additional dependencies
236
- mcp dev odoo_mcp/server.py --with pandas --with numpy
237
-
238
- # Mount local code for development
239
- mcp dev odoo_mcp/server.py --with-editable .
240
- ```
241
-
242
- ## Build
243
-
244
- Docker build:
245
-
246
- ```bash
247
- docker build -t mcp/odoo:latest -f Dockerfile .
248
- ```
249
-
250
- ## Parameter Formatting Guidelines
251
-
252
- When using the MCP tools for Odoo, pay attention to these parameter formatting guidelines:
253
-
254
- 1. **Domain Parameter**:
255
- * The following domain formats are supported:
256
- * List format: `[["field", "operator", value], ...]`
257
- * Object format: `{"conditions": [{"field": "...", "operator": "...", "value": "..."}]}`
258
- * JSON string of either format
259
- * Examples:
260
- * List format: `[["is_company", "=", true]]`
261
- * Object format: `{"conditions": [{"field": "date_order", "operator": ">=", "value": "2025-03-01"}]}`
262
- * Multiple conditions: `[["date_order", ">=", "2025-03-01"], ["date_order", "<=", "2025-03-31"]]`
263
-
264
- 2. **Fields Parameter**:
265
- * Should be an array of field names: `["name", "email", "phone"]`
266
- * The server will try to parse string inputs as JSON
267
-
268
- ## License
269
-
270
- This MCP server is licensed under the MIT License.
@@ -1,10 +0,0 @@
1
- mseep_odoo_mcp-0.0.3.dist-info/licenses/LICENSE,sha256=_FwB4PGxcQWsToTqX33moF0HqnB45Ox6Fr0VPJiLyBI,1071
2
- odoo_mcp/__init__.py,sha256=fw0VD6ow8QmzQ4L8DxyneEMqC6bgAEde62nvEUqiGgQ,102
3
- odoo_mcp/__main__.py,sha256=H_46LG58iV38bLXANKQW-Hzi5iQ7Ww34RtgIVe3YMHk,1834
4
- odoo_mcp/odoo_client.py,sha256=tmZs_keeuRBQ77pPHpJ4f4wVCTjhZeahLZ_rZIAruNQ,14699
5
- odoo_mcp/server.py,sha256=f5ukjDgYLTN4wL96xJWTyoMak6qF-LV6AO8bYs16PvA,14995
6
- mseep_odoo_mcp-0.0.3.dist-info/METADATA,sha256=REwngGo1B5exHphpV8TCWgtmqZklbniZIVN2wj4VjtU,7884
7
- mseep_odoo_mcp-0.0.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
8
- mseep_odoo_mcp-0.0.3.dist-info/entry_points.txt,sha256=VAFapQ2i2fiMrM5fRcxVz1c9M3j-5RZ6QCJJT6taxQk,52
9
- mseep_odoo_mcp-0.0.3.dist-info/top_level.txt,sha256=U9N8tvrkBgl0wl-xe8OmrJhxfpOdynRAVA7XFJIi7rk,9
10
- mseep_odoo_mcp-0.0.3.dist-info/RECORD,,