mcp_sync/lib.rs
1//! # mcp-sync
2//!
3//! **Sync canonical MCP configuration to multiple AI coding assistants**
4//!
5//! `mcp-sync` reads a single `mcp.yaml` file and syncs the server definitions
6//! to configuration files for:
7//!
8//! - **Antigravity** (VS Code extension)
9//! - **Claude Code** (CLI)
10//! - **Codex** (OpenAI CLI)
11//! - **OpenCode**
12//!
13//! ## Quick Start
14//!
15//! ```bash
16//! # One-time sync
17//! mcp-sync sync
18//!
19//! # Watch for changes
20//! mcp-sync watch
21//!
22//! # Sync only global configs
23//! mcp-sync sync --scope global
24//!
25//! # Dry run (show what would change)
26//! mcp-sync sync --dry-run --verbose
27//! ```
28//!
29//! ## Canonical Format
30//!
31//! ```yaml
32//! version: 1
33//! servers:
34//! my-server:
35//! command: npx
36//! args: ["-y", "@modelcontextprotocol/server"]
37//! env:
38//! API_KEY: "${API_KEY}"
39//!
40//! remote-server:
41//! kind: http
42//! url: https://mcp.example.com/v1
43//! headers:
44//! Authorization: "Bearer ${TOKEN}"
45//! ```
46//!
47//! ## Plugin System
48//!
49//! Plugins can transform configurations:
50//!
51//! ```yaml
52//! version: 1
53//! plugins:
54//! - name: env-expander
55//! config:
56//! prefix: "${"
57//! suffix: "}"
58//! servers:
59//! # ...
60//! ```
61//!
62//! See [`plugin`] module for creating custom plugins.
63
64pub mod canon;
65pub mod commands;
66pub mod plugin;
67pub mod target;
68pub mod targets;
69pub mod utils;
70
71// Re-exports for convenience
72pub use canon::{Canon, CanonServer, PluginConfig, read_canon, read_canon_auto, read_canon_from_url};
73pub use plugin::{Plugin, PluginManager};
74pub use target::{SyncOptions, Target, TargetManager};
75pub use targets::all_targets;
76