Skip to content

Commit 7e0e28f

Browse files
Add crates-mcp server and Mimo host template
1 parent d5de413 commit 7e0e28f

19 files changed

Lines changed: 283 additions & 4 deletions

File tree

Antigravity/mcp_config.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
"sequential-thinking": {
4444
"command": "npx",
4545
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
46+
},
47+
"crates": {
48+
"command": "crates-mcp"
4649
}
4750
}
4851
}

CLAUDE.md

Lines changed: 165 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,74 @@ A personal collection of **MCP (Model Context Protocol) server configurations**,
88

99
The only meaningful validation is that each config is well-formed JSON/TOML/YAML and matches the schema its host expects, and that `reuse lint` stays clean.
1010

11+
## Common Development Tasks
12+
13+
### Validation and Testing
14+
15+
- **Validate config syntax**: Run the validation script to ensure all configs parse correctly:
16+
```bash
17+
python3 .github/validate-configs.py
18+
```
19+
This checks JSON/JSONC/TOML/YAML files and reports any syntax errors.
20+
21+
- **REUSE compliance check**: Ensure all files have proper licensing metadata:
22+
```bash
23+
reuse lint
24+
```
25+
This validates that REUSE.toml covers all files with GPL-3.0-or-later.
26+
27+
- **CI validation**: The GitHub Actions workflow runs both validation and REUSE lint on every push/PR.
28+
29+
### Key Filling and Deployment
30+
31+
- **Fill placeholders**: Use the fill-keys scripts to substitute API key placeholders with real values:
32+
```bash
33+
# POSIX/Bash/Brush
34+
CONTEXT7_API_KEY=your_key BRAVE_API_KEY=your_key GITHUB_PAT=your_pat WORKSPACE_PATH=/your/path \
35+
sh bin/fill-keys.sh
36+
37+
# Nushell
38+
$env:CONTEXT7_API_KEY="your_key" $env:BRAVE_API_KEY="your_key" \
39+
$env:GITHUB_PAT="your_pat" $env:WORKSPACE_PATH="/your/path" \
40+
nu bin/fill-keys.nu
41+
42+
# Ion
43+
CONTEXT7_API_KEY=your_key BRAVE_API_KEY=your_key GITHUB_PAT=your_pat WORKSPACE_PATH=/your/path \
44+
ion bin/fill-keys.ion
45+
```
46+
Filled configs are written to `dist/` directory (gitignored).
47+
48+
- **Interactive mode**: Run without env vars to be prompted for missing values:
49+
```bash
50+
sh bin/fill-keys.sh
51+
```
52+
53+
- **Custom output directory**: Use `--out` flag to write to a different location:
54+
```bash
55+
sh bin/fill-keys.sh --out /custom/path
56+
```
57+
58+
### Adding or Modifying Servers
59+
60+
When adding a new server or modifying an existing one:
61+
62+
1. **Update all host templates**: Each server must be declared in every host's config file using that host's specific schema dialect
63+
2. **Follow schema conventions**: Pay attention to host-specific field names (e.g., Qwen uses `httpUrl`, others use `url`)
64+
3. **Preserve indentation**: Antigravity uses 2-space, VSCode uses tabs
65+
4. **Use placeholders for secrets**: Never commit real API keys
66+
5. **Update documentation**: Modify README.md server table and CLAUDE.md schema table
67+
68+
### Adding a New Host
69+
70+
To add support for a new MCP-capable tool:
71+
72+
1. **Create new directory**: Named after the host tool (case-sensitive)
73+
2. **Add config template**: Follow the host's schema (use `host mcp add` if available)
74+
3. **Include all nine servers**: Maintain consistency across hosts
75+
4. **Add to fill-keys scripts**: Update the host-file list in all three shell scripts
76+
5. **Update README**: Add to the supported hosts table
77+
6. **Update CLAUDE.md**: Add to the layout table with schema notes
78+
1179
## Compliance & posture (Spacecraft Software Standard)
1280

