> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended**:
> ```bash
> npx @scalekit-inc/cli setup
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for 40+ agents.
> Skills: integrating-agentkit, implementing-saaskit, adding-mcp-oauth, implementing-modular-sso, implementing-scim-provisioning.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Set up environment & SDK

Create a Scalekit account, install the SDK, configure your credentials, and verify the setup. This prepares your environment for adding authentication to your application.

Before you begin, create a Scalekit account if you haven't already. After creating your account, a Scalekit workspace is automatically set up for you with dedicated development and production environments.

[Create a Scalekit account](https://app.scalekit.com/ws/signup)

<br />
<br />

1. ## Get your API credentials

   Scalekit uses the OAuth 2.0 client credentials flow for secure API authentication.

   Navigate to **Dashboard > Developers > Settings > API credentials** and copy these values:

   ```sh showLineNumbers=false title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url> # Example: https://acme.scalekit.dev or https://auth.acme.com (if custom domain is set)
   SCALEKIT_CLIENT_ID=<app-client-id> # Example: skc_1234567890abcdef
   SCALEKIT_CLIENT_SECRET=<app-client-secret> # Example: test_abcdef1234567890
   ```

   Your workspace includes two environment URLs:

   ```md showLineNumbers=false wrap title="Environment URLs"
   https://{your-subdomain}.scalekit.dev  (Development)
   https://{your-subdomain}.scalekit.com  (Production)
   ```

   View your environment URLs in **Dashboard > Developers > Settings**.

2. ## Install and initialize the SDK

   Choose your preferred language and install the Scalekit SDK:

   <InstallSDK />

   After installation, initialize the SDK with your credentials:

   ```js title="Initialize SDK"
     import { Scalekit } from '@scalekit-sdk/node';

     // Initialize the Scalekit client with your credentials
     const scalekit = new Scalekit(
       process.env.SCALEKIT_ENVIRONMENT_URL,
       process.env.SCALEKIT_CLIENT_ID,
       process.env.SCALEKIT_CLIENT_SECRET
     );
     ```

     ```python title="Initialize SDK"
     from scalekit import ScalekitClient
     import os

     # Initialize the Scalekit client with your credentials
     scalekit_client = ScalekitClient(
       env_url=os.getenv('SCALEKIT_ENVIRONMENT_URL'),
       client_id=os.getenv('SCALEKIT_CLIENT_ID'),
       client_secret=os.getenv('SCALEKIT_CLIENT_SECRET')
     )
     ```

     ```go title="Initialize SDK"
     import (
       "os"
       "github.com/scalekit-inc/scalekit-sdk-go"
     )

     // Initialize the Scalekit client with your credentials
     scalekitClient := scalekit.NewScalekitClient(
       os.Getenv("SCALEKIT_ENVIRONMENT_URL"),
       os.Getenv("SCALEKIT_CLIENT_ID"),
       os.Getenv("SCALEKIT_CLIENT_SECRET"),
     )
     ```

     ```java title="Initialize SDK"
     import com.scalekit.ScalekitClient;

     // Initialize the Scalekit client with your credentials
     ScalekitClient scalekitClient = new ScalekitClient(
       System.getenv("SCALEKIT_ENVIRONMENT_URL"),
       System.getenv("SCALEKIT_CLIENT_ID"),
       System.getenv("SCALEKIT_CLIENT_SECRET")
     );
     ```
**SDK features:** All official SDKs include automatic retries, error handling, typed models, and auth helper methods to simplify your integration.

3. ## Verify your setup

   Test your configuration by listing organizations in your workspace. This confirms your credentials work correctly.

   ```bash wrap showLineNumbers=false title="Authenticate with client credentials"
   # Get an access token
   curl https://<SCALEKIT_ENVIRONMENT_URL>/oauth/token \
     -X POST \
     -H 'Content-Type: application/x-www-form-urlencoded' \
     -d 'client_id=<SCALEKIT_CLIENT_ID>' \
     -d 'client_secret=<SCALEKIT_CLIENT_SECRET>' \
     -d 'grant_type=client_credentials'
   ```

   This returns an access token:

   ```json wrap showLineNumbers=false
   {
     "access_token": "eyJhbGciOiJSUzI1NiIsImInR5cCI6IkpXVCJ9...",
     "token_type": "Bearer",
     "expires_in": 86399,
     "scope": "openid"
   }
   ```

   Use the token to access the Scalekit API

   ```sh wrap showLineNumbers=false title="List organizations"
   curl -L '<SCALEKIT_ENVIRONMENT_URL>/api/v1/organizations?page_size=5' \
     -H 'Authorization: Bearer <ACCESS_TOKEN>'
   ```

   Create a file `verify.js` with the following code:

   ```javascript collapse={1-8} wrap showLineNumbers=false title="verify.js"
   import { ScalekitClient } from '@scalekit-sdk/node';

   const scalekit = new ScalekitClient(
     process.env.SCALEKIT_ENVIRONMENT_URL,
     process.env.SCALEKIT_CLIENT_ID,
     process.env.SCALEKIT_CLIENT_SECRET,
   );

   const { organizations } = await scalekit.organization.listOrganization({
     pageSize: 5,
   });

   console.log(`Name of the first organization: ${organizations[0].display_name}`);
   ```

   Run the verification script:

   ```bash title="Run verification" showLineNumbers=false
   node verify.js
   ```

   Create a file `verify.py` with the following code:

   ```python collapse={1-9} wrap showLineNumbers=false title="verify.py"
   from scalekit import ScalekitClient
   import os

   # Initialize the SDK client
   scalekit_client = ScalekitClient(
     os.getenv('SCALEKIT_ENVIRONMENT_URL'),
     os.getenv('SCALEKIT_CLIENT_ID'),
     os.getenv('SCALEKIT_CLIENT_SECRET')
   )

   org_list = scalekit_client.organization.list_organizations(page_size=5)

   print(f'Name of the first organization: {org_list[0].display_name}')
   ```

   Run the verification script:

   ```bash title="Run verification" showLineNumbers=false
   python verify.py
   ```

   Create a file `verify.go` with the following code:

   ```go collapse={1-18, 23-26} wrap showLineNumbers=false title="verify.go"
   package main

   import (
     "context"
     "fmt"
     "os"
     "github.com/scalekit-inc/scalekit-sdk-go"
   )

   func main() {
     ctx := context.Background()

     scalekitClient := scalekit.NewScalekitClient(
       os.Getenv("SCALEKIT_ENVIRONMENT_URL"),
       os.Getenv("SCALEKIT_CLIENT_ID"),
       os.Getenv("SCALEKIT_CLIENT_SECRET"),
     )

     organizations, err := scalekitClient.Organization.ListOrganizations(ctx, &scalekit.ListOrganizationsParams{
       PageSize: 5,
     })

     if err != nil {
       panic(err)
     }

     fmt.Printf("Name of the first organization: %s\n", organizations[0].DisplayName)
   }
   ```
   Create a file `Verify.java` with the following code:

   ```java collapse={1-7} wrap showLineNumbers=false title="Verify.java"
   import com.scalekit.ScalekitClient;
   import com.scalekit.models.ListOrganizationsResponse;

   public class Verify {
     public static void main(String[] args) {
       ScalekitClient scalekitClient = new ScalekitClient(
         System.getenv("SCALEKIT_ENVIRONMENT_URL"),
         System.getenv("SCALEKIT_CLIENT_ID"),
         System.getenv("SCALEKIT_CLIENT_SECRET")
       );

       ListOrganizationsResponse organizations = scalekitClient.organizations().listOrganizations(5, "");
       System.out.println("Name of the first organization: " + organizations.getOrganizations()[0].getDisplayName());
     }
   }
   ```
   If you see organization data, your setup is complete! You're now ready to implement authentication in your application.

## Set up Scalekit MCP Server Optional

Scalekit's Model Context Protocol (MCP) server connects your AI coding assistants to Scalekit. Manage environments, organizations, users, and authentication through natural language queries in your MCP client.

The MCP server provides AI assistants with tools for environment management, organization and user management, authentication connection setup, role administration, and admin portal access. It uses OAuth 2.1 authentication to securely connect your AI tools to your Scalekit workspace.
**Building your own MCP server?:** If you're building your own MCP server and need to add OAuth-based authorization, check out our guide: [Add auth to your MCP server](/authenticate/mcp/quickstart/).

### Configure your MCP client

Use the most common client configs below. For the full list of supported MCP hosts and editor setups, see the [Scalekit MCP server guide](/dev-kit/ai-assisted-development/scalekit-mcp-server/).

Run this command in your terminal:

```bash title="Terminal"
claude mcp add --transport http scalekit https://mcp.scalekit.com/
```

Edit `~/.cursor/mcp.json`, or open **Cursor Settings → MCP → Add New Global MCP Server** and paste the config:

```json title="~/.cursor/mcp.json" showLineNumbers=false
{
  "mcpServers": {
    "scalekit": {
      "url": "https://mcp.scalekit.com/"
    }
  }
}
```

Run this command in your terminal:

```bash title="Terminal"
codex mcp add scalekit --url https://mcp.scalekit.com/
```

Edit `opencode.json` in your project root:

```json title="opencode.json" showLineNumbers=false
{
  "mcp": {
    "scalekit": {
      "type": "remote",
      "url": "https://mcp.scalekit.com/"
    }
  }
}
```

After configuration, your MCP client will initiate an OAuth authorization workflow to securely connect to Scalekit's MCP server.
**Note:** For Claude Desktop, VS Code, Windsurf, Gemini CLI, Kiro, Warp, Zed, and other hosts, use the full [Scalekit MCP server guide](/dev-kit/ai-assisted-development/scalekit-mcp-server/).

## Configure code editors for Scalekit documentation

In-code editor chat features are powered by models that understand your codebase and project context. These models search the web for relevant information to help you. However, they may not always have the latest information. Follow the instructions below to configure your code editors to explicitly index for up-to-date information.

### Set up Cursor

<VideoPlayer link="https://youtu.be/oMMG1k_9fmU" />

To enable Cursor to access up-to-date Scalekit documentation:

1. Open Cursor settings (Cmd/Ctrl + ,)
2. Navigate to **Indexing & Docs** section
3. Click on **Add**
4. Add `https://docs.scalekit.com/llms-full.txt` to the indexable URLs
5. Click on **Save**

