Skip to content

Commit 39a550d

Browse files
committed
feat: add Claude Code, configure MCP servers, and refine tool configs
- Add Claude Code: cask (macOS), pnpm (Ubuntu), WinGet (Windows) - Configure 4 user-scoped MCP servers (playwright, github, cloudflare, context7) via a single loop over mcp_servers in group_vars/all.yml - Add bat, ripgrep, and atuin configs with full deployment via dotfiles role - Wire fzf previews (bat for Ctrl-T, eza tree for Alt-C), RIPGREP_CONFIG_PATH, and ZSH_AUTOSUGGEST_STRATEGY into .zshrc - Document MCP server pattern in CLAUDE.md
1 parent b4bdd4a commit 39a550d

File tree

9 files changed

+72
-0
lines changed

9 files changed

+72
-0
lines changed

CLAUDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,28 @@ Touch **all** of these files — none are optional:
8585

8686
If the tool is only available via a custom installer on a platform, also add a check-and-install task to `roles/tools/tasks/{darwin,debian,windows}.yml`.
8787

88+
## Adding a New MCP Server
89+
90+
MCP servers are configured at user scope via `claude mcp add`. The list lives in
91+
`ansible/inventory/group_vars/all.yml` under `mcp_servers`; a single loop task in
92+
`roles/dotfiles/tasks/main.yml` iterates over it.
93+
94+
`claude mcp add` exits 1 if the server already exists, so the loop task pre-checks
95+
with `claude mcp list | grep -q` before running — do not remove this guard.
96+
97+
To add a new MCP server:
98+
99+
1. **`ansible/inventory/group_vars/all.yml`** — append to `mcp_servers` (alphabetically):
100+
101+
```yaml
102+
- name: my-server
103+
command: npx @scope/my-mcp-package
104+
```
105+
106+
2. **`cspell.json`** — add any non-dictionary words (package scope, server name).
107+
108+
No changes to the dotfiles task or verify playbook are needed.
109+
88110
## Adding a New App
89111

90112
1. **`roles/apps/vars/{darwin,debian,windows}.yml`** — add the package name.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ The Ansible playbook connects back to the Windows host over WinRM and installs e
192192

193193
| App | Platforms | Description |
194194
| --------------------------- | --------------- | ----------------------------------------------------- |
195+
| [Claude Code] | all | AI coding assistant CLI and desktop app |
195196
| [VS Code] | all | Code editor |
196197
| [draw.io] | all | Diagramming |
197198
| [Obsidian] | all | Note-taking |
@@ -268,6 +269,7 @@ just spellcheck
268269
[7-Zip]: https://7-zip.org/
269270
[Amberol]: https://gitlab.gnome.org/World/amberol
270271
[bat]: https://github.com/sharkdp/bat
272+
[Claude Code]: https://claude.ai/code
271273
[bottom]: https://clementtsang.github.io/bottom/
272274
[Firefox]: https://www.mozilla.org/firefox/
273275
[Caesium]: https://saerasoft.com/caesium

ansible/inventory/group_vars/all.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,17 @@ pip_packages:
3333
- ipykernel
3434
- pre-commit
3535

36+
# Claude Code MCP servers configured at user scope
37+
mcp_servers:
38+
- name: cloudflare
39+
command: npx @cloudflare/mcp-server-cloudflare
40+
- name: context7
41+
command: npx @upstash/context7-mcp
42+
- name: github
43+
command: npx @modelcontextprotocol/server-github
44+
- name: playwright
45+
command: npx @playwright/mcp@latest
46+
3647
# pnpm packages installed globally on all platforms
3748
pnpm_packages:
3849
- cspell

ansible/playbooks/verify.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@
6262
name: "ripgrep-all"
6363
- cmd: "atuin --version"
6464
name: "atuin"
65+
- cmd: "claude --version"
66+
name: "claude-code"
6567
- cmd: "dust --version"
6668
name: "dust"
6769
- cmd: "tldr --version"

ansible/roles/apps/tasks/debian.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@
2222
loop: "{{ snap_apps }}"
2323
become: true
2424

25+
- name: Check if Claude Code CLI is installed
26+
ansible.builtin.command: which claude
27+
register: claude_check
28+
changed_when: false
29+
failed_when: false
30+
31+
- name: Install Claude Code CLI via pnpm
32+
ansible.builtin.command: pnpm add -g @anthropic-ai/claude-code
33+
environment:
34+
PATH: "{{ ansible_env.HOME }}/.local/share/pnpm:{{ ansible_env.PATH }}"
35+
PNPM_HOME: "{{ ansible_env.HOME }}/.local/share/pnpm"
36+
changed_when: claude_check.rc != 0
37+
when: claude_check.rc != 0
38+
2539
- name: Check if Zed is installed
2640
ansible.builtin.command: which zed
2741
register: zed_check

ansible/roles/apps/vars/darwin.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
# OrbStack is used in place of Docker Desktop on macOS (drop-in replacement per principle 2)
33
homebrew_casks:
4+
- claude-code
45
- dbeaver-community
56
- drawio
67
- firefox

ansible/roles/apps/vars/windows.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
winget_apps:
33
- 7zip.7zip
4+
- Anthropic.Claude
45
- Mozilla.Firefox
56
- SabaAmaury.Caesium
67
- dbeaver.dbeaver

ansible/roles/dotfiles/tasks/main.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,3 +333,16 @@
333333
- ff
334334
- ll
335335
when: effective_platform != "windows"
336+
337+
# ── Claude Code MCP servers ──────────────────────────────────────────────
338+
- name: Configure Claude Code MCP servers
339+
ansible.builtin.shell: |
340+
claude mcp list 2>/dev/null | grep -q "{{ item.name }}" || \
341+
claude mcp add {{ item.name }} -s user -- {{ item.command }}
342+
args:
343+
executable: /bin/bash
344+
loop: "{{ mcp_servers }}"
345+
loop_control:
346+
label: "{{ item.name }}"
347+
changed_when: false
348+
when: effective_platform != "windows"

cspell.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"Amaury",
1818
"Amberol",
1919
"ansible",
20+
"anthropic",
2021
"aquasecurity",
2122
"asciinema",
2223
"autoclean",
@@ -31,6 +32,7 @@
3132
"checkov",
3233
"chezmoi",
3334
"clmv",
35+
"cloudflare",
3436
"commitizen",
3537
"conflictstyle",
3638
"CoreyButler",
@@ -92,9 +94,11 @@
9294
"linted",
9395
"localport",
9496
"markdownlint",
97+
"mcp",
9598
"minikube",
9699
"misconfig",
97100
"mise",
101+
"modelcontextprotocol",
98102
"nvm",
99103
"mlr",
100104
"MSVC",
@@ -111,6 +115,7 @@
111115
"Pathbar",
112116
"pipefail",
113117
"pipx",
118+
"playwright",
114119
"playbook",
115120
"playbooks",
116121
"pnpm",
@@ -148,6 +153,7 @@
148153
"timezone",
149154
"tlsv",
150155
"toml",
156+
"upstash",
151157
"upx",
152158
"uv",
153159
"yq",

0 commit comments

Comments
 (0)