1381
This repo carries the Standard §5.2 posture files and §4.3 REUSE metadata:
@@ -41,14 +109,15 @@ paths are noted below.
41109
| `Gemini/settings.json` (+ `mcp-server-enablement.json`) | Gemini CLI · `~/.gemini/` | `mcpServers`; http = `url` + `type:"http"` + `headers`; servers must also be enabled in `mcp-server-enablement.json` |
42110
| `Qwen/settings.json` | Qwen Code · `~/.qwen/settings.json` | `mcpServers`; **http = `httpUrl`** (no `type`/`url`) + `headers` |
43111
| `OpenCode/opencode.jsonc` | opencode · `~/.config/opencode/opencode.jsonc` | `mcp` block; local = `type:"local"` + `command:[…]`; remote = `type:"remote"` + `url` + `headers` + `enabled` |
112+
| `Mimo/mimocode.jsonc` | Mimo Code · `~/.config/mimocode/mimocode.jsonc` | identical to opencode (it's a fork) |
44113
| `Goose/config.yaml` | goose · `~/.config/goose/config.yaml` | YAML `extensions:`; stdio = `type:stdio` + `cmd`/`args`; remote = `type:streamable_http` + `uri` + `headers` |
45114

46115
All files describe the **same logical set of servers** but are not interchangeable —
47116
key names, nesting, and the HTTP transport field all differ per host. When adding or
48117
changing a server, update **every** file in its respective dialect. The fastest way to
49118
get a tool's exact current schema is its own CLI: `claude mcp add`, `codex mcp add`,
50119
`gemini mcp add`, `qwen mcp add`, `grok mcp add` (and `<tool> mcp list` to verify).
51-
Copilot CLI, opencode, goose, and Kimi have no scriptable add command — hand-edit
120+
Copilot CLI, opencode, mimo, goose, and Kimi have no scriptable add command — hand-edit
52121
those files. Mind the traps: **Qwen uses `httpUrl`** while Gemini uses `url`+`type`;
53122
**Codex uses `http_headers`** while Grok/Kimi use `headers`; Copilot CLI omits the
54123
`mcpServers` wrapper; Gemini needs the separate enablement file and a trusted folder.
@@ -57,10 +126,11 @@ those files. Mind the traps: **Qwen uses `httpUrl`** while Gemini uses `url`+`ty
57126

58127
Every host template declares all nine. Two groups:
59128

60-
**The three "real" servers** (these run in the maintainer's live configs too):
129+
**The four "real" servers** (these run in the maintainer's live configs):
61130
- **nixos**`mcp-nixos` (queries nixpkgs / NixOS options). Antigravity runs the `mcp-nixos` binary directly; everywhere else it's `nix run github:utensils/mcp-nixos --` over stdio.
62131
- **context7** (Upstash) — HTTP, `https://mcp.context7.com/mcp`, needs a `CONTEXT7_API_KEY`. Stored inline under a header (`CONTEXT7_API_KEY` for most hosts; `Authorization: Bearer …` for VS Code, where it comes from a prompted `input`). Placeholder `YOUR_CONTEXT7_API_KEY`.
63132
- **microsoft-learn** — HTTP, `https://learn.microsoft.com/api/mcp`, no auth.
133+
- **crates** — stdio, `crates-mcp` ([crates-mcp](https://crates.io/crates/crates-mcp) via `cargo install`), queries Rust crates from crates.io and docs.rs.
64134

65135
**The six generic servers** (came in via the merged Copilot PRs; templates-only, placeholders):
66136
- **github** — HTTP, `https://api.githubcopilot.com/mcp/`, `Authorization: Bearer YOUR_GITHUB_PAT` (VS Code uses built-in Copilot auth, no header).
@@ -77,3 +147,96 @@ Every host template declares all nine. Two groups:
77147
## Tooling
78148

79149
`bin/fill-keys.{nu,sh,ion}` substitute the four placeholder tokens (`YOUR_CONTEXT7_API_KEY`, `YOUR_BRAVE_API_KEY`, `YOUR_GITHUB_PAT`, `/path/to/your/workspace`) with values from env vars (prompting for any unset ones when interactive) and write filled copies into a **gitignored `dist/` mirror** — they never edit the tracked templates, so the no-secrets rule holds. There are three parallel ports (Nushell, POSIX/Bash/Brush, Ion) with identical behavior — **change all three together**, plus their shared host-file list (the docs and VS Code's `${input:}`/`${workspaceFolder}` fields are deliberately left out). The `.sh`/`.ion` ports shell out to `sd` (literal `-s` mode); the `.nu` port uses native string ops. These are the only executables (`755`); everything else is `644` data. Shell-specific gotchas worth knowing if you edit them: Ion's `test -t` is unreliable (use `tty -s`), Ion eats `-h`/`--help`, and Ion's `test` needs the POSIX `x`-prefix guard for `--`-leading operands.
150+
151+
## Code Architecture and Structure
152+
153+
### High-Level Architecture
154+
155+
The repository follows a **multi-host template pattern** where:
156+
157+
1. **Each host directory** contains a single config file in that host's native format
158+
2. **All configs declare the same nine servers** but in different dialects
159+
3. **Templates use placeholders** for secrets that get filled at deployment time
160+
4. **No real secrets are committed** - placeholders ensure safety
161+
162+
### Key Components
163+
164+
1. **Host Config Templates** (`*/*.json`, `*/*.toml`, `*/*.yaml`):
165+
- JSON/TOML/YAML files following each host's MCP schema
166+
- Contain placeholder values for API keys and paths
167+
- Organized by host tool name in separate directories
168+
169+
2. **Key Filling Scripts** (`bin/fill-keys.*`):
170+
- Three parallel implementations for different shells
171+
- Substitute placeholders with real values from environment variables
172+
- Write filled configs to gitignored `dist/` directory
173+
- Never modify tracked templates
174+
175+
3. **Validation System** (`.github/validate-configs.py`):
176+
- Parses all config files to ensure valid syntax
177+
- Handles JSONC (with comment stripping), JSON, TOML, YAML
178+
- Runs automatically in CI on every push/PR
179+
180+
4. **Documentation** (`README.md`, `CLAUDE.md`, `CONTRIBUTING.md`):
181+
- Comprehensive guides for usage and contribution
182+
- Schema reference tables for each host
183+
- Project posture and licensing information
184+
185+
### Data Flow
186+
187+
```
188+
Template Files (tracked)
189+
↓ (fill-keys scripts with env vars)
190+
Filled Configs (dist/, gitignored)
191+
↓ (manual copy to live locations)
192+
Host Applications (local config paths)
193+
```
194+
195+
### Important Constraints
196+
197+
1. **No Secrets in Git**: Placeholders ensure no API keys are ever committed
198+
2. **Schema Consistency**: All hosts must declare the same nine servers
199+
3. **Dialect Variations**: Each host uses different field names for the same concepts
200+
4. **REUSE Compliance**: All files licensed GPL-3.0-or-later via REUSE.toml
201+
5. **Signed Commits**: All commits must be cryptographically signed (§6.3)
202+
203+
## Development Workflow
204+
205+
### Typical Session
206+
207+
1. **Make changes**: Edit config templates or add new host support
208+
2. **Validate**: Run `python3 .github/validate-configs.py`
209+
3. **Test fill**: Run `sh bin/fill-keys.sh` with test values
210+
4. **Check REUSE**: Run `reuse lint`
211+
5. **Commit**: Use signed commits with conventional commit messages
212+
6. **Push**: CI will validate on GitHub
213+
214+
### Adding a New Host Example
215+
216+
```bash
217+
# 1. Create new host directory
218+
mkdir -p NewHost
219+
220+
# 2. Add config template following host's schema
221+
# Use the host's own `mcp add` command if available, or manual creation
222+
223+
# 3. Add to fill-keys scripts
224+
# Edit bin/fill-keys.sh, bin/fill-keys.nu, bin/fill-keys.ion
225+
# Add line: "NewHost/config.ext|~/.newhost/config.ext"
226+
227+
# 4. Update documentation
228+
# Edit README.md (supported hosts table)
229+
# Edit CLAUDE.md (layout table and schema notes)
230+
231+
# 5. Validate
232+
python3 .github/validate-configs.py
233+
reuse lint
234+
```
235+
236+
### Common Pitfalls
237+
238+
1. **Schema Mismatches**: Qwen uses `httpUrl`, others use `url` + `type`
239+
2. **Indentation**: VSCode uses tabs, Antigravity uses 2 spaces
240+
3. **Wrapper Keys**: Copilot CLI has no `mcpServers` wrapper, others do
241+
4. **Header Names**: Codex uses `http_headers`, others use `headers`
242+
5. **Placeholder Consistency**: Must use exact placeholder strings across all files

ClaudeCode/.mcp.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
"command": "npx",
5656
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
5757
"env": {}
58+
},
59+
"crates": {
60+
"type": "stdio",
61+
"command": "crates-mcp"
5862
}
5963
}
6064
}

Codex/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ BRAVE_API_KEY = "YOUR_BRAVE_API_KEY"
4444
[mcp_servers.sequential-thinking]
4545
command = "npx"
4646
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
47+
48+
[mcp_servers.crates]
49+
command = "crates-mcp"

Gemini/mcp-server-enablement.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
},
2626
"sequential-thinking": {
2727
"enabled": true
28+
},
29+
"crates": {
30+
"enabled": true
2831
}
2932
}

