# Set up environment & SDK

This guide shows you how to set up Scalekit in your development environment. You'll configure your workspace, get API credentials, install the SDK, verify everything works correctly, and optionally set up AI-powered development tools.

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 Claude, Cursor, Windsurf, and other MCP-compatible tools.

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

Based on your MCP client, follow the configuration instructions below:

1. Open the Claude Desktop app, go to Settings, then Developer
2. Click Edit Config
3. Open the `claude_desktop_config.json` file
4. Copy and paste the server config to your existing file, then save
5. Restart Claude

```json
{
  "mcpServers": {
    "scalekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.scalekit.com/"]
    }
  }
}
```

1. Open Cursor, go to Settings, then Cursor Settings
2. Select MCP on the left
3. Click Add "New Global MCP Server" at the top right
4. Copy and paste the server config to your existing file, then save
5. Restart Cursor

```json
{
  "mcpServers": {
    "scalekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.scalekit.com/"]
    }
  }
}
```

1. Open Windsurf, go to Settings, then Developer
2. Click Edit Config
3. Open the `windsurf_config.json` file
4. Copy and paste the server config to your existing file, then save
5. Restart Windsurf

```json
{
  "mcpServers": {
    "scalekit": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.scalekit.com/"]
    }
  }
}
```

VS Code version 1.101 or greater supports OAuth natively. Configure the MCP server directly without the `mcp-remote` proxy:

```json
{
  "servers": {
    "scalekit": {
      "type": "http",
      "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:** The Scalekit MCP server source code is available on [GitHub](https://github.com/scalekit-inc/mcp). Feel free to explore the code, raise issues, or contribute new tools.

## 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

![](@/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 AI assistants

Assistants like **Anthropic Claude**, **Ollama**, **Google Gemini**, **Vercel v0**, **OpenAI's ChatGPT**, or your own models can help you with Scalekit projects.

<VideoPlayer link="https://youtu.be/ZDAI32I6s-I" description="AI assistants" />
**Need help with a specific AI tool?:** Don't see instructions for your favorite AI assistant? We'd love to add support for more tools! [Raise an issue](https://github.com/scalekit-inc/developer-docs/issues) on our GitHub repository and let us know which AI tool you'd like us to document.