How otomatercom-cloud/mcp_server works
This Odoo addon exposes MCP and REST/XML-RPC access to configured Odoo data. The main workflow is an MCP client connecting to /mcp, authenticating, discovering available tools, and invoking read or write operations under the connected user's permissions; binary data can be fetched through resource URIs. OAuth login and API keys are alternative access paths, while administrators configure model permissions and custom tools. Some subsystem links are based on explicit README descriptions or SOURCE INDEX references; unsampled implementations are not inferred beyond those relationships.
Main entry points: mcp.py Native MCP endpoint · mcp_tools_read.py Read tools · mcp_mixin.py Tool registry and gate · oauth_server.py OAuth server
Components 20
Protocols and connection
- Native MCP endpoint
controllers/mcp.py - MCP request dispatcher
controllers/mcp_dispatcher.py - REST and XML-RPC
controllers/api.py
Identity and safeguards
- Authentication
controllers/auth.py - Rate limiting
controllers/rate_limiting.py
MCP tools and data
- Custom tools
models/mcp_custom_tool.py - Tool registry and gate
models/mcp_mixin.py - Read tools
models/mcp_tools_read.py - Write tools
models/mcp_tools_write.py - Output formatting
tools/formatters.py - Smart field metadata
tools/smart_fields.py - Resource URI schema
tools/uri_schema.py
Administration and audit
- Audit logging
controllers/audit.py - Model permissions
models/mcp_enabled_models.py - Server settings
models/res_config_settings.py
OAuth authorization
- OAuth server
controllers/oauth_server.py - OAuth clients
models/oauth_client.py - OAuth tokens
models/oauth_token.py
Other components
- MCP client
- Odoo records and attachments
Connections 26
- MCP client → Native MCP endpoint: calls MCP
README.md - MCP client → OAuth server: signs in
README.md - MCP client → REST and XML-RPC: uses API
README.md - Native MCP endpoint → MCP request dispatcher: routes requests
controllers/mcp.py - MCP request dispatcher → Native MCP endpoint: dispatches methods
controllers/mcp_dispatcher.py - Native MCP endpoint → Tool registry and gate: discovers tools
controllers/mcp.py - Native MCP endpoint → Custom tools: lists custom tools
controllers/mcp.py - Native MCP endpoint → Audit logging: records calls
controllers/mcp.py - Native MCP endpoint → Rate limiting: checks limits
controllers/mcp.py - REST and XML-RPC → Authentication: authenticates
controllers/api.py - REST and XML-RPC → Rate limiting: checks limits
controllers/api.py - Authentication → Audit logging: logs denials
controllers/auth.py - Tool registry and gate → Model permissions: checks enabled models
models/mcp_mixin.py - Read tools → Tool registry and gate: extends registry
models/mcp_tools_read.py - Write tools → Tool registry and gate: extends registry
models/mcp_tools_write.py - Read tools → Output formatting: formats results
models/mcp_tools_read.py - Read tools → Smart field metadata: uses metadata
models/mcp_tools_read.py - Read tools → Resource URI schema: builds resource links
models/mcp_tools_read.py - Tool registry and gate → Resource URI schema: parses resource links
models/mcp_mixin.py - Read tools → Odoo records and attachments: reads records
models/mcp_tools_read.py - Write tools → Odoo records and attachments: mutates records
models/mcp_tools_write.py - OAuth server → OAuth clients: registers clients
models/oauth_client.py - OAuth server → OAuth tokens: issues tokens
models/oauth_token.py - OAuth server → Authentication: resolves users
controllers/oauth_server.py - Server settings → Model permissions: configures permissions
- Custom tools → Odoo records and attachments: runs server actions