Adding a Connector (AI Agent Checklist)
Use this when introducing a new backend connector integration and wiring it through UI/API.Scope
This checklist covers:- connector bootstrap record
- verify dispatch wiring
- connector utility client + verifier
- route wiring
- frontend endpoint/UI integration
1) Add Connector to Seed Data
File:backend/app/db/db_populate.py
Actions:
- Update
get_connectors_list()with your new connector tuple. - Pick exactly one auth mode flag via
accepts_key:host_onlyapi_keyusername_passwordfile
- If needed, define
extra_data_keyenv var forconnector_extra_data. - Ensure env var naming matches
load_connector_data()prefix rule:connector_name.upper().replace("-", "_").replace(" ", "_")
- connector appears in
/api/connectorsafter startup seed.
2) Implement Connector Utility Module
File path (new):backend/app/connectors/<service>/utils/universal.py
Minimum functions to provide:
verify_<service>_connection(connector_name: str)create_<service>_client(connector_name: str = "<Connector-Display-Name>")
- Pull credentials via
get_connector_info_from_dbfrombackend/app/connectors/utils.py. - Return consistent verify payload:
{"connectionSuccessful": bool, "message": str}
- Raise
HTTPExceptionfor hard failures in runtime client creation.
3) Register Verify Dispatch
File:backend/app/connectors/services.py
Actions:
- Import your verifier function.
- Add service class (pattern:
<ServiceName>Service) implementingverify_authentication. - Add mapping in
get_connector_service()service_map:- key must match DB
connector_nameexactly.
- key must match DB
/api/connectors/verify/{id} will return unsupported/None behavior.
4) Add Connector Routes (If Exposing Feature APIs)
Typical files:backend/app/connectors/<service>/routes/*.pybackend/app/connectors/<service>/services/*.pybackend/app/connectors/<service>/schema/*.py
- Add/modify router module
backend/app/routers/<service>.py. - Include route groups with appropriate prefixes/tags.
- Add top-level include in
backend/copilot.py:from app.routers import <service>api_router.include_router(<service>.router)
5) Frontend Endpoint Wiring
Primary files:frontend/src/api/endpoints/connectors.ts- optional new endpoint file if connector has dedicated APIs (pattern in
frontend/src/api/endpoints/*.ts) frontend/src/api/index.ts(export)
- Reuse generic
/connectorsendpoints if only configuring/verifying credentials. - Add dedicated endpoint wrapper(s) for new connector-specific backend routes.
- Ensure payload type definitions exist/update in
frontend/src/types/*.d.ts.
6) Frontend UI Wiring
Connector configuration UI already exists:- View:
frontend/src/views/Connectors.vue - List:
frontend/src/components/connectors/ConnectorsList.vue - Item:
frontend/src/components/connectors/ConnectorItem.vue - Form:
frontend/src/components/connectors/ConfigForm/ConfigForm.vue
- Ensure DB flags (
connector_accepts_*) drive the correct form type. - Add connector logo asset if needed (
frontend/public/images/connectors/<lowercase-name>.svg). - Add any connector-specific screens/routes only if required:
- route map:
frontend/src/router/index.ts
- route map:
7) Environment + Secrets
Update.env.example with required connector vars so bootstrap is deterministic.
Rules:
- Do not hardcode secrets in code.
- Read credentials from DB connector config at runtime.
- Keep placeholder defaults non-production.
8) Validation Steps
- Start stack and call
GET /api/connectorsto confirm seed row exists. - Configure connector in UI (
/connectors). - Call
POST /api/connectors/verify/{id}and checkconnectionSuccessful. - Exercise at least one runtime endpoint that uses
create_<service>_client.
Common Pitfalls
- TLS verification mismatch:
- many existing connectors use
verify=False/verify_certs=Falsefor self-signed deployments. - if you enable strict TLS, make it explicit and configurable.
- many existing connectors use
- Timeout defaults too low/high:
- define per-connector timeouts; include retries only when safe.
- Wrong auth header format:
- token connectors often require exact header names/prefixes (
Authorization: Bearer ..., custom headers, etc.).
- token connectors often require exact header names/prefixes (
- Connector name mismatch:
- DB seed name and
service_mapkey must be identical.
- DB seed name and
- Router not included at top level:
- adding route files alone is insufficient; include in
backend/copilot.py.
- adding route files alone is insufficient; include in
- Missing frontend export/wiring:
- endpoint file exists but not exported in
frontend/src/api/index.ts.
- endpoint file exists but not exported in
