Skip to content

Auto-connect stdio MCP servers; store env as connection secrets#1129

Draft
RhysSullivan wants to merge 1 commit into
mainfrom
stdio-mcp-autoconnect-revamp
Draft

Auto-connect stdio MCP servers; store env as connection secrets#1129
RhysSullivan wants to merge 1 commit into
mainfrom
stdio-mcp-autoconnect-revamp

Conversation

@RhysSullivan

Copy link
Copy Markdown
Owner

Problem

On a fresh install, adding a STDIO MCP server detected zero tools.

mcp.addServer only registered an integration. Since the v1.5 integrations/connections split, tools are produced per connection (at connection create), and a stdio add never created one, so the integration landed with zero connections and therefore zero tools. The console could not recover it either: stdio declared no auth methods, so the "Add connection" affordance was disabled.

Separately, a stdio server's env (often API keys/tokens) was kept in the integration config blob in plaintext rather than the secret store.

Change

  • Auto-connect on add. A stdio server connects on add so its tools are discovered immediately: a no-auth connection when it needs no secret env, or one bound to provided values for programmatic callers.
  • Env as a connection credential. Secret env vars are declared on the integration as a stdio_env auth method (names only); their values live in the connection's secret store and are injected into the subprocess at launch. A new env placement carrier carries this through the catalog descriptor, the wire schema, and the console.
  • Declare-then-connect in the UI. The add form declares which env vars the server needs via a tag input (type a name, press Enter or +, remove with x). Secret values are entered as masked, per-variable connection credentials in the connect step.
  • Migrate existing installs. A boot-time reconcile gives pre-existing (pre-change) stdio integrations their missing connection and moves any legacy inline env into the secret store, then canonicalizes the config. Idempotent and scoped to legacy rows only.

Testing

  • New end-to-end scenario (e2e/local/stdio-mcp.test.ts) on the single-user app (the only surface with stdio enabled), booted on a throwaway data dir (the fresh-install condition). It covers both paths: one-shot values, and declare-then-connect. It asserts the integration registers, the connection is created, the tools are detected (including an env-gated tool, proving the secret reaches the subprocess), and the secret value is absent from the integration config.
  • typecheck, lint, format:check clean; plugin and console unit suites pass.

Adding a stdio MCP server registered an integration but no connection, so
the v1.5 per-connection tool model produced zero tools on a fresh install.
Auto-create the default connection on add (no-auth, or one-shot env values),
declare secret env vars as a stdio_env auth method whose values live on the
connection's secret store, add a boot-time reconcile for pre-existing stdio
integrations, and give the add form a TagInput for declaring env var names.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 653c2c7 Commit Preview URL

Branch Preview URL
Jun 25 2026, 09:08 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 653c2c7 Jun 25 2026, 09:09 AM

@github-actions

Copy link
Copy Markdown
Contributor

Cloudflare preview

Console https://executor-preview-pr-1129.executor-e2e.workers.dev
MCP https://executor-preview-pr-1129.executor-e2e.workers.dev/mcp
Deployed commit 653c2c7

Sign-in is Cloudflare Access (one-time PIN to an allowed email). The preview has its own database and encryption key; it is destroyed when this PR closes.

@pkg-pr-new

pkg-pr-new Bot commented Jun 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1129

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1129

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1129

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1129

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1129

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1129

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1129

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1129

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1129

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1129

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1129

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1129

executor

npm i https://pkg.pr.new/executor@1129

commit: 653c2c7

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.

1 participant