Skip to content

Expose Conduit as an MCP server (configure agents, investigate runs, improve prompts) - #16

Merged
cursor[bot] merged 5 commits into
masterfrom
dougrathbone/mcp-server-05ef
Oct 21, 2026
Merged

cursor[bot] merged 5 commits into
masterfrom
dougrathbone/mcp-server-05ef

Conversation

@dougrathbone

@dougrathbone dougrathbone commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Summary

Conduit is now an MCP server at POST /api/mcp. An LLM client can configure Conduit, investigate runs, and iterate on prompts without logging into the UI.

Transport and auth

  • Transport: stateless Streamable HTTP. Each request gets a fresh McpServer and transport, responses are JSON, and GET/DELETE return 405. Cross-origin browser requests are rejected.
  • Personal access tokens: tokens look like cdt_… and are minted in Settings → MCP access. Only the SHA-256 hash is stored. Each token can have an expiry and can be revoked.
  • Scopes: a token has read or write scope. Write tools are not registered for read tokens.
  • Permissions: the caller acts as the token's user, under the existing ownership and sharing rules.
  • Dev-bypass mode: tokens are optional unless CONDUIT_MCP_REQUIRE_TOKEN=true. Set CONDUIT_MCP_ENABLED=false to turn the endpoint off.
  • Secrets: env vars, MCP headers/env, URL credentials, publish-target secrets and webhook secrets are returned as [redacted]. Sending [redacted] back on a write keeps the stored value.

Tools

  • Configure:
    • Agents: list_agents, get_agent, create_agent, update_agent, delete_agent (owner only, requires confirmName)
    • Agent MCP servers: set_agent_mcp_server, remove_agent_mcp_server, check_mcp_server
    • Triggers: list_triggers, create_trigger, update_trigger, delete_trigger (cron expression and timezone are validated; the webhook URL is returned)
    • Workspace: list_repositories, sync_repository, list_publish_targets, list_global_mcp_servers
  • Investigate:
    • get_conduit_status reports the runner CLIs and worker status.
    • list_runs and get_run classify failures.
    • get_run_log returns a digest of the run log that can be filtered by kind, search text or errors only, and paged with tail, offset and limit.
    • start_run and stop_run control runs.
  • Prompts:
    • get_agent_prompt
    • update_agent_prompt, with an optional expectedUpdatedAt concurrency guard
    • edit_agent_prompt, which replaces an exact substring
    • list_prompt_revisions, get_prompt_revision, restore_prompt_revision
    • get_prompt_performance, which gives the success rate per revision

Resources and protocol prompts

  • Resources: conduit://agents/{id}, conduit://agents/{id}/prompt, conduit://runs/{id}, conduit://runs/{id}/log
  • Protocol prompts: investigate-run, improve-agent-prompt, triage-failures, design-agent

Supporting changes

  • New tables: mcp_access_tokens and prompt_revisions.
  • Prompt history: every prompt change from the UI or from MCP is recorded. The first change also stores a baseline revision of the old prompt. UI autosaves by the same user within 10 minutes are merged into one revision.
  • Live refresh: MCP writes broadcast entity:changed, so open UIs refresh. The AgentEditor re-syncs its draft only when no save is pending, so autosave does not undo MCP edits.
  • Refactor: the MCP health probe and the runner CLI check moved out of index.ts into their own modules (mcpServerProbe.ts, runnerCli.ts) so the WebSocket handlers and MCP share them.
  • stdio bridge: a stdio-to-HTTP bridge for stdio-only clients, run with npm run mcp:stdio. Its default upstream is http://localhost:7456/api/mcp.

How to connect

claude mcp add --transport http conduit http://localhost:7456/api/mcp --header "Authorization: Bearer cdt_…"
# or the stdio bridge
CONDUIT_MCP_URL=http://localhost:7456/api/mcp CONDUIT_MCP_TOKEN=cdt_… npm run mcp:stdio

For an mcp.json client, configure { "url": "http://localhost:7456/api/mcp", "headers": { "Authorization": "Bearer cdt_…" } }.

The path lives in CONDUIT_MCP_HTTP_PATH (src/shared/types.ts) and is used by the server mount, the Settings connection snippet, and the stdio bridge default.

Testing

  • Unit tests cover redaction, prompt edits, run-log digests, auth and prompt performance.
  • An integration test drives the real server through the SDK client over an in-memory transport.
  • npm run e2e:mcp runs against a live server and Postgres, hitting /api/mcp over HTTP and through the stdio bridge. It covers read-scope enforcement, token revocation, successful and failing runs, prompt revisions, triggers and protocol prompts.
  • tsc (web and server), the full vitest suite, eslint, and npm run build all pass.
Open in Web Open in Cursor 

cursoragent and others added 4 commits October 21, 2026 00:39
…vestigating runs, and editing prompts

Adds a Streamable-HTTP MCP endpoint at /mcp authenticated by per-user
personal access tokens (read or write scope), prompt revision history,
a Settings card for minting tokens, and a stdio bridge for stdio-only
clients.

Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@cursor cursor Bot changed the title MCP server: configure agents, investigate runs, and refine prompts over MCP Expose Conduit as an MCP server (configure agents, investigate runs, improve prompts) Oct 21, 2026
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
@cursor
cursor Bot merged commit 65c2017 into master Oct 21, 2026
1 check passed
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.

2 participants