Skip to content
Scalekit Docs

AgentKit: Connect my agent to apps

Build a working agent that makes authenticated tool calls on behalf of users, using GitHub as the example connector.

Architecture diagram: an AI agent connects through Scalekit MCP Gateway with delegated auth, scoped permissions, and tool calls to SaaS apps such as GitHub, Gmail, Slack, and Salesforce.

By the end of this guide, you’ll have a working agent that stars a repository on GitHub on behalf of a user (authenticated with their real account). Scalekit manages the OAuth flow, token storage, and API proxy so you focus on agent logic.

Using a coding agent?

Complete these steps in the Scalekit dashboard before writing any code:

  1. Create a Scalekit account at app.scalekit.com.

  2. Confirm the GitHub connection at Dashboard → AgentKit > Connections.

    New Scalekit environments include a default GitHub connection named github-connect, pre-configured with Scalekit’s managed credentials and the user:email, repo, and public_repo scopes — no connector setup is needed for this quickstart.

    Copy the exact Connection name from that connection and use that value in your code. It must match the dashboard exactly; in older environments or renamed connections the value can differ from github-connect. To connect to other services, create a connection for each app under AgentKit > Connections > Create Connection.

  3. Copy your API credentials at Dashboard → Developers → Settings → API Credentials. Save these values as environment variables:

    • SCALEKIT_CLIENT_ID
    • SCALEKIT_CLIENT_SECRET
    • SCALEKIT_ENVIRONMENT_URL
    • GITHUB_CONNECTION_NAME (copy the exact Connection name from AgentKit > Connectionsgithub-connect in new environments)

Paste this prompt into your coding agent. It builds an agent that stars a GitHub repo on behalf of a user.

Run your agent and confirm:

  • The connected account status is ACTIVE after the user completes the GitHub OAuth flow.
  • The tool call returns success and the star appears on the Scalekit SDK repo on GitHub. Starring is idempotent — GitHub returns success even if the repo is already starred — so re-runs are safe. To confirm programmatically, call github_starred_repos_list and check the repo is in the list.

If the connected account stays in a non-ACTIVE state, the user has not completed the OAuth flow. Regenerate the authorization link and try again.

  • Secure user verification: Confirm the OAuth identity matches your logged-in user before activating a connected account. Required for production.
  • Connected accounts: Manage user connections across multiple providers.
  • Tool calling: Use Scalekit’s optimized tools to call APIs without managing endpoints yourself.