How to connect your own MCP client or gateway
Off-the-shelf tools like Claude, ChatGPT or Cursor connect to Sally on their own, as described in the Sally MCP connector guide. This page is for everyone who builds the connection themselves: your own agent, a self-hosted chat tool, or a company gateway that routes MCP traffic through a central place.
It covers the endpoint, how a client discovers and registers itself, the OAuth flow, which scopes and lifetimes apply, and how Sally answers when something is not allowed. Every request is shown in cURL, JavaScript and Python.
Quick navigation
- Endpoint and authentication
- Discovery
- Register your client
- Sign in and get tokens
- Call the MCP server
- Scopes and company account
- Token lifetime and ending access
- Manage the registration
- Limits and errors
1. Endpoint and authentication
| Property | Value |
|---|---|
| Endpoint | https://app.sally.io/api/v1/McpExternal |
| Transport | Streamable HTTP, JSON-RPC 2.0 |
| Authentication | Header Authorization: Bearer <token> |
| Accepted tokens | An OAuth access token, or a personal token from Sally (sally_user_mcp_…) |
A personal token is the quick way for scripts and tests, see Create a Personal Access Token. It always includes reading and writing. For a client that many people use, OAuth is the better choice, because every person signs in with their own account and no secret has to be handed out.
2. Discovery
A request without a token gets 401. The WWW-Authenticate header points to the metadata of the protected resource (RFC 9728):
- cURL
- JavaScript
- Python
curl -i -X POST "https://app.sally.io/api/v1/McpExternal" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
const response = await fetch('https://app.sally.io/api/v1/McpExternal', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'tools/list'}),
});
console.log(response.status, response.headers.get('www-authenticate'));
import requests
response = requests.post(
"https://app.sally.io/api/v1/McpExternal",
json={"jsonrpc": "2.0", "id": 1, "method": "tools/list"},
)
print(response.status_code, response.headers.get("WWW-Authenticate"))
WWW-Authenticate: Bearer resource_metadata="https://app.sally.io/.well-known/oauth-protected-resource/api/v1/McpExternal"
That document names the authorization server:
{
"resource": "https://app.sally.io/api/v1/McpExternal",
"authorization_servers": ["https://app.sally.io"],
"scopes_supported": ["openid", "email", "mcp:read", "mcp:write"],
"bearer_methods_supported": ["header"]
}
Its own metadata (RFC 8414) sit at https://app.sally.io/.well-known/oauth-authorization-server and list every endpoint you need:
| Field | Value |
|---|---|
authorization_endpoint | https://app.sally.io/oauth/authorize |
token_endpoint | https://app.sally.io/api/v1/oauth/token |
registration_endpoint | https://app.sally.io/api/v1/oauth/register |
revocation_endpoint | https://app.sally.io/api/v1/oauth/revoke |
grant_types_supported | authorization_code, refresh_token |
code_challenge_methods_supported | S256 |
token_endpoint_auth_methods_supported | none, client_secret_post |
3. Register your client
Clients register themselves dynamically (RFC 7591), nobody has to create them in Sally first. There are two kinds:
- Public client (
token_endpoint_auth_method: "none"): no secret, protected by PKCE withS256. The right choice for desktop apps, CLI tools and everything that runs on the user's device. - Confidential client (
client_secret_post, the default): gets aclient_secret, which it sends with every token request. The right choice for a gateway or a server.
- cURL
- JavaScript
- Python
curl -X POST "https://app.sally.io/api/v1/oauth/register" \
-H "Content-Type: application/json" \
-d '{
"client_name": "Example MCP Gateway",
"redirect_uris": ["https://gateway.example.com/oauth/callback"],
"token_endpoint_auth_method": "client_secret_post"
}'
const response = await fetch('https://app.sally.io/api/v1/oauth/register', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_name: 'Example MCP Gateway',
redirect_uris: ['https://gateway.example.com/oauth/callback'],
token_endpoint_auth_method: 'client_secret_post',
}),
});
const client = await response.json();
import requests
client = requests.post(
"https://app.sally.io/api/v1/oauth/register",
json={
"client_name": "Example MCP Gateway",
"redirect_uris": ["https://gateway.example.com/oauth/callback"],
"token_endpoint_auth_method": "client_secret_post",
},
).json()
{
"client_id": "0b6f4c1e-2d7a-4e8b-9f3c-5a1d2e3f4b6c",
"client_id_issued_at": 1796112000,
"redirect_uris": ["https://gateway.example.com/oauth/callback"],
"token_endpoint_auth_method": "client_secret_post",
"grant_types": ["authorization_code", "refresh_token"],
"response_types": ["code"],
"client_name": "Example MCP Gateway",
"scope": "mcp:read mcp:write",
"client_secret": "…",
"client_secret_expires_at": 0,
"registration_access_token": "…",
"registration_client_uri": "https://app.sally.io/api/v1/oauth/register/0b6f4c1e-2d7a-4e8b-9f3c-5a1d2e3f4b6c"
}
| Field | What it means |
|---|---|
client_secret | Only for confidential clients. Sally shows it exactly once and cannot show it again. Store it right away. |
client_secret_expires_at | Always 0: neither the client nor its secret expires, not even after a long time without use. |
registration_access_token, registration_client_uri | Let the client read, change and delete its own registration, see Manage the registration. |
client_name is optional and cut to 50 characters.
4. Sign in and get tokens
The sign-in is a normal authorization code flow with PKCE. Send the user's browser to the authorization endpoint:
https://app.sally.io/oauth/authorize
?response_type=code
&client_id=<client_id>
&redirect_uri=https://gateway.example.com/oauth/callback
&scope=mcp:read%20mcp:write
&state=<random>
&code_challenge=<S256 challenge>
&code_challenge_method=S256
The user signs in, through SSO if the company uses it, and picks the company account the connection should apply to. Sally then sends the browser back to your redirect_uri with a code. The code is valid for 5 minutes. Exchange it at the token endpoint:
- cURL
- JavaScript
- Python
curl -X POST "https://app.sally.io/api/v1/oauth/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d grant_type=authorization_code \
-d code="$CODE" \
-d redirect_uri="https://gateway.example.com/oauth/callback" \
-d client_id="$CLIENT_ID" \
-d client_secret="$CLIENT_SECRET" \
-d code_verifier="$CODE_VERIFIER"
const response = await fetch('https://app.sally.io/api/v1/oauth/token', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({
grant_type: 'authorization_code',
code: process.env.CODE,
redirect_uri: 'https://gateway.example.com/oauth/callback',
client_id: process.env.CLIENT_ID,
client_secret: process.env.CLIENT_SECRET,
code_verifier: process.env.CODE_VERIFIER,
}),
});
const tokens = await response.json();
import os
import requests
tokens = requests.post(
"https://app.sally.io/api/v1/oauth/token",
data={
"grant_type": "authorization_code",
"code": os.environ["CODE"],
"redirect_uri": "https://gateway.example.com/oauth/callback",
"client_id": os.environ["CLIENT_ID"],
"client_secret": os.environ["CLIENT_SECRET"],
"code_verifier": os.environ["CODE_VERIFIER"],
},
).json()
{
"access_token": "…",
"refresh_token": "…",
"token_type": "Bearer",
"expires_in": 3600,
"scope": "mcp:read mcp:write"
}
A public client leaves out client_secret. The scope field shows what was actually granted, which can differ from what you asked for. When the access token runs out, get a new pair with grant_type=refresh_token, refresh_token and client_id (plus client_secret for a confidential client). The token endpoint accepts form data and JSON. The resource parameter (RFC 8707) is optional and is not evaluated.
5. Call the MCP server
With the access token, the client talks to the endpoint as described in the MCP specification: initialize, then tools/list and tools/call.
- cURL
- JavaScript
- Python
curl -X POST "https://app.sally.io/api/v1/McpExternal" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
const response = await fetch('https://app.sally.io/api/v1/McpExternal', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.ACCESS_TOKEN}`,
'Content-Type': 'application/json',
Accept: 'application/json, text/event-stream',
},
body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'tools/list'}),
});
const {result} = await response.json();
console.log(result.tools.map((tool) => tool.name));
import os
import requests
response = requests.post(
"https://app.sally.io/api/v1/McpExternal",
headers={
"Authorization": f"Bearer {os.environ['ACCESS_TOKEN']}",
"Accept": "application/json, text/event-stream",
},
json={"jsonrpc": "2.0", "id": 1, "method": "tools/list"},
)
print([tool["name"] for tool in response.json()["result"]["tools"]])
Which tools there are and which of them write is listed in the Sally MCP connector guide.
6. Scopes and company account
| Scope | Allows |
|---|---|
mcp:read | All reading tools, for example searching meetings and reading summaries and transcripts. |
mcp:write | Additionally the writing tools, for example creating tasks or scheduling Sally for a meeting. |
Request mcp:read mcp:write if your client should be able to write. Sally checks mcp:write on the server for every writing tool. Without it, the call fails even if the tool shows up in tools/list. Beyond the scope, the same rights apply as in Sally itself: a token never reaches more than the person sees in the web app.
One token, one person, one company account. A token always applies to one person in exactly one company account, the one chosen at sign-in. Whoever works in several company accounts signs in once per account.
The token only works at the MCP server. An OAuth token of an MCP client is not accepted by the rest of the Sally API. The Public API has its own keys.
7. Token lifetime and ending access
| Token | Valid for |
|---|---|
| Access token | 1 hour |
| Refresh token | 90 days |
Every refresh returns a new refresh token, the old one stops working, and the 90 days start again. A refresh token only works for the client it was issued to. As long as a client refreshes at least every 90 days, the connection stays alive.
To end a sign-in, send the refresh token to the revocation endpoint (RFC 7009). It always answers 200, even for an unknown token, so it cannot be used to test tokens:
- cURL
- JavaScript
- Python
curl -X POST "https://app.sally.io/api/v1/oauth/revoke" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d token="$REFRESH_TOKEN"
await fetch('https://app.sally.io/api/v1/oauth/revoke', {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({token: process.env.REFRESH_TOKEN}),
});
import os
import requests
requests.post(
"https://app.sally.io/api/v1/oauth/revoke",
data={"token": os.environ["REFRESH_TOKEN"]},
)
Sign-ins also end when the person changes their password or is removed from the company account. A password change also deactivates the person's personal tokens from Sally.
8. Manage the registration
With the registration_access_token from the registration as a bearer token, the client manages its own registration at registration_client_uri (RFC 7592):
| Method | Effect |
|---|---|
GET | Reads the registration. The answer never contains the client_secret. |
PUT | Changes client_name and redirect_uris. The body must contain the matching client_id. |
DELETE | Shuts the client down and ends every sign-in made through it. Answers 204. |
- cURL
- JavaScript
- Python
curl -X PUT "$REGISTRATION_CLIENT_URI" \
-H "Authorization: Bearer $REGISTRATION_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"client_id": "'"$CLIENT_ID"'",
"client_name": "Example MCP Gateway",
"redirect_uris": ["https://gateway.example.com/oauth/callback"]
}'
const response = await fetch(process.env.REGISTRATION_CLIENT_URI, {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.REGISTRATION_ACCESS_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
client_id: process.env.CLIENT_ID,
client_name: 'Example MCP Gateway',
redirect_uris: ['https://gateway.example.com/oauth/callback'],
}),
});
const registration = await response.json();
import os
import requests
registration = requests.put(
os.environ["REGISTRATION_CLIENT_URI"],
headers={"Authorization": f"Bearer {os.environ['REGISTRATION_ACCESS_TOKEN']}"},
json={
"client_id": os.environ["CLIENT_ID"],
"client_name": "Example MCP Gateway",
"redirect_uris": ["https://gateway.example.com/oauth/callback"],
},
).json()
There is no way to issue a new secret. If a secret is lost or should be replaced, delete the registration and register the client again.
9. Limits and errors
| Status | When | What to do |
|---|---|---|
401 | No token, or the token has expired or was ended. | Refresh the access token, or sign in again if the refresh token no longer works. |
403 | Sally MCP is blocked in the company account. The OAuth token itself is valid. With a personal token, Sally answers 401 with the message This data service is disabled in the target organization. instead. | Ask an owner or admin of the company account. Signing in again does not help. |
429 | More than 600 requests per minute from the same person. | Wait as long as the Retry-After header says, then try again. |
The limit counts per person, across all of their clients. How the Public API handles limits and errors is described under Rate limits and Errors.