Skip to content

Extend the internal MCP with trusted Project/Wiki capabilities #3

Description

@LanicBlue

Context

T3 already attaches one product-owned t3-code MCP server to provider sessions. Extend that existing seam with Project/Wiki providers instead of creating service-specific adapter protocols.

Dependencies:

Trusted execution context

Every MCP request must resolve a server-created context, conceptually:

interface ToolExecutionContext {
  environmentId: string
  threadId: string
  providerSessionId: string
  providerInstanceId: string
  logicalAgentId: string
  t3ProjectId: string
  projectServiceProjectId?: string
  capabilities: ReadonlySet<string>
}

The Agent must not provide or override:

  • clientId / consumerId;
  • agentId;
  • projectId;
  • executorRef;
  • Wiki root/subtree identity;
  • Session/Thread identity;
  • service credentials.

Project/Wiki integrations derive those values from the trusted Session and add them to SDK calls behind the MCP boundary.

Capabilities

Decouple MCP attachment from the Browser setting. Model independent capabilities such as:

preview
project.work.read
project.work.write
wiki.read
wiki.write

Disabling Browser access must not disable Project/Wiki. Agent settings changes should refresh/revoke the relevant MCP credential scope without deleting the Session.

Provider adapters

Reuse the generic T3 MCP attachment for:

  • Codex;
  • Claude;
  • Cursor;
  • Grok;
  • locally managed OpenCode.

Externally managed OpenCode servers are explicitly unsupported in this phase. Do not add Project/Wiki-specific code to every adapter.

Project MCP v1

Prefer context-bound tools such as:

project_work_list()
project_work_get(runId)
project_work_submit(runId, revisions, result)
project_operation_get(operationId)

No tool accepts Agent/Project/Client/executor identity. T3 adds agentId + projectId; Project Service derives the authenticated Client half and canonical executorRef.

Expose only an explicit allowlist; do not publish a generic Project HTTP facet to the Agent.

Error boundary

Map Service SDK errors into structured MCP errors, including:

  • authentication invalid/disabled;
  • incompatible SDK/API/protocol;
  • stale assignment/revision;
  • uncertain mutation with operation recovery;
  • integration disabled/unavailable.

Authentication errors leave the Session intact.

Acceptance criteria

  • Project/Wiki tools are registered on the existing internal MCP server.
  • Browser, Project, and Wiki capabilities are independent.
  • MCP context contains the authoritative logical Agent and Project binding.
  • Agent tool inputs cannot select Agent, Project, Client, executorRef, or Wiki root/subtree.
  • Raw service credentials never enter provider-visible environment, prompts, or tool arguments.
  • Supported adapters reuse the same generic MCP surface.
  • External OpenCode server mode is explicitly skipped.
  • Project MCP uses the supported SDK and an explicit tool allowlist.
  • Structured errors preserve authentication/revision/uncertain semantics.
  • Tests cover identity spoof attempts and capability changes.
  • Adding a Project/Wiki operation does not require editing every provider adapter.

Non-goals

  • Do not expose Project/Wiki Services as direct Agent-facing MCP servers.
  • Do not implement a second service-specific tool transport.
  • Do not expose generic admin/maintenance facets to Agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions