Gateway MCP
Each project also exposes its granted integrations as an MCP server, on the app's own origin:
https://<project>.apps.<your-domain>/_tc/int/_mcp
It's meant for agents that run inside an app (for example an assistant built into an internal tool). Every tool call goes through the same pipeline as an tc.int.<name> call from app code: the caller's identity, the grant check, ACCESS_PENDING with a request number, and the audit log.
This surface is groundwork and deliberately minimal. Writes that need a person's approval before they go through (a Teams card to the owner) are planned and not built yet.
Authentication
The gateway accepts the same identities as app code:
| Caller | Header |
|---|---|
| A signed-in user (through the app) | X-TC-User (the Edge adds it to requests on the app's origin) |
| The app itself (cron or worker service) | Authorization: Bearer $TC_PROJECT_TOKEN |
There is no dev token here: the endpoint is for code running on the platform, not for desktop clients.
Tools
Tools appear only for integrations the project has a grant for. Descriptions include the granted scopes.
| Tool | Appears when | Input | What it does |
|---|---|---|---|
graph_get | The project has a graph grant | path (e.g. /v1.0/me; /v1.0 is added if missing) | GET a Microsoft Graph path |
salesforce_query | The project has a salesforce grant | soql | Runs a SOQL SELECT as the signed-in user |
<integration>_query | Any other granted integration (for example erp_query) | sql, params? (array) | Read-only SQL against that system, limited to the granted tables |
teams_notify | The project has a teams grant | to, text | Messages people through the platform bot |
list_grants | Always | none | What this project may call |
Responses are the gateway's raw response text (truncated after 60,000 characters). Refusals come back with isError: true and the gateway's error, such as ACCESS_PENDING.
Example
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js'
import { tc } from '@tenantcloud/sdk'
app.post('/api/assistant', async (req, res) => {
const transport = new StreamableHTTPClientTransport(
new URL(`${process.env.TC_GATEWAY_URL}/_tc/int/_mcp`),
{ requestInit: { headers: { 'x-tc-user': tc.auth.token(req) } } },
)
const client = new Client({ name: 'expenses-assistant', version: '1.0.0' })
await client.connect(transport)
const { tools } = await client.listTools()
// hand `tools` to your model…
})