MCPcopy Index your code
hub / github.com/amp-labs/connectors

github.com/amp-labs/connectors @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
10,168 symbols 54,083 edges 2,924 files 2,847 documented · 28%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<a href="https://www.withampersand.com/?utm_source=github&utm_medium=readme&utm_campaign=connectors-repo&utm_content=logo">
<img src="https://res.cloudinary.com/dycvts6vp/image/upload/v1723671980/ampersand-logo-black.svg" height="30" align="center" alt="Ampersand logo" >
</a>

Star us on GitHub Discord Documentation PRs welcome License

Overview

Ampersand is a declarative platform for SaaS builders who are creating product integrations. It allows you to:

  • Read data from your customer’s SaaS
  • Write data to your customer’s SaaS
  • Subscribe to events (creates, deletes, and field changes) in your customer’s SaaS

Ampersand Connectors

This is a Go library that makes it easier to make API calls to SaaS products such as Salesforce and Hubspot. It handles constructing the correct API requests given desired objects and fields.

It can be either be used as a standalone library, or as a part of the Ampersand platform, which offers additional benefits such as: - Handling auth flows - Orchestration of scheduled reads, real-time writes, or bulk writes - Handling API quotas from SaaS APIs - A dashboard for observability and troubleshooting

The key components of the Ampersand platform include:

  • Manifest file (amp.yaml): Define all your integrations, the APIs to connect to, the objects and fields for reading or writing, and the configuration options you want to expose to your customers.

  • Ampersand server: a managed service that keeps track of each of your customer’s configurations, and makes the appropriate API calls to your customer’s SaaS, while optimizing for cost, handling retries and error message parsing.

  • Embeddable UI components: open-source React components that you can embed to allow your end users to customize and manage their integrations. See the repo for more info.

  • Dashboard: Provides deep observability into customer integrations, allowing you to monitor & troubleshoot with detailed logs.

Add enterprise-grade integrations to your SaaS this week. Get started for free.

<img src="https://res.cloudinary.com/dycvts6vp/image/upload/v1724756323/media/hqukkkmpk96zavslpmw5.png" alt="Ampersand Overview" width="80%">

Using connectors

Supported connectors

Browse the providers directory to see a list of all the connectors that Ampersand supports, and which features are supported for each connector.

Examples

Visit the Ampersand docs to learn about how to use connectors as a part of the Ampersand platform.

See the examples directory for examples of how to use connectors as a standalone library.

Provider Auth Connector Deep Connector Authorization Method
Salesforce example example OAuth2, Authorization Code
Adobe example OAuth2, Client Credentials
Anthropic example API Key
Blueshift example Basic Auth

Concurrency Safety

This codebase uses the future and simultaneously packages to provide safe concurrency primitives. Do NOT use the bare go keyword - always use these primitives instead.

Using the future package

For launching async operations that return a result:

// Instead of: go func() { ... }()
// Use future.Go for simple async operations:
result := future.Go(func() (User, error) {
    return fetchUser(id)
})
user, err := result.Await()

// With context support:
result := future.GoContext(ctx, func(ctx context.Context) (User, error) {
    return fetchUserWithContext(ctx, id)
})
user, err := result.AwaitContext(ctx)

Using the simultaneously package

For running multiple operations in parallel with controlled concurrency:

// Instead of launching multiple goroutines with: go func() { ... }()
// Use simultaneously.Do to run functions in parallel:
err := simultaneously.Do(maxConcurrent,
    func(ctx context.Context) error { return processItem1(ctx) },
    func(ctx context.Context) error { return processItem2(ctx) },
    func(ctx context.Context) error { return processItem3(ctx) },
)

// With context:
err := simultaneously.DoCtx(ctx, maxConcurrent, callbacks...)

Why? These primitives automatically handle panic recovery and prevent unbounded goroutine spawning, protecting against production outages.

Linter

One-time Setup

Build the custom linters:

make custom-gcl

Rebuild the linters from scratch. This is useful when the linter has been expanded with new plugins:

make linter-rebuild

Day-to-Day Usage

Run all linters:

make lint

Automatically apply formatting fixes:

make fix

Tests

Run the full test suite:

make test

Run tests with prettier, more readable output:

make test-pretty

Run tests in parallel to verify test isolation and correctness:

make test-parallel

Notes on parallelized tests: * -parallel=N: Runs up to N (ex:8) test functions concurrently. Useful for speeding up large test suites and for catching concurrency-related bugs. * -count=M: Runs the test M (ex:3) times. This helps catch flakiness or non-deterministic behavior in tests.

Contributors

Thankful to the OSS community for making Ampersand better every day.

Extension points exported contracts — how you extend this code

Connector (Interface)
Connector is an interface that can be used to implement a connector with basic configuration about the provider. [33 implementers]
connectors.go
PathMatcher (Interface)
PathMatcher categorizes paths based on specific criteria. [6 implementers]
tools/fileconv/api3/strategy.go
TestablePostAuthMetadata (Interface)
TestablePostAuthMetadata is the minimal interface for a connector that returns post auth metadata. [14 implementers]
test/utils/testconn/connector.go
Writer (Interface)
Writer represents the ability to write objects to a data source. [42 implementers]
internal/components/methods.go
ErrorDescriptor (Interface)
ErrorDescriptor enhances base error with extra message. Every implementor decides how server response will be converted, [67 …
common/interpreter/formatTemplate.go
ParamAssurance (Interface)
ParamAssurance checks that param data is valid Every param instance must implement it. [44 implementers]
common/paramsbuilder/params.go
AuthenticatedHTTPClient (Interface)
AuthenticatedHTTPClient is an interface for an http client which can automatically authenticate itself. This is useful f [5 …
common/auth.go
CatalogVariable (Interface)
CatalogVariable allows dynamically to replace variables represented with `{{VAR_NAME}}` string. [4 implementers]
common/substitutions/catalogreplacer/catalogVariable.go

Core symbols most depended-on inside this repo

Response
called by 1487
test/utils/mockutils/mockserver/handlers.go
Server
called by 1379
test/utils/mockutils/mockserver/fixed.go
ContentJSON
called by 1343
test/utils/mockutils/mockserver/handlers.go
Path
called by 1133
test/utils/mockutils/mockcond/request.go
DataFromFile
called by 1026
test/utils/testutils/fileReader.go
Fields
called by 1005
providers/hubspot/metadata.go
String
called by 980
common/xml.go
Error
called by 811
test/utils/testutils/checks.go

Shape

Function 5,635
Method 2,897
Struct 1,296
TypeAlias 206
Interface 76
FuncType 58

Languages

Go100%

Modules by API surface

connector/new.go148 symbols
common/types.go94 symbols
internal/future/future_test.go80 symbols
common/http_test.go65 symbols
connectors.go49 symbols
memstore/connector_test.go48 symbols
providers/types.gen.go46 symbols
providers/utils.go41 symbols
providers/salesforce/events.go41 symbols
common/http.go39 symbols
common/scanning/registry.go36 symbols
common/substitutions/substitutions_test.go35 symbols

For agents

$ claude mcp add connectors \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact