Skip to content

Generic HTTP/REST connector — call any API as config (#95) - #105

Merged
serge-ivo merged 1 commit into
mainfrom
feat/95-http-connector
Aug 1, 2026
Merged

Generic HTTP/REST connector — call any API as config (#95)#105
serge-ivo merged 1 commit into
mainfrom
feat/95-http-connector

Conversation

@serge-ivo

Copy link
Copy Markdown
Contributor

Closes #95. Part of #94. Builds on #86 (connectorClient).

Adds an http connector with one http_request ToolDef: {method,url|base+path,query,headers,body,inputs,auth,responseMap,pagination}, {{param}} interpolation, dotted/array-projection responseMap (no JSONPath dep), pagination cursor. Auth: none or api-key (in header|query) read from the user_api_keys vault via connectorClient — never in inputs/schema/output (asserted). All calls via safeFetch (SSRF-safe; 169.254.169.254/http rejected pre-network).

Auto-registers → callable via runtime, MCP proxy, and POST /v1/instances/:id/tools/http_request (no bespoke route). Google Places searchText/searchNearby are now pure config (proof test included).

Verify: tsc clean · 1174 api tests pass (+20, 0 regressions) · biome clean.

🤖 Generated with Claude Code

#95)

Add an `http` connector (auth:"token", grantModel:"user", read+write) exposing
ONE `http_request` ToolDef so any REST API is callable as CONFIGURATION, not
bespoke Worker code — the piece that makes Google Places a config, not a Worker.

- `http_request` input: method, url (or base+path), query, headers, JSON body —
  all with `{{param}}` interpolation from `inputs`; optional dotted `responseMap`
  extraction (incl. `array[].{a,b:path}` projection) and a `pagination` descriptor
  returning the next cursor/offset for the caller to fan out pages.
- Auth modes: `none`, and api-key where a vault-stored key (user_api_keys,
  provider "http") is minted via connectorClient (#86) and injected into a
  configurable header or query param (e.g. Places X-Goog-Api-Key). Key value is
  never inlined, returned, or logged.
- All outbound calls go through `safeFetch` (SSRF guard, https-only,
  redirect-revalidated).
- Just a ToolDef in a Connector → instantly callable via runtime, MCP proxy, and
  POST /v1/instances/:id/tools/http_request. No bespoke route.

Tests: schema/registration, {{param}} interpolation, responseMap extraction,
api-key-from-vault injection (mocked), SSRF path, generic-route dispatch, and a
Google Places searchText call expressed purely as http_request config.
Full suite green (1174, +20; 0 regressions).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[connectors] Generic HTTP/REST connector — call any API as configuration

2 participants