Repository navigation
Expose Conduit as an MCP server (configure agents, investigate runs, improve prompts) - #16
Merged
Merged
Conversation
…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>
Co-authored-by: Doug Rathbone <dougrathbone@users.noreply.github.com>
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
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
McpServerand transport, responses are JSON, and GET/DELETE return 405. Cross-origin browser requests are rejected.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.readorwritescope. Write tools are not registered for read tokens.CONDUIT_MCP_REQUIRE_TOKEN=true. SetCONDUIT_MCP_ENABLED=falseto turn the endpoint off.[redacted]. Sending[redacted]back on a write keeps the stored value.Tools
list_agents,get_agent,create_agent,update_agent,delete_agent(owner only, requiresconfirmName)set_agent_mcp_server,remove_agent_mcp_server,check_mcp_serverlist_triggers,create_trigger,update_trigger,delete_trigger(cron expression and timezone are validated; the webhook URL is returned)list_repositories,sync_repository,list_publish_targets,list_global_mcp_serversget_conduit_statusreports the runner CLIs and worker status.list_runsandget_runclassify failures.get_run_logreturns 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_runandstop_runcontrol runs.get_agent_promptupdate_agent_prompt, with an optionalexpectedUpdatedAtconcurrency guardedit_agent_prompt, which replaces an exact substringlist_prompt_revisions,get_prompt_revision,restore_prompt_revisionget_prompt_performance, which gives the success rate per revisionResources and protocol prompts
conduit://agents/{id},conduit://agents/{id}/prompt,conduit://runs/{id},conduit://runs/{id}/loginvestigate-run,improve-agent-prompt,triage-failures,design-agentSupporting changes
mcp_access_tokensandprompt_revisions.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.index.tsinto their own modules (mcpServerProbe.ts,runnerCli.ts) so the WebSocket handlers and MCP share them.npm run mcp:stdio. Its default upstream ishttp://localhost:7456/api/mcp.How to connect
For an
mcp.jsonclient, 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
npm run e2e:mcpruns against a live server and Postgres, hitting/api/mcpover 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, andnpm run buildall pass.