API & webhooks
MCP serverBeta
Connect AI assistants to STINGIM through the Model Context Protocol server with OAuth 2.1.
The MCP server is in beta. Tool names and scopes are stable; new tools may be added.
The STINGIM MCP server lets AI assistants and agents — Claude Desktop, Cursor, or your own — use your project's data through the Model Context Protocol. Read-only by default; write tools must be granted explicitly.
| Item | Value |
|---|---|
| Endpoint | https://api.stingim.com/v1/mcp |
| Transport | Streamable HTTP, POST only, stateless (no Mcp-Session-Id), JSON responses |
| Protocol versions | 2025-11-25, 2025-06-18, 2025-03-26 (default when the header is missing) |
| Methods | initialize, ping, tools/list, tools/call |
| Batches | Up to 10 messages per request; body up to 256 KiB |
| Auth | Static bearer token (mcp_…) or OAuth 2.1 |
Option 1: access token
- In the console open AI & Knowledge → Custom tools → MCP access (project administrators only).
- Click Create token: give it a name, choose the scopes, an expiry and an optional IP allowlist.
- Copy the token (
mcp_…). It is shown only once; only a hash is stored. Up to 20 tokens per project.
Send it as Authorization: Bearer mcp_….
{
"mcpServers": {
"stingim": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.stingim.com/v1/mcp", "--header", "Authorization:${MCP_TOKEN}"],
"env": { "MCP_TOKEN": "Bearer mcp_YOUR_TOKEN" }
}
}
}Claude Desktop goes in claude_desktop_config.json, Cursor in .cursor/mcp.json.
Option 2: OAuth 2.1
Clients that support MCP authorization can connect with just the endpoint URL. An unauthenticated request returns 401 with:
WWW-Authenticate: Bearer realm="mcp", resource_metadata="https://api.stingim.com/.well-known/oauth-protected-resource/v1/mcp"| Endpoint | URL |
|---|---|
| Protected resource metadata (RFC 9728) | https://api.stingim.com/.well-known/oauth-protected-resource |
| Authorization server metadata (RFC 8414) | https://api.stingim.com/.well-known/oauth-authorization-server |
| Dynamic client registration (RFC 7591) | POST https://api.stingim.com/oauth/register |
| Authorize | https://api.stingim.com/oauth/authorize |
| Token | POST https://api.stingim.com/oauth/token |
| Revoke | POST https://api.stingim.com/oauth/revoke |
- Authorization code flow with PKCE
S256(required); grantsauthorization_codeandrefresh_token. - Client authentication:
none,client_secret_postorclient_secret_basic. Redirect URIs may behttps, loopbackhttpor a private scheme (max 5 per client). - The user is sent to a consent page in the console. Only a project administrator can approve, and chooses which scopes to grant.
- Authorization codes live 60 seconds. Access tokens (
mcpat_…) live 1 hour; refresh tokens (mcprt_…) live 30 days and rotate on use. Reusing a code or refresh token revokes the whole grant. - Tokens are bound to the resource
https://api.stingim.com/v1/mcp(RFC 8707). Theissparameter is returned on authorization responses. - Connected applications are listed under MCP access → Connected applications, where they can be disconnected.
Scopes and tools
| Tool | Scope | Arguments |
|---|---|---|
kb_search — search the knowledge base | kb:read | query (1–500), lang? (en zh th vi id ms), top_k (1–10, default 5), include_help_center (default true) |
faq_get — get an FAQ | kb:read | faq_id (integer), lang? |
ticket_get — get a ticket | tickets:read | ticket_id |
ticket_search — search tickets | tickets:read | query? (≤ 100), status? (open closed), contact_id?, page (1–200), page_size (1–50, default 20) |
contact_lookup — look up a contact | contacts:read | email?, phone?, external_user_id? |
order_status — order status | orders:read | order_number (≤ 40), email?, phone? — needs the Shopify integration |
conversation_summary — summary and recent messages | conversations:read | conversation_id |
conversation_search — search conversations | conversations:read | contact_id?, email?, phone?, keyword? (2–100), status? (open closed waiting bot queued active), date_from?, date_to?, page (1–100), page_size (1–50) |
ticket_create — create a ticket | tickets:create | idempotency_key, contact_id, conversation_id?, title (1–200), description? (≤ 4000), priority? (low medium high urgent) |
ticket_comment — comment on a ticket | tickets:comment | idempotency_key, ticket_id, content (1–4000) |
contact_tag_add — add existing tags to a contact | contacts:tag | idempotency_key, contact_id, tag_names?, tag_ids? (each ≤ 10) |
- IDs match
^[A-Za-z0-9_-]{1,64}$; idempotency keys^[A-Za-z0-9_\-:.]{8,128}$. - Arguments are validated strictly: wrong types are not coerced and unknown fields are rejected.
- Calling a tool outside the token's scopes returns JSON-RPC error
-32602.
Write tools and idempotency
Every write tool requires an idempotency_key:
| Situation | Result |
|---|---|
| New key | Executes and stores the result |
| Same key and arguments, finished | Original result with "idempotent_replay": true; nothing is written twice |
| Same key, different arguments | idempotency_conflict |
| Same key while the first call is still running | in_progress |
Timeout or server error on ticket_create / ticket_comment | outcome_unknown — check with ticket_search, then retry with a new key |
Tool errors
Tool failures come back as a tool result with isError: true and { "error": { "code", "message" } }, so the model can correct itself. Codes: invalid_arguments, not_found, not_connected, not_verified, rate_limited, idempotency_conflict, in_progress, outcome_unknown, unavailable, result_too_large. Results larger than 48,000 bytes are truncated from the end of their list ("truncated": true) or rejected with result_too_large.
Limits
- 120 JSON-RPC requests per minute per token (HTTP
429,Retry-After: 60). - 20 write tool calls per minute per token (
rate_limitedtool error). - Results up to 48,000 bytes.
Usage per token (calls, errors, latency per tool for the last 30 days) is shown on the MCP access page. Secrets such as tokens, passwords, API keys and AI prompts are never included in tool results.
Found a mistake? Email [email protected]
