Skip to content
Scalekit Docs
Talk to an EngineerDashboard

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.

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_ENV_URL
    • GITHUB_CONNECTION_NAME (copy the exact Connection name from AgentKit > Connectionsgithub-connect in new environments)

Install the authstack plugin for your coding agent with npx @scalekit-inc/cli setup (or install globally with npm install -g @scalekit-inc/cli then scalekit setup), complete the browser authorization when prompted, then paste the implementation prompt. The agent scaffolds connected account setup, the OAuth flow, and tool execution.

Terminal
npx @scalekit-inc/cli setup

The wizard sets up the right plugins and skills for your editors. Complete any browser authorization for the Scalekit MCP server when prompted. Then use the prompt below (or describe your goal in natural language).

Implementation prompt
Configure Scalekit agent authentication for GitHub. Provide code to create a connected account, generate an authorization link, and, once the user authorizes, star Scalekit's SDK repo (scalekit-inc/scalekit-sdk-python) using Scalekit's tool API.

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.