airc-cli 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +169 -0
  2. package/dist/index.js +147 -121
  3. package/package.json +6 -5
package/README.md CHANGED
@@ -30,6 +30,7 @@ This creates:
30
30
  - `~/.airc/config/skills/` - Local skills config storage
31
31
  - `~/.airc/config/commands/` - Local commands config storage
32
32
  - `~/.airc/config/agents/` - Local commands config storage
33
+ - `~/.airc/config/mcp-config.json` - MCP server configurations
33
34
  - `~/.aircrc` - Configuration file for airc cli
34
35
 
35
36
  ### 2. Add a Source
@@ -104,3 +105,171 @@ airc/
104
105
  │ ├── agents/ # Agent definitions
105
106
  │ └── scripts/ # Add your own config folder
106
107
  ```
108
+
109
+ ## Managing MCPs (Model Context Protocol)
110
+
111
+ airc now supports managing MCP (Model Context Protocol) server configurations. MCPs allow AI tools to interact with external systems and services through standardized server interfaces.
112
+
113
+ ### MCP Config Structure
114
+
115
+ MCP configurations are stored in `~/.airc/config/mcp-config.json`:
116
+
117
+ ```json
118
+ {
119
+ "filesystem": {
120
+ "type": "stdio",
121
+ "command": "npx",
122
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users"]
123
+ },
124
+ "github": {
125
+ "type": "stdio",
126
+ "command": "npx",
127
+ "args": ["-y", "@modelcontextprotocol/server-github"],
128
+ "env": {
129
+ "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ **Field Descriptions:**
136
+ - `type`: Protocol type (currently only "stdio" is supported)
137
+ - `command`: The command to run the MCP server (e.g., "npx", "node")
138
+ - `args`: Array of command arguments (optional)
139
+ - `env`: Environment variables for the server (optional)
140
+
141
+ ### Viewing MCPs
142
+
143
+ List all available MCPs along with your other configs:
144
+
145
+ ```bash
146
+ airc list
147
+ ```
148
+
149
+ **Example output:**
150
+ ```
151
+ 📋 Your Configs
152
+
153
+ 📦 Commands (2)
154
+ ✏️ manual commit
155
+ ✏️ manual push
156
+
157
+ 📦 MCP Configs (2)
158
+ ✏️ manual filesystem
159
+ type: stdio
160
+ ✏️ manual github
161
+ type: stdio
162
+
163
+ Total: 4 configs
164
+ 0 imported, 4 manual
165
+ ```
166
+
167
+ ### Installing MCPs to AI Tools
168
+
169
+ When you run `airc install <tool>`, you'll be prompted to select which MCPs to install:
170
+
171
+ ```bash
172
+ # Install to Claude (project-level)
173
+ cd <project-root>
174
+ airc install claude
175
+
176
+ # Install globally
177
+ airc install claude --global
178
+ ```
179
+
180
+ **Interactive MCP selection:**
181
+ ```
182
+ 📦 MCP Configs
183
+ ? Select MCPs to install: (Press <space> to select, <a> to toggle all)
184
+ ❯◯ filesystem (stdio)
185
+ ◯ github (stdio)
186
+ ```
187
+
188
+ After selection, MCPs are merged into the tool's config file:
189
+ ```
190
+ ✅ Successfully installed 2 MCP configs
191
+ Installed to: .mcp.json
192
+ ```
193
+
194
+ ### Handling MCP Conflicts
195
+
196
+ If an MCP with the same name already exists in the tool's config, use the `--force` flag to overwrite:
197
+
198
+ ```bash
199
+ airc install claude --force
200
+ ```
201
+
202
+ **Without --force:**
203
+ ```
204
+ ❌ Error: MCP conflicts detected: filesystem, github
205
+ These MCPs already exist in the config file.
206
+ Use --force to overwrite existing MCPs.
207
+ ```
208
+
209
+ **With --force:**
210
+ ```
211
+ ✅ Successfully installed 2 MCP configs (overwrote 2 existing)
212
+ ```
213
+
214
+ ### Removing MCPs
215
+
216
+ Remove an MCP from your local configuration:
217
+
218
+ ```bash
219
+ airc remove <mcp-name> --force
220
+ ```
221
+
222
+ **Example:**
223
+ ```bash
224
+ airc remove github --force
225
+ ```
226
+
227
+ **Output:**
228
+ ```
229
+ 🗑️ Remove Config
230
+
231
+ MCP Config: github
232
+ Type: stdio
233
+ Source: manual (MCP configuration)
234
+
235
+ ✅ Successfully removed MCP "github"
236
+ MCP removed from ~/.airc/config/mcp-config.json
237
+ ```
238
+
239
+ ### Tool-Specific MCP Support
240
+
241
+ Different AI tools store MCPs in different locations with different field names:
242
+
243
+ | Tool | Project Mode Path | Global Mode Path | Field Name |
244
+ |------|------------------|------------------|------------|
245
+ | Claude | `.mcp.json` | `~/.claude.json` | `mcpServers` |
246
+ | Gemini | `.gemini/settings.json` | `~/.gemini/settings.json` | `mcpServers` |
247
+ | Antigravity | N/A (global only) | `~/.gemini/antigravity/mcp_config.json` | `mcpServers` |
248
+ | Cursor | `.cursor/mcp.json` | `~/.cursor/mcp.json` | `mcpServers` |
249
+ | Copilot | `.copilot/mcp-config.json` | `~/.copilot/mcp-config.json` | `mcpServers` |
250
+ | OpenCode | `opencode.json` | `~/.config/opencode/opencode.json` | `mcp` |
251
+
252
+ **Note:** Antigravity only supports global mode. When installing to Antigravity in project mode, you'll see an informational message:
253
+
254
+ ```
255
+ ℹ️ Note: Antigravity only supports global MCP installation
256
+ Use --global flag to install MCPs for Antigravity
257
+ ```
258
+
259
+ ### Troubleshooting
260
+
261
+ **MCPs not showing in `airc list`:**
262
+ - Ensure `~/.airc/config/mcp-config.json` exists and contains valid JSON
263
+ - Check file permissions on the mcp-config.json file
264
+
265
+ **MCP installation fails:**
266
+ - Verify the tool supports MCP format (see table above)
267
+ - For Antigravity, use `--global` flag
268
+ - Check that the target config file has write permissions
269
+ - Use `--force` flag if MCPs already exist and you want to overwrite
270
+
271
+ **MCPs not working after installation:**
272
+ - Verify the MCP server command is correctly installed (e.g., `npx @modelcontextprotocol/server-filesystem`)
273
+ - Check environment variables are set correctly in the MCP config
274
+ - Restart your AI tool after installing MCPs
275
+ - Consult the specific AI tool's documentation for MCP troubleshooting