Scope MCP client access to specific threads/projects (and refresh tokens for remote MCP)
Feature request: scope MCP client access to specific threads/projects (+ refresh for remote MCP)
Use case. We run a backend service (on another server) that needs to wake one dedicated T3 Code thread when something happens (e.g. a support conversation needs attention), and read that thread's result. Today the only way to do this is a bearer session or the remote MCP via T3 Connect/OAuth.
Problem.
- Scopes are global. The minimum that lets a client send to a thread (
orchestration:read+orchestration:operate) also lets it read every thread and project, and start/stop threads anywhere. There is no way to say "this client may only message and read thread X (and its sub-threads)", or "only threads in project Y", or "only threads this client created". The "only threads this link started" limit exists for linked environments in Supervised mode, but not for regular MCP clients. - Remote MCP via OAuth issues a 30-day token with no refresh token, so a headless server client can't keep working without a person re-approving in a browser.
Request.
- A scope (or approval option) that restricts an MCP client / bearer session to an allowlist of thread ids and/or project ids, or to threads it created (same rule as Supervised linked environments), including reads.
- Refresh tokens (or a long-lived, revocable, narrowly scoped token) for remote MCP clients, so a server can stay connected without a browser.
- Optional: an event when a run finishes (webhook/MCP notification) so clients don't need
t3_thread_waitloops.
Workaround today. A small local MCP gate that holds the full token and only exposes fixed tools for two thread ids. It works, but a native scoped token would be safer and simpler.
Thanks for T3 Code!
Thanks for writing this up. It asks for new behaviour rather than reporting a defect, so it does not belong in the bug tracker and I'm closing it as not planned here. Feature ideas are discussed in Discussions: please post it there.