Skip to main content
Glama

SourceSync.ai MCP Server

by scmdr

createConnection

Establish a connection to a source such as Notion or Google Drive to ingest selected documents. Specify a custom redirect URL if needed, and obtain an authorization URL for user redirection.

Instructions

Creates a new connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest.

Input Schema

NameRequiredDescriptionDefault
clientRedirectUrlNo
connectorYes
nameYes
namespaceIdNo
tenantIdNo

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "clientRedirectUrl": { "type": "string" }, "connector": { "enum": [ "NOTION", "GOOGLE_DRIVE", "DROPBOX", "ONEDRIVE", "BOX", "SHAREPOINT" ], "type": "string" }, "name": { "type": "string" }, "namespaceId": { "type": "string" }, "tenantId": { "type": "string" } }, "required": [ "name", "connector" ], "type": "object" }

Implementation Reference

  • src/index.ts:636-656 (registration)
    MCP server.tool registration for 'createConnection' tool, including the inline handler function that wraps safeApiCall, creates a SourceSyncApiClient, and invokes its createConnection method.
    server.tool( 'createConnection', 'Creates a new connection to a specific source. The connector parameter should be a valid SourceSync connector enum value. The clientRedirectUrl parameter is optional and can be used to specify a custom redirect URL for the connection. This will give you a authorization url which you can redirect the user to. The user will then be asked to pick the documents they want to ingest.', CreateConnectionSchema.shape, async (params: any) => { return safeApiCall(async () => { const { namespaceId, name, connector, clientRedirectUrl, tenantId } = params // Create a client with the provided parameters const client = createClient({ namespaceId, tenantId }) // Call the createConnection method with the connector as enum return await client.createConnection({ name, connector, clientRedirectUrl, }) }) }, )
  • Core implementation of createConnection in SourceSyncApiClient class: sends POST request to /v1/connections endpoint with namespaceId, name, connector, and clientRedirectUrl.
    public async createConnection({ name, connector, clientRedirectUrl, }: Omit< SourceSyncCreateConnectionRequest, 'namespaceId' >): Promise<SourceSyncCreateConnectionResponse> { return this.client .url('/v1/connections') .json({ namespaceId: this.namespaceId, name, connector, clientRedirectUrl, } satisfies SourceSyncCreateConnectionRequest) .post() .json<SourceSyncCreateConnectionResponse>() }
  • Zod schema definition for CreateConnection tool inputs: namespaceId (opt), name, connector (enum), clientRedirectUrl (opt), tenantId (opt). Also defines ConnectorEnum.
    export const ConnectorEnum = z.nativeEnum(SourceSyncConnector) export const CreateConnectionSchema = z.object({ namespaceId: namespaceIdSchema.optional(), name: z.string(), connector: ConnectorEnum, clientRedirectUrl: z.string().optional(), tenantId: tenantIdSchema, })

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/scmdr/sourcesyncai-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server