Repository navigation
feat(dir): add mcp-claudecode export format - #1766
Merged
Merged
Conversation
Adds a new --format mcp-claudecode option to dirctl export that emits
Claude Code's project-scoped .mcp.json configuration shape
({"mcpServers": {name: {command/args/env or type/url/headers}}}),
mirroring the existing mcp-ghcopilot formatter end to end:
- api/exportfmt/mcp_claudecode.go: formatter + RecordToClaudeCode
translator for the OASF 1.0.0 integration/mcp connections format
(stdio, streamable-http -> http, sse)
- cli/cmd/export: batch exporter merging matched servers into one
mcp.json, format registration, help text
- tests mirroring the mcp-ghcopilot formatter and batch tests
- docs: CLI reference + import/export component page
Refs agntcy#1386
Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Conor Bronsdon <[email protected]>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
Adds
--format mcp-claudecodetodirctl export, closing #1386.Pulls an OASF record's
integration/mcpmodule (1.0.0connectionsformat) and emits Claude Code's project-scoped.mcp.jsonshape. Batch export (--output-dir) merges all matched servers into onemcp.json, mirroring the existingmcp-ghcopilotbehavior.Judgment calls where the issue was silent, called out for review:
type, matching whatclaude mcp addactually emits (the issue's stdio example also omits it).streamable-httptransport maps to Claude Code's"type": "http";ssepasses through.default_valueemit"NAME": "${NAME}", Claude Code's documented shell-environment expansion. There's no Claude Code equivalent of VS Code's${input:NAME}prompt that the ghcopilot exporter uses.Scope notes:
api/exportfmt/mcp_claudecode.go, exported asexportfmt.RecordToClaudeCode) so the feature doesn't block on an oasf-sdk release and dependency bump. Happy to upstream it as a follow-up if you'd rather have the two-repo split.mcp/tools/export_record.go, which doesn't exist on current main; skipped.connectionsonly; legacy 0.7.0/0.8.0serversformat isn't handled.Verified:
go build ./...and the exportfmt + cmd/export test suites pass on both theapiandclimodules. Tests mirror the ghcopilot formatter's coverage (stdio, remote with headers, nil data, missing module, batch merge, empty batch, registration). Commits are DCO signed.