Skip to main content

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.

Availability

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:

CallerHeader
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.

ToolAppears whenInputWhat it does
graph_getThe project has a graph grantpath (e.g. /v1.0/me; /v1.0 is added if missing)GET a Microsoft Graph path
salesforce_queryThe project has a salesforce grantsoqlRuns a SOQL SELECT as the signed-in user
<integration>_queryAny other granted integration (for example erp_query)sql, params? (array)Read-only SQL against that system, limited to the granted tables
teams_notifyThe project has a teams grantto, textMessages people through the platform bot
list_grantsAlwaysnoneWhat 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​

server.js (an in-app agent's MCP client)
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…
})
Was this page helpful?