Skip to content

Commit 2cc6a7c

Browse files
authored
Merge pull request #15 from mojwang/feat/mcp-claude-code-integration
feat: enhance MCP server setup with Claude Code support
2 parents 55b3e94 + ee0b5de commit 2cc6a7c

129 files changed

Lines changed: 1838 additions & 210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/MCP_SERVERS.md

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# MCP (Model Context Protocol) Servers Configuration
22

3-
This document describes the MCP servers that have been added to the Claude Code setup.
3+
This document describes the MCP servers that can be configured for Claude Desktop and Claude Code.
44

55
## Overview
66

7-
The `setup-claude-mcp.sh` script now installs and configures both official and community MCP servers to enhance Claude Code's capabilities.
7+
The macbook-dev-setup project includes several scripts to manage MCP servers:
8+
9+
- `setup-claude-mcp.sh` - Installs and configures MCP servers for Claude Desktop
10+
- `setup-claude-code-mcp.sh` - Configures MCP servers for Claude Code CLI
11+
- `fix-mcp-servers.sh` - Repairs MCP configuration with dynamic server selection
12+
- `debug-mcp-servers.sh` - Tests and debugs MCP server installations
813

914
## Official Servers
1015

@@ -49,12 +54,63 @@ Pieces MCP requires special configuration:
4954

5055
## Installation
5156

57+
### Claude Desktop
58+
59+
```bash
60+
# Install all MCP servers
61+
./scripts/setup-claude-mcp.sh
62+
63+
# Fix/update configuration
64+
./scripts/fix-mcp-servers.sh
65+
66+
# Exclude servers that need API keys
67+
./scripts/fix-mcp-servers.sh --no-api-keys
68+
69+
# Only install specific servers
70+
./scripts/fix-mcp-servers.sh --servers filesystem,memory,git
71+
```
72+
73+
### Claude Code
74+
75+
```bash
76+
# Add all servers to user scope (global)
77+
./scripts/setup-claude-code-mcp.sh
78+
79+
# Add to project scope (.mcp.json)
80+
./scripts/setup-claude-code-mcp.sh --scope project
81+
82+
# Skip servers requiring API keys
83+
./scripts/setup-claude-code-mcp.sh --no-api-keys
84+
85+
# Add specific servers only
86+
./scripts/setup-claude-code-mcp.sh --servers context7,playwright
87+
```
88+
89+
## Debugging
90+
91+
```bash
92+
# Test all MCP servers
93+
./scripts/debug-mcp-servers.sh
94+
```
95+
96+
This will:
97+
- Check environment variables for API keys
98+
- Test each server individually
99+
- Verify Claude Desktop configuration
100+
- Check Claude Code configuration
101+
52102
Run the setup script to install all servers:
53103

54104
```bash
55105
./scripts/setup-claude-mcp.sh
56106
```
57107

108+
During installation, you'll be prompted for API keys for servers that require them:
109+
- **Exa**: Get your API key from https://dashboard.exa.ai/api-keys
110+
- **Figma**: Get your API key from https://www.figma.com/developers/api#access-tokens
111+
112+
API keys are securely stored in `~/.config/zsh/51-api-keys.zsh` and automatically loaded by your shell.
113+
58114
## Usage
59115

60116
Once installed, the servers are automatically available in Claude Code. You can:
@@ -69,12 +125,40 @@ Once installed, the servers are automatically available in Claude Code. You can:
69125
- Python 3 and uv (for Python servers)
70126
- Claude Code CLI
71127
- For specific servers:
72-
- Figma: Requires Figma API access token
128+
- Exa: Requires API key (will be prompted during setup)
129+
- Figma: Requires API key (will be prompted during setup)
73130
- Semgrep: May require Semgrep CLI installation
74131
- Pieces: Requires PiecesOS running locally
75132

76133
## Troubleshooting
77134

135+
### Connection Issues
136+
137+
To debug MCP connection failures:
138+
1. Run `claude mcp list` to see connection status
139+
2. Use `./scripts/debug-mcp-servers.sh` to test individual servers
140+
3. Check API keys are set: `echo $EXA_API_KEY` and `echo $FIGMA_API_KEY`
141+
4. Restart Claude after configuration changes: `osascript -e 'quit app "Claude"' && open -a "Claude"`
142+
143+
### Common Issues
144+
145+
**Figma/Exa servers fail to connect:**
146+
- Ensure API keys are set in your shell environment
147+
- Check `~/.config/zsh/51-api-keys.zsh` contains the keys
148+
- Reload your shell or run `source ~/.zshrc`
149+
150+
**Playwright server fails:**
151+
- The server may use `index.js` instead of `dist/index.js`
152+
- Check actual file location and update config accordingly
153+
154+
**Semgrep server fails:**
155+
- Requires Python and uv package manager
156+
- Run `cd ~/repos/mcp-servers/community/semgrep && uv sync`
157+
158+
**Configuration gets corrupted:**
159+
- Backup exists at `~/.setup-backups/configs/claude-mcp/`
160+
- Or use `./scripts/fix-mcp-servers.sh` to reset
161+
78162
If a server fails to build or install:
79163
1. Check that all prerequisites are installed
80164
2. Ensure you have internet connectivity for cloning repositories
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# API Keys and Tokens
2+
# This file is managed by the setup scripts
3+
# Manual edits are preserved
4+
5+
# MCP Server API Keys
6+
export EXA_API_KEY="${EXA_API_KEY:-}"
7+
export FIGMA_API_KEY="${FIGMA_API_KEY:-}"
8+
9+
# Other API Keys
10+
export ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY:-}"
11+
export OPENAI_API_KEY="${OPENAI_API_KEY:-}"
12+
export GITHUB_TOKEN="${GITHUB_TOKEN:-}"

dotfiles/scripts/adaptive-colors.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Adaptive Color Configuration for Terminal Tools
44
# This script dynamically configures colors based on terminal capabilities and theme

dotfiles/scripts/exa-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Eza wrapper script for ls-like behavior
44
# This script provides an ls-compatible interface for the eza command

homebrew/Brewfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ cask "google-cloud-sdk" # Google Cloud SDK
135135
cask "ngrok" # Expose local servers
136136

137137
# Fonts
138-
cask "font-anonymice-nerd-font"
138+
# cask "font-anonymice-nerd-font" # Commented out: Already installed, version conflict
139139
cask "font-symbols-only-nerd-font"
140140

141141
# VS Code extensions are managed separately by scripts/setup-vscode-extensions.sh

lib/backup-manager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash
1+
#!/usr/bin/env bash
22

33
# Backup Manager Library
44
# Provides organized backup functionality for setup scripts

0 commit comments

Comments
 (0)