Once configured, use `@Scalekit Docs` in your chat to ask questions about Scalekit features, APIs, and integration guides. Cursor will search the latest documentation to provide accurate, up-to-date answers.

### Use Windsurf

![Windsurf editor with the Cascade chat panel answering a question using indexed Scalekit documentation](@/assets/docs/dev-kit/ai-assisted-setup/windsurf.png)

Windsurf enables `@docs` mentions within the Cascade chat to search for the best answers to your questions.

```
    @docs:https://docs.scalekit.com/llms-full.txt
    <your question here>
    ```
    Costs more tokens.
  ```
    @docs:https://docs.scalekit.com/your-specific-section-or-file
    <your question here>
    ```
    Costs less tokens.
  ```
    @docs:https://docs.scalekit.com/llms.txt
    <your question here>
    ```
    Costs tokens as per the model decisions.
  ## Use a coding agent

<ProductAgentBlock
  skill="implementing-saaskit"
  example="Use implementing-saaskit to add login, sessions, and logout."
  syncKey="setup-scalekit-cli"
/>

Change the skill name if you are adding a different product:

| Product | Example prompt |
| ------- | -------------- |
| AgentKit | `Use integrating-agentkit to connect this agent to GitHub.` |
| MCP authentication | `Use adding-mcp-oauth to add OAuth 2.1 to this MCP server.` |
| Single sign-on (SSO) | `Use implementing-modular-sso to add SAML and OIDC SSO.` |
| SCIM | `Use implementing-scim-provisioning to add user provisioning.` |

See the [Build with AI guide](/dev-kit/build-with-ai/) for the full setup.

<VideoPlayer link="https://youtu.be/ZDAI32I6s-I" description="AI assistants" />

---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
