refactor(mcp): store source config once per namespace, not per binding#223
Merged
RhysSullivan merged 1 commit intomainfrom Apr 13, 2026
Merged
refactor(mcp): store source config once per namespace, not per binding#223RhysSullivan merged 1 commit intomainfrom
RhysSullivan merged 1 commit intomainfrom
Conversation
Per-tool binding rows were duplicating the full McpStoredSourceData (remote endpoint, headers, query params, auth config including OAuth refresh-token secretIds) on every entry. A source with N tools stored N copies, and every updateSource (or token rotation) rewrote every row. Drop sourceData from the per-binding schema and resolve it via getSourceConfig(namespace) on the invoke hot path. updateSource is now a single putSource — O(1) writes instead of O(N). Also switch source row persistence from raw JSON.stringify/JSON.parse to the existing McpStoredSourceSchema, removing the preferSchemaOverJson linter suppressions. Legacy binding rows have an extra sourceData field; Effect Schema strips unknown fields on decode, so old rows load fine and the next write drops the duplication naturally — no explicit migration needed.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| 🔵 In progress View logs |
executor-cloud | 4f5ee73 | Apr 13 2026, 07:13 AM |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-marketing | 4f5ee73 | Commit Preview URL Branch Preview URL |
Apr 13 2026, 07:14 AM |
@executor/sdk
@executor/plugin-file-secrets
@executor/plugin-google-discovery
@executor/plugin-graphql
@executor/plugin-keychain
@executor/plugin-mcp
@executor/plugin-onepassword
@executor/plugin-openapi
@executor/plugin-workos-vault
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #222 applying the same fix to the MCP plugin.
Per-tool binding rows were duplicating the full
McpStoredSourceData(remote endpoint, headers, query params, auth config including OAuth refresh-token secret IDs) on every entry. A source with N tools stored N copies of the same blob, and every `updateSource` call — or token rotation — rewrote every binding row (`O(N)` writes per edit).Migration
No explicit migration required. Legacy binding rows carry an extra `sourceData` field; Effect Schema strips unknown fields on decode, so old rows load fine and the next write drops the duplication naturally. Source rows haven't changed shape — the schema-based encoder produces the same JSON layout the old `JSON.stringify` path did.
This is simpler than the #222 story (which needed a decode-optional `invocationConfig` + self-heal) because for MCP the `config` field on the source row already contains everything the invoker needs — there's no separate "resolved" view to reconstruct.
Test plan