Build a connector
A connector lets Houston agents use one service: an API, a database or a mailbox. It is a small bundle in a GitHub repository: a manifest, Luau code, docs and tests. Houston runs the code on its servers and adds credentials to each request, so neither the connector nor the agent ever sees them. Publish the bundle on Houston Hub and any workspace can connect it.
This page is the overview. The authoring guide is the complete contract, and the houston-hub repository holds every official connector to start from.
Build it with your agent
The Houston team builds connectors with an agent skill. It covers research, the bundle, tests, review and publication, plus the mistakes we have already made. Add it to your project, then ask your agent to build a connector for the service you need:
mkdir -p .claude/skills/houston-connector
curl -fsSL https://ok-houston.com/docs/connectors/SKILL.md -o .claude/skills/houston-connector/SKILL.md
Work in a clone of houston-hub so the agent can read the guide and copy a similar connector. Download the skill.
Bundle format
connectors/example/
houston.json settings, auth, allowed requests
connector.luau operations agents call
README.md what people can do with it
SETUP.md how to connect an account
icon.svg the official service mark
tests/reads.luau behavior fixtures
houston.json declares "schema_version": 2, the only version Houston publishes, and names the Luau entrypoints in files. Each entrypoint returns a table of functions and may supply the special help metadata export. Agents call operations with plain JSON data and get plain data back.
local help = {
text = "Read Example items. Calls return completed values directly.",
functions = {},
}
local exports = {help = help}
help.functions.listItems = {
description = "Read the current items. Returns an object with an items array of id/name objects.",
args = {},
inputSchema = {type = "object", additionalProperties = false, examples = {{}}},
annotations = {readOnlyHint = true},
}
function exports.listItems()
local response = await(http.request({
method = "GET", url = "https://api.example.com/items",
}))
if response.statusCode ~= 200 then
response.body:close()
error("Example request failed")
end
return json.decode(await(response.body:readAll()))
end
return exports
Keep each help record immediately before its function definition so the connector reads in order. Put an operation and its help inside the same access condition. Reuse shared transport logic and schemas without adding registration helpers or assembling operations from separate maps.
Large connectors can return nested namespace tables, such as {websites = websites, help = help}. Each table supplies its own local functions and help metadata. Scripts call connection.websites.list(options), inspect connection.websites.functions and .namespaces, and read connection.websites.help({section="list"}). Connection help lists immediate namespaces without expanding every operation. Root help shows short connection metadata samples. The optional help.namespaces map supplies short child summaries; otherwise Houston uses child help text. See the namespace example.
Initialization and help construction never make network calls. Supply structured help directly or through a pure zero-argument function returning the same table, with records matching the configured exports. Function records contain descriptions, JSON Schema Draft 2020-12 input schemas and valid examples; optional output schemas describe stable object results. Preserve existing positional APIs with args bindings. Houston validates and renders this metadata, and adds operation-error help hints automatically.
Agents use connection.help() for the complete overview, connection.help({section="function-or-topic"}) for the complete reference. section is the only option; unsupported arguments, extra positional arguments, wrong types, and unknown sections fail with bounded actionable errors without appending documentation. Only root help accepts intent. Empty or nil sections return the owning overview; positional strings are invalid. Help has no pagination or separate size cap: normal execution truncation supplies a signed download containing the full result. Existing string/table help and zero-argument functions returning either remain compatible; new and substantively reworked connectors require structured records, while existing Hub connectors migrate incrementally. See the complete help contract. README.md and SETUP.md are for people. Keep them as short as possible: a title and capability summary in README, numbered account connection steps in SETUP. Use quotes for important limitations and fenced code only for setup values people must copy. Put uncommon options under ## Advanced, which Houston folds automatically. Keep callable examples and agent workflows in help().
Settings and access
Root config fields are settings a workspace admin fills in when connecting an account; publisher fields are settings you fill in once when you publish. Both support strings, numbers, booleans, secrets, choices and conditions. Secrets stay on the server; only nonsecret settings reach Luau, in the config table.
Declare what a connection may do in the top-level access array: one row per resource, each with ordered levels such as none, read and write. A connector with one kind of access declares a single data row with read and write. People pick a level per row when connecting; Luau reads the chosen levels from the access table and checks them with houston.allows("data:write"). Export write functions only when the row allows them. Everyone granted a connection gets what it is configured for.
Authentication
Each entry in auth is a method people can choose:
- Manual methods ask for inputs such as an API token.
- OAuth methods declare the provider's endpoints and scopes. The client ID and secret belong either to each connection (
config.client_id, entered by the workspace admin, who registers the callback URL Houston shows) or to the publication (publisher.client_id, one provider app and one callback for every connection).
Put write scopes behind {{ allows access.data "write" }}, so connections that only read never request them. When a provider's read and write scopes replace each other, use {{ is access.data "read" }} and {{ is access.data "write" }} on the scope groups; everywhere else use allows. Changing any row later, up or down, asks the account holder to authorize again. So does changing a setting, unless its config field declares "reauthorize_on_change": false, which the validator accepts only on fields that no scope group, proxy rule, auth method or other field references, such as a display time zone.
Proxy rules
proxy lists the only requests the connector may make, and how Houston adds credentials to them:
"proxy": [
{
"match": {
"protocol": "http",
"host": ["api.example.com"],
"method": ["GET"],
"path": ["/items", "/items/{id}"]
},
"action": {
"headers": {
"set": {"Authorization": "Bearer {{auth.token.token}}"}
}
}
}
]
The first matching rule wins and only its action runs. A request that matches no rule fails before leaving Houston, and redirects are not followed. Rules can set or remove headers, add query credentials, use Basic authentication, or pass a request through unchanged. Keep rules narrow: list exact paths for read-only access, give signed download URLs their own rule without credentials, and never allow an endpoint that echoes the connection's own token.
Database and mailbox connectors use a postgres, mysql, clickhouse, redis or imap rule instead. It binds the host, credentials and verified TLS, and Luau sends queries or mail commands through db or imap.
Tests
Fixtures in tests/ replace the network with synthetic provider responses and call the real exports:
return {
scenario = {
publisher = {}, access = {data = "read"}, config = {},
auth_method = "token", auth_config = {token = "fixture-token"},
},
configure = function()
http = {request = function(req)
assert(req.url == "https://api.example.com/items")
local body = json.encode({items = {{id = "one"}}})
return fixture.operation({statusCode = 200, headers = {},
body = fixture.reader(body)})
end}
end,
run = function(exports)
assert(exports.listItems().items[1].id == "one")
end,
}
Together, fixtures cover every authentication method and every enabled proxy rule. Assert exact URLs, headers and bodies, check that connections at the read level export no writes, and cover errors and empty results. Keep provider-specific tests in the bundle's Luau files. The public Hub's generic Go runner loads every bundle through the same production validator; no provider-specific Go code is needed. From a Houston checkout, go -C tools/runtime run . test-connectors builds the runtime and validates every bundle. Publication runs the same checks.
Publish on Houston Hub
- Push the bundle to GitHub.
- In Houston Hub, open My connectors, enter the repository, branch and connector folder, and select Publish connector.
- Houston validates the manifest, type-checks the Luau, checks
help()and runs every fixture. Until validation passes, only your workspace sees the connector and its errors. Fix, push and select Refresh now. - Enter the publisher settings your manifest declares. For a publisher-owned OAuth client, register the callback URL shown there in the provider's app.
- Connect an account the way your users will, following
SETUP.md. Check what agents can do at each access level, and test writes only on disposable data.
Each validated push to the branch becomes a new release. Connections move to it automatically unless the change needs new settings or authorization, in which case their admins see Set up again.