Gemini/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@
4545
"sequential-thinking": {
4646
"command": "npx",
4747
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"]
48+
},
49+
"crates": {
50+
"command": "crates-mcp"
4851
}
4952
}
5053
}

GitHubCopilotCLI/mcp-config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,9 @@
4949
"command": "npx",
5050
"args": ["-y", "@modelcontextprotocol/server-sequential-thinking"],
5151
"type": "stdio"
52+
},
53+
"crates": {
54+
"command": "crates-mcp",
55+
"type": "stdio"
5256
}
5357
}

Goose/config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,9 @@ extensions:
8282
- "@modelcontextprotocol/server-sequential-thinking"
8383
enabled: true
8484
timeout: 300
85+
crates:
86+
name: crates
87+
type: stdio
88+
cmd: crates-mcp
89+
enabled: true
90+
timeout: 300

Grok/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,7 @@ BRAVE_API_KEY = "YOUR_BRAVE_API_KEY"
5252
command = "npx"
5353
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
5454
enabled = true
55+
56+
[mcp_servers.crates]
57+
command = "crates-mcp"
58+
enabled = true

Kimi/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ BRAVE_API_KEY = "YOUR_BRAVE_API_KEY"
4444
[mcp.client.servers.sequential-thinking]
4545
command = "npx"
4646
args = ["-y", "@modelcontextprotocol/server-sequential-thinking"]
47+
48+
[mcp.client.servers.crates]
49+
command = "crates-mcp"

0 commit comments

Comments
 (0)