loading…
Search for a command to run...
loading…
A Model Context Protocol server that integrates the Sanka TypeScript SDK to provide document search and code execution capabilities. It allows clients to intera
A Model Context Protocol server that integrates the Sanka TypeScript SDK to provide document search and code execution capabilities. It allows clients to interact with Sanka's public API through a hosted HTTP or SSE interface.
This repository contains the hosted Sanka MCP service and the TypeScript client it uses to call Sanka's externally callable API surface. It is now maintained as a normal TypeScript workspace, not as a Stainless-managed repository.
The production service is a remote Streamable HTTP MCP endpoint:
POST /mcp as the primary endpointPOST /sse as a compatibility alias for clients that still expect an SSE-style pathPOST / as a compatibility aliasGET /health for health checksThe /mcp endpoint exposes both the general SDK tools and the read-only CRM tools from a single MCP surface.
Live endpoints:
https://mcp.sanka.com/mcphttps://mcp.sanka.com/sseStaging endpoint:
https://sanka-mcp-staging.fly.dev/mcpsrc/: TypeScript client for Sanka's externally callable API surface, used by the MCP servicesrc/internal/: package-private SDK runtime helpers, not Sanka private backend codepackages/mcp-server/: the MCP server application and Docker entrypoint.github/workflows/: CI plus staging and production Fly deployment workflowsfly.toml: production Fly app configurationfly.staging.toml: staging Fly app configurationdocs/openapi-maintenance.md: guidance for keeping API coverage current without Stainlesssanka-mcp does not run its own OAuth stack. It uses Sanka OAuth directly:
https://app.sanka.com/oauth/authorize/api/v1/oauth/token/api/v1/oauth/revokeFor hosted or local HTTP transport, MCP clients should use native OAuth against the Sanka authorization server exposed in the protected resource metadata. The MCP server accepts only Sanka OAuth bearer tokens and validates them through:
GET /api/v1/oauth/introspectThe same bearer token is then forwarded to the Sanka public API.
Native OAuth-capable clients such as Codex and Claude receive an MCP OAuth challenge during connection or protected tool calls. Clients that do not support native MCP OAuth can still use the protected-tool fallback, which returns a Connect Sanka URL for the user to open.
Developer API tokens are intentionally not supported for MCP access. They remain valid for direct Sanka API and SDK usage outside MCP.
pnpm install
pnpm build
export MCP_SERVER_AUTHORIZATION_SERVER_URL="http://app.localhost:8000"
export MCP_SERVER_OAUTH_CLIENT_ID="your-public-oauth-client-id"
export SANKA_BASE_URL="http://api.localhost:8000"
node packages/mcp-server/dist/index.js --transport=http --port=8080
MCP_SERVER_OAUTH_CLIENT_ID is optional. When present, the server advertises
that OAuth client_id in its authorization server metadata.
Local Sanka prerequisites:
app.localhost:8000 serves /oauth/authorize and /api/v1/oauth/tokenapi.localhost:8000 serves /api/v2/public/*/manage/oauth/:wsid/developers/oauthIf you want to use stdio locally instead of HTTP transport, native OAuth is not
part of the stdio handshake. In that case pass an already-issued Sanka OAuth
access token through SANKA_API_KEY as a local development convenience.
Then verify:
curl http://127.0.0.1:8080/health
curl -sS -D - http://127.0.0.1:8080/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"0.1"}}}'
For a native OAuth-capable MCP client, point the client at http://127.0.0.1:8080/mcp without static auth headers and let the client follow the protected resource metadata to Sanka OAuth.
For manual bearer-token testing:
curl -sS -D - http://127.0.0.1:8080/mcp \
-H 'content-type: application/json' \
-H 'accept: application/json, text/event-stream' \
-H 'authorization: Bearer soat_your_access_token' \
--data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"0.1"}}}'
The browser_use MCP tool dispatches allowlisted browser workflows to a separate worker. The MCP server keeps OAuth, audit metadata, workflow routing, and confirmation gates; the worker owns browser state and third-party UI interaction. The first registered workflow is:
demo.hubspot.company_avatar: update HubSpot demo company avatars through the HubSpot UI when CRM APIs cannot set the visible avatar.Run a local worker with agent-browser:
npm install -g agent-browser
agent-browser install
export SANKA_BROWSER_USE_WORKER_TOKEN="local-worker-token"
export SANKA_BROWSER_USE_PROFILE_ROOT=".browser-use-profiles"
export SANKA_BROWSER_USE_ARTIFACT_DIR=".browser-use-artifacts"
pnpm --dir packages/mcp-server browser-use-worker
Point the MCP server at it:
export SANKA_BROWSER_USE_WORKER_URL="http://127.0.0.1:8787/run"
export SANKA_BROWSER_USE_WORKER_TOKEN="local-worker-token"
For production, deploy the worker as a separate service, for example on Fly, with a persistent volume mounted at SANKA_BROWSER_USE_PROFILE_ROOT so HubSpot login cookies survive restarts. Keep the worker private or token-protected and only expose /run to the MCP service.
See docs/browser-use-worker-fly.md for the Fly worker app, persistent volume, secret wiring, and profile seeding runbook.
This repo deploys to Fly from packages/mcp-server/Dockerfile.
fly deploy -c fly.tomlfly deploy -c fly.staging.tomlstagingmainUse the same promotion shape as the main Sanka app:
staging.staging after CI passes to deploy sanka-mcp-staging.staging -> main.main is ready, run Create new Sanka MCP Tag and Release.Required Fly apps and secrets:
sanka-mcpsanka-mcp-stagingMCP_SERVER_* secrets on both apps unless staging intentionally uses a different auth stack.This repository no longer depends on Stainless project access at runtime or for ongoing development. API coverage should be maintained directly in this repo.
The recommended next step is to adopt open-source OpenAPI tooling for updates to the TypeScript client, rather than reintroducing a hosted generator dependency. See openapi-maintenance.md.
The repo now includes a starter typegen command:
pnpm generate:openapi-types
By default it reads the sibling Sanka spec at ../sanka-sdks/openapi.json.
Run in your terminal:
claude mcp add sanka-mcp-server -- npx CSA PROJECT - FZCO © 2026 IFZA Business Park, DDP, Premises Number 31174 - 001
Security
Low riskAutomated heuristic from public metadata — not a security guarantee.