Repository navigation
Conversation
Currently translated at 100.0% (43 of 43 strings) Translation: ai-16.0/ai-16.0-ai_oca_mcp Translate-URL: https://translation.odoo-community.org/projects/ai-16-0/ai-16-0-ai_oca_mcp/it/
Currently translated at 100.0% (43 of 43 strings) Translation: ai-16.0/ai-16.0-ai_oca_mcp Translate-URL: https://translation.odoo-community.org/projects/ai-16-0/ai-16-0-ai_oca_mcp/pt_BR/
Currently translated at 4.6% (2 of 43 strings) Translation: ai-16.0/ai-16.0-ai_oca_mcp Translate-URL: https://translation.odoo-community.org/projects/ai-16-0/ai-16-0-ai_oca_mcp/gl/
The MCP endpoint switches to the key's user_id via with_user before serving tools/list and tools/call. mcp.server and mcp.server.key were only accessible to base.group_system, so a non-admin key user hit an AccessError while reading its own key and server. Grant base.group_user read access to both models and add record rules limiting internal users to their own keys (and the servers those keys belong to), while keeping full visibility for administrators.
cover exception in the execute method
it was wrongly set to True we do not notify client if list changed
dreispt
force-pushed
the
19.0-mig-ai_oca_mcp
branch
from
October 7, 2026 16:35
9b188e9 to
3e802f7
Compare
Member
Author
|
/ocabot migration ai_oca_mcp |
dreispt
force-pushed
the
19.0-mig-ai_oca_mcp
branch
from
October 7, 2026 16:48
3e802f7 to
32e2309
Compare
dreispt
force-pushed
the
19.0-mig-ai_oca_mcp
branch
from
October 7, 2026 16:52
32e2309 to
1802891
Compare
Building and dispatching a tool reads ir.model via model_id, which a plain internal user (base.group_user) cannot access. Resolve the model name with sudo() while keeping the actual tool execution under the caller's own permissions, so non-admin MCP keys can list and call tools. Add a regression test exercising a non-admin user through _get_tool_definition and _execute_tool. (cherry picked from commit 16beaa7)
'date' is not a JSON Schema type, so the declared output schema is not valid for MCP clients validating against it. Declare the RFC 3339 format instead. Assisted-by: Devin:SWE-2 High
Port ai_oca_mcp to 19.0, based on the 17.0 migration in OCA#85 and the 18.0 migration in OCA#76. - Replace _sql_constraints with models.Constraint. - Declare the MCP endpoint readonly=False: auth="none" routes default to a read-only cursor in 19.0 and this endpoint always writes (log records, key expiry). - res.users groups_id renamed to group_ids in tests. - Replace per-method ormcache clear_cache() with env.registry.clear_cache() in tests. - Restore the security/security.xml manifest entry lost while rebasing the 17.0 migration over the 16.0 fix commit. - Non-admin key usage additionally requires the ai_tool fixes in the preceding commits: the ir.model metadata lookup cherry-picked from OCA#119, and an equivalent output-schema fix for _ai_get_date. Assisted-by: Devin:SWE-2 High
dreispt
force-pushed
the
19.0-mig-ai_oca_mcp
branch
from
October 7, 2026 17:01
1802891 to
da41802
Compare
Rewrite the readme fragments to document the actual protocol surface (JSON-RPC over HTTP POST, tools/list and tools/call, no SSE), the hashed-key/per-user auth model, key lifecycle and audit logging, the tool-kind limitation, where real capabilities come from (ai_tool_read and other extension modules), and the admin vs internal-user access rules. Update contributors. Assisted-by: Devin:SWE-2 High
MCP's InitializeResult supports an optional instructions field that spec-compliant clients pass to the model. Return an auto-generated capability summary — the server's purpose and the exposed tools with their descriptions — and append the optional instructions text configured on mcp.server for extra context. Assisted-by: Devin:SWE-2 High
dreispt
force-pushed
the
19.0-mig-ai_oca_mcp
branch
from
October 7, 2026 17:09
da41802 to
751606a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migration of
ai_oca_mcpto 19.0.Included PRs / lineage
This branch builds on the full upstream module history rather than a plain copy:
format-patch/git am[FIX] ai_oca_mcp: grant internal users access to their own MCP keys(@nobuQuartile)mcp_server_keyrename, removal of thelistChangedcapability, and coverage improvements (thetest-requirementsCI-hack commit was dropped;ai_toolis released on 19.0)ai_toolfixes for 19.0: their.modelsudo lookup cherry-picked from [19.0][FIX] ai_tool: date output schema and tool model metadata access #119 by @nobuQuartile, plus a re-implementation of the_ai_get_dateoutput-schema fix ([19.0][FIX] ai_tool: date output schema and tool model metadata access #119's version is authored by a bot account, which cannot pass the CLA check). Both commits are included here so the module is testable; they can be dropped on rebase once [FIX] ai_tool: non-admin tool access and valid date output schema #125 merges.19.0 changes
_sql_constraints→models.Constraint(mcp.server,mcp.server.key)ormcache.clear_cache()removed upstream —expire_key()usesself.env.registry.clear_cache()res.users.groups_id→group_idsin test dataauth="none"routes now run in a read-only transaction by default — addedreadonly=Falsesince the MCP endpoint always writes (log records, key expiry)test_urlusesself.base_url()instead of hardcoded127.0.0.1:806919.0.1.0.0; regenerated README/descriptionBeyond the migration
Two commits go further than a straight port and can be split into follow-up PRs if preferred:
[IMP] ai_oca_mcp: revamp module documentation— rewrites the readme fragments to describe the actual protocol surface (JSON-RPC over HTTP POST,tools/list/tools/call, no SSE), the hashed-key/per-user auth model, key lifecycle, auditing, the tool-kind limitation, and where real capabilities come from (ai_tool_read/ extension modules).[IMP] ai_oca_mcp: expose server instructions in the initialize handshake— returns the MCPinstructionsfield: an auto-generated capability summary (server purpose + exposed tool names/descriptions) plus optional per-server free text, so MCP clients can feed usage guidance to the model at handshake time.Tests
16
ai_oca_mcp+ 9ai_tooltests pass against a 19.0 checkout (ai_oca_mcptests issue real MCP-over-HTTP requests and exercise non-admin key access).