truck-fastQuickstart

Prerequisites

  • Python 3.11+

  • Python package manager

  • Retrieve from Connectors Console the necessary credentials:

    • GL Connectors Client API Key

    • GL Connectors User Token

Getting Started

1

Installation

uv add gl-connectors-sdk
2

Setting Up the Integration

circle-exclamation

The API Key and User Token are accessible through our console. To use the console, please see the following page: Connectors Console, or if you want to go directly to the console, it is here in https://connector.gdplabs.id/consolearrow-up-right.

In the dashboard, to activate one of the integration, we will use our Google Drive Integration to search for files.

  1. Under Google_drive module, click Add New Integration button

  2. Follow the generated URL and complete the authentication

  3. Later, you will have an active integration for google_drive under your email.

3

Quickstart Example

This example uses search_files action to get 10 files at maximum from google_drive integration that contains "wfo" within the file itself. For this example, we will utilize GL Connectors' Fluent Style executionarrow-up-right for readability.

Retrieve the API Key and User Token from this section respectively. Note that the third section can only be used for MCP Servers.

To run the following script, you will need to replace the following strings in the script below with the appropriate values:

  • GL_CONNECTORS_API_KEY (required) - Use your Client API Key, see above

  • GL_CONNECTORS_USER_TOKEN (required) - Obtained User Token from the console, see above

connectors_quickstart.py
from gl_connectors_sdk.connector import GLConnectors

connector = GLConnectors(api_key="GL_CONNECTORS_API_KEY")

response = (connector.connect('google_drive')
    .action('search_files')
    .params({"query": "name contains 'wfo'"})
    .token('GL_CONNECTORS_USER_TOKEN')
    .run())

print(response.get_data())
triangle-exclamation
4

Running the File

You can then simply run one of the following command depending on your package manager:

  • python connectors_quickstart.py

  • uv run connectors_quickstart.py

5

Understanding the Code

  1. Line 1: Only one import is needed for GLConnectors

  2. Line 3: Instantiates the Connectors with the API Key you've obtained from the Console.

  3. Line 5 - 9: Fluent-style execution. We also offer direct style execution, see the link for complete information. It can be shorter, but for readability, we recommend fluent-style.

    1. Connects to the Connector (for a list of Connector, see Agentic Tools and Model Context Protocol (MCP))

    2. Selects the action to execute (the list of Connector above also lists the possible actions)

    3. Sets the parameters in the form of a dictionary (key, value pair).

    4. Sets the User Token as obtained above. Note that you may retrieve the token from other means. See Credentials for more information.

    5. Executes the Connector and retrieves the response data and status code.

  4. Line 11: Prints it to STDOUT.

GL Connectors MCP

circle-exclamation

GL Connectors provide a comparable MCP server with the Connectors SDK functionality. We provide an MCP Server for each Connectors we have (they are hosted under different MCP endpoints). They are authorized using API Key and the preauthorized token that can be obtained through the above method using GL Connectors SDK. Here we give an example on how to connect to Connector's Github MCP Server.

Claude Desktop (MCP-Remote)

{
  "mcpServers": {
    "connectors-gdrive-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "mcp-remote",
        "https://connector.gdplabs.id/google_drive/mcp",
        "--header", "X-Api-Key:${API_KEY}",
        "--header", "Authorization:${TOKEN}"
      ],
      "env": {
        "API_KEY": "sk-client-...",
        "TOKEN": "Bearer eyJ..."
      }
    }
  }
}

For more details on how to connect various other clients, or what other authentication type is possible, please access via GL Connectors MCP Setup Guide

Last updated