Skip to content

feat: MCP configuration management#96

Closed
runkids wants to merge 5 commits intomainfrom
feat/mcp-config-management
Closed

feat: MCP configuration management#96
runkids wants to merge 5 commits intomainfrom
feat/mcp-config-management

Conversation

@runkids
Copy link
Owner

@runkids runkids commented Mar 23, 2026

Summary

Add skillshare mcp commands and sync mcp to manage MCP server configurations across AI tools — define once in mcp.yaml, sync everywhere.

Closes #95

Supported Tools

Tool Format Sync Modes
Claude Code JSON merge (global shared), all (project .mcp.json)
Cursor JSON merge / symlink / copy
Codex TOML merge only (shared config.toml)

Features

CLI

  • skillshare mcp add/remove/list/status — manage mcp.yaml
  • skillshare sync mcp — sync to all targets
  • skillshare sync --all — now includes MCP sync
  • Interactive TUIs: mcp list (fuzzy filter, disable/remove) and mcp add (wizard)
  • Three sync modes: merge (default), symlink, copy

Web UI

  • MCP page with Servers tab and Sync Status tab
  • Add Server modal (stdio/remote transport)
  • Mode selector (merge/symlink/copy dropdown)
  • Sync button with toast result summary

Architecture

  • Merge mode (default): read-modify-write JSON/TOML, preserves user entries and non-MCP config sections
  • Symlink mode: generate per-target config → symlink (non-destructive, skips existing files)
  • Copy mode: generate → copy with content dedup
  • Shared config files (~/.claude.json, Codex config.toml) auto-fallback to merge
  • Custom MCP targets via targets: section in mcp.yaml
  • State tracking (mcp_state.yaml) for merge mode cleanup

Test plan

  • 76 unit tests (internal/mcp/)
  • 11 integration tests (add/remove/list, merge/symlink/copy modes, dry-run, status)
  • go build ./... + go vet ./... clean
  • Manual: mcp addsync mcp → verify target configs
  • Manual: Web UI add server → sync → check Sync Status tab

runkids added 5 commits March 23, 2026 23:29
New internal/mcp/ package for managing MCP server configurations
across AI tools (Claude Code, Cursor, Codex):

- config.go: MCPConfig/MCPServer Load/Save/Validate for mcp.yaml
- targets.yaml: 3 targets with format (json/toml) and shared flags
- generate.go: per-target JSON/TOML generation with key transforms
- merge.go: read-modify-write engine (JSON + TOML) preserving
  existing user entries and non-MCP config sections
- sync.go: non-destructive symlink engine
- copy.go: file copy engine with content dedup
- state.go: state tracking for merge mode cleanup
- toml.go: TOML read/write for Codex config.toml

Shared config files (Claude ~/.claude.json, Codex config.toml)
automatically fall back to merge mode when symlink/copy is set.

Ref: #95
Commands: mcp add/remove/list/status, sync mcp
Three sync modes: merge (default), symlink, copy
Shared targets auto-fallback to merge with warning
Config: mcp_mode field in config.yaml
TUI: interactive list (filter/disable/remove) and add wizard
Integrated with 'sync --all' (skills + extras + mcp)

Ref: #95
Server: GET/POST/DELETE/PATCH /api/mcp + POST /api/mcp/sync
UI: MCP page with Servers tab (cards, disable/remove, add modal)
and Sync Status tab (target cards, sync button, toast results)

Ref: #95
11 tests: add/list/remove, merge (preserve user entries, cleanup,
preserve other keys), symlink (create/skip/dry-run), copy mode,
status, duplicates, remote servers.

Ref: #95
- PATCH /api/mcp/mode: change mcp_mode (merge/symlink/copy)
- UI: mode dropdown in Sync Status tab
- mcp.yaml targets section: user-defined custom MCP targets
  merged with builtin targets (claude/cursor/codex)
- MCPTargetsWithCustom: merge logic for builtin + custom

Ref: #95
@runkids runkids closed this Mar 23, 2026
@gemini-code-assist
Copy link

Warning

Gemini encountered an error creating the summary. You can try again by commenting /gemini summary.

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.

Is it possible to add support for mcp tools?

1 participant