[Meta] Outside AI: CCC roadmap stream for DrupalCon Orlando 2027
## Summary
Parent: #3586625+s
Let external AI agents, for example Claude Code, Cursor, other coding agents and MCP clients, get approved context from the same library that Drupal AI features use. The site decides which items are shared outside the site, who can read them, and with which limits.
This is one of the three streams in the CCC roadmap:
* **Inside AI:** Drupal AI features on the site.
* **Outside AI:** external AI agents. This meta covers them.
* **People:** the people who work on the site (#3586623).
This meta contains the work for Tool API, MCP and agent hooks. Each of these has its own meta or issue. This meta holds the decisions that affect all three.
Release targets and dates are in the roadmap meta (#3586625). This meta does not repeat them.
This meta covers the work until DrupalCon Orlando 2027. After DrupalCon Orlando, a new meta for DrupalCon Edinburgh 2027 takes over, and the work that is not done moves to it.
## Workflow
Each stream meta uses the same steps. Each step has its own child issue, except where noted. A child issue closes when its result is recorded, and this meta is then updated.
1. **Discuss.** Collect the needs, the questions and the options. Result: a summary of findings.
2. **Initial plan and decisions.** Write a plan that is good enough to start, and record the decisions. Result: a draft plan in this meta. The plan issue then closes.
3. **Prototypes and spikes.** Test the open parts of the plan on an issue fork or a local site. There can be more than one. Prototypes are not merged. Result: findings for each prototype.
4. **Evaluate and update decisions.** Compare the findings with the plan, and update the decisions. Result: the updated plan in this meta.
5. **Implementation.** Build the agreed parts in small issues that each fit in one release.
The Tool API, MCP and agent hooks work each follow these steps in their own meta or issue. This meta collects their results.
## Current status
* **Tool API** (#3586629): steps 1 to 4 are done. The plan (#3574926) and both phases of the Rosetta spike (#3586598, #3586681) are closed. Step 5 (implementation) has started: the scope label map (#3586641) and the reader (#3586716) come first, then the identifiers (#3586717) and the `ai_context_tool` submodule (#3586713). #3586714, #3586694 and #3586715 come later.
* **MCP** (#3574416): steps 1 and 2 are done. The MCP plan (#3586635) is closed, and the bridge is the chosen approach (#3574416 question 10). Step 3 is the real-client spike over the bridge (#3586608), in progress. Step 4 (#3586718) and the release-gate evaluation (#3586719) wait for its findings.
* **Agent hooks** (#3586609): step 1 is done. It is postponed until it has an owner, and the plan issue (#3586632) is also postponed.
* **Shared foundations** (#3586600): step 1 (#3586624) is closed. The draft plan of step 2 is in #3586634. Step 4 is done for the reader and the identifiers. For outside access, step 4 (#3586771) runs after the #3586608 findings.
* **Evaluations** (#3586599): postponed until it has an owner. #3586611 compares how coding agents get context: no context, AGENTS.md, a hook and MCP. It is also postponed and has no owner yet.
## Draft plan
### Ways to reach external agents
| Way | Type | What it does | Needs the outside access model |
|---|---|---|---|
| Tool API tools | Pull | CCC read tools that Drush, ECA, Tool Explorer and Drupal AI agents can use. Through the MCP tool bridge, MCP clients can use them too | Only when MCP clients use them |
| MCP | Pull, and server instructions | Read-only CCC tools for MCP clients, and short instructions for each MCP session | Yes |
| Agent hooks | Push | A Drush command that a hook in the coding agent runs when a session starts, so that the agent gets the context without a tool call | See question 10 in #3586624 |
| AGENTS.md and skills export | Files | Context as files, for agents that have no MCP or hooks. This comes later | Yes (#3586600, children 10 and 11) |
Order:
1. Tool API first. One description of each tool then serves Drush, ECA and AI agents. It also serves MCP through the bridge (see "MCP: bridge or native tools").
2. Agent hooks in parallel, when they have an owner (#3586609 is postponed). They need no Tool API or MCP.
3. MCP after the outside access model exists.
4. File export later.
### Decisions that affect all three
* **Pull and push.** Tool API and MCP tools are pull: the agent decides when to ask. Agent hooks and MCP server instructions are push: they send context when a session starts, without a tool call. A hook delivers the context each time that it runs. But the developer controls whether hooks run, and after an error or a timeout the session starts without CCC context. MCP clients can skip server instructions. No method can make a model follow the context. This answers the question from @Marcus_Johansson on #3586594.
* **MCP: bridge or native tools.** Decided: the bridge for the three CCC tools (#3574416 question 10, and decision 17 in #3574926), because one Tool API description then serves every caller. Native `mcp_server` code is used only for the server instructions and, if they ship, the resources. Step 4 of the MCP meta (#3586718) confirms this after the #3586608 findings. The table shows the options that were compared.
| | Bridge | Native |
|---|---|---|
| For | One description for all callers. Less CCC code. mcp_server_oauth scope checks support bridged tool calls | CCC controls which tools each caller sees. MCP resources are possible. Fewer upstream modules |
| Against | The tool list shows tools that the caller cannot run: bridge 1.0.0-beta4 checks the declared permission (project/mcp_server_tool_bridge#3618720, fixed), but hiding tools for each account needs project/mcp_server#3585931. One tool list for the whole site (project/mcp_server_tool_bridge#3614078). Three beta modules that must be updated together | A third copy of each tool's schema, access checks and output, after the AI function calls and the Tool API tools. More code to maintain |
* **Outside access.** Callers outside the site get only published items that are marked for sharing, through an access profile, and with limits. The shared foundations build this (#3586600, children 7, 9, 10 and 11). Until then, the `remote_invokers` setting of the Tool API submodule (#3586713) keeps all three tools off remote callers such as MCP. The setting is a temporary step (see question 2).
* **Usage records.** Child 8 of #3586600 records the usage of all outside reads, so that the site can see what each agent received. No integration builds its own usage records. Until child 8 ships, reads through Tool API, MCP and agent hooks have no usage records. Child 8 waits for #3567803.
### Rules
* New integrations ship as experimental submodules.
* All outside access is off by default.
* Only published items are returned, and view access is checked on each item.
* Denial messages stay generic, because some upstream modules pass them to the client.
* The docs say that context goes to the agent's own AI provider, which can be a different provider from the site's, and that items must never contain secrets.
### Questions for the plan
1. [ ] Is the order above correct?
2. [x] Does the Tool API setting that blocks remote callers stay, or is it replaced by the outside access model (question 11 in #3586624)? The updated Tool API proposal blocks only Get Relevant and Load, because they can call an AI provider. Does the list tool also stay off remote callers until the outside access model exists? It can return item content to an MCP client without the sharing check. The options, with pros and cons, are in decision 4 in #3574926.
* **Answer:** the setting is a temporary step until the outside access model exists, and it applies to all three tools, also the list tool (decisions 4 and 5 in #3574926, and question 11 in #3586624).
3. [ ] Do agent hooks that use Drush check the sharing setting (question 10 in #3586624)?
* **Proposal** (question 10 in #3586624): the agent hooks command reads as an outside channel, so it returns only items that are shared outside the site. Decided with the agent hooks plan (#3586632), which is postponed until it has an owner. Step 4 of #3586600 (#3586771) can leave this question open for agent hooks.
4. [ ] Which MCP clients does the plan support first, and which client checks are needed (#3586608)?
* **In progress:** #3586608 checks Claude Code, MCP Inspector, and Cursor or VS Code. Step 4 of the MCP meta (#3586718) decides.
## Dependencies
* #3586600: the shared reader and identifiers, which the Tool API tools need, and the outside access model, which MCP needs.
* Upstream modules: tool, mcp_server, mcp_server_tool_bridge and mcp_server_oauth. All are beta or alpha releases, without security advisory coverage.
* project/mcp_server#3585931: hiding tools for each account. Until it is fixed, accounts without an access profile see the CCC tools in the tool list but cannot call them.
## Out of scope
* Drupal AI features on the site: the Inside AI stream.
* Showing context to people: the People stream (#3586623).
* Sharing context between sites: later work (#3586469).
* Tools that change content. All tools in this stream are read-only.
## Child issues
Steps:
* [ ] Discuss: in this issue, and in each child meta
* [ ] Initial plan and decisions: #3586631
* [ ] Evaluate and update decisions (to be filed)
Child metas:
* [ ] #3586629+s
* [ ] #3574416+s
* [ ] #3586609+s
## Related issues
* #3586625+s
* #3586594+s
* #3586600+s
* #3586624+s
* #3586599+s
* #3586611+s
* #3574926+s
* #3586598+s
* #3586608+s
## Stakeholders
* **Owner:** @kepol
* @ahmad-khalil-imagex: owner of the Tool API and MCP work, and of the Rosetta spike
* @Marcus_Johansson: Drupal AI input on Tool API, agent hooks and how outside agents use context
> [!note]
> Check the one that best describes your usage, or leave all unchecked if AI was not significantly used.
>
> * [ ] AI **Assisted Issue** \
> _Mainly written by a human; AI used for partial generation under full human supervision._
>
> * [x] AI **Generated Issue** \
> _Mainly generated by AI, reviewed and approved by a human before this issue was created._
issue
GitLab AI Context
Project: project/ai_context
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/ai_context/-/raw/1.0.x/CONTRIBUTING.md — contribution guidelines
- https://git.drupalcode.org/project/ai_context/-/raw/1.0.x/README.md — project overview and setup
Repository: https://git.drupalcode.org/project/ai_context
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD