Skip to content

feat(dir): add mcp-cursor export format - #1767

Merged
lgecse merged 6 commits into
agntcy:mainfrom
conorbronsdon:feat/mcp-export-cursor
Jul 9, 2026
Merged

lgecse merged 6 commits into
agntcy:mainfrom
conorbronsdon:feat/mcp-export-cursor

Conversation

@conorbronsdon

Copy link
Copy Markdown
Member

Adds --format mcp-cursor to dirctl export, closing #1385. Sibling of #1766 — the two branch from the same base, and whichever merges second takes a trivial keep-both-lines conflict in the shared registration lines.

Emits Cursor's mcp.json shape, verified against cursor.com/docs/context/mcp:

  • No type field anywhere — Cursor infers transport from the config shape (command = stdio, url = remote). This is the main divergence from the Claude Code format in feat(dir): add mcp-claudecode export format #1766.
  • Env vars without a default_value use Cursor's documented ${env:NAME} interpolation (note: different syntax from Claude Code's ${NAME}).
  • Cursor's envFile and OAuth auth fields aren't emitted; OASF records carry no data for them.

Batch export (--output-dir) merges all matched servers into one mcp.json, mirroring mcp-ghcopilot. Same scope notes as #1766: translator kept dir-local (exportfmt.RecordToCursor) rather than in oasf-sdk, happy to upstream as a follow-up; issue Step 2.4's mcp/tools/export_record.go doesn't exist on current main; OASF 1.0.0 connections only.

Verified: go build ./... plus the exportfmt and cmd/export test suites green on both modules. Commits are DCO signed.

Adds a new --format mcp-cursor option to dirctl export that emits
Cursor's mcp.json configuration shape ({"mcpServers": {name:
{command/args/env or url/headers}}}, used by .cursor/mcp.json and
~/.cursor/mcp.json), mirroring the existing mcp-ghcopilot formatter
end to end:

- api/exportfmt/mcp_cursor.go: formatter + RecordToCursor translator
  for the OASF 1.0.0 integration/mcp connections format (stdio,
  streamable-http, sse; remote servers emit url without a type field,
  matching Cursor's transport inference)
- 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#1385

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Conor Bronsdon <[email protected]>
@github-actions github-actions Bot added the size/M Denotes a PR that changes 200-999 lines label Jul 8, 2026
@conorbronsdon conorbronsdon changed the title feat: add mcp-cursor export format feat(dir): add mcp-cursor export format Jul 8, 2026
@conorbronsdon conorbronsdon reopened this Jul 8, 2026
@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

@ramizpolic ramizpolic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @conorbronsdon!

@conorbronsdon
conorbronsdon marked this pull request as ready for review July 8, 2026 18:11
@conorbronsdon
conorbronsdon requested a review from a team as a code owner July 8, 2026 18:11
@lgecse
lgecse force-pushed the feat/mcp-export-cursor branch from 7fee641 to da2825c Compare July 9, 2026 10:30
@lgecse lgecse self-assigned this Jul 9, 2026
@lgecse
lgecse force-pushed the feat/mcp-export-cursor branch 2 times, most recently from 17a161b to 8c0bffc Compare July 9, 2026 10:51
@lgecse
lgecse force-pushed the feat/mcp-export-cursor branch from 8c0bffc to 88be84f Compare July 9, 2026 11:25
@lgecse
lgecse force-pushed the feat/mcp-export-cursor branch from 88be84f to 4d21f5c Compare July 9, 2026 11:27
@lgecse
lgecse merged commit fa792f7 into agntcy:main Jul 9, 2026
33 checks passed
@conorbronsdon
conorbronsdon deleted the feat/mcp-export-cursor branch July 9, 2026 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/M Denotes a PR that changes 200-999 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants