atxtechbro / atxtechbro/dotfiles

refactor(mcp): Create shared utility functions for MCP setup scripts

Open
#190 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
27
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Description
The MCP setup scripts currently contain a significant amount of duplicated code. This issue proposes refactoring these scripts to use shared utility functions following the DRY (Don't Repeat Yourself) principle.

## Proposed Solution
Create a shared utility script `mcp/utils/mcp-setup-utils.sh` with common functions:

1. **Common Setup Functions**:
- `check_docker_installed()` - Check if Docker is installed
- `check_dotfiles_repo()` - Check if we're in the dotfiles repository
- `get_repo_root()` - Get the repository root directory
- `setup_mcp_servers_repo()` - Clone/update the MCP servers repository
- `build_mcp_docker_image()` - Build Docker image for a specific MCP server
- `update_mcp_json()` - Update mcp.json to include a new server

2. **Wrapper Script Templates**:
- Create a template system or helper functions for generating wrapper scripts with consistent structure

3. **MCP JSON Configuration**:
- Replace manual updates to mcp.json with a more robust approach using utility functions

## Benefits
- Reduced code duplication
- Easier maintenance
- Consistent pattern for adding future MCP servers
- Simplified setup scripts

## Related PRs
- #189 - Added Brave Search, Filesystem, Google Drive, and Slack MCP servers

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the existing MCP setup scripts and the related changes in PR #189 to identify duplicated setup, Docker, wrapper, and mcp.json logic. Add mcp/utils/mcp-setup-utils.sh with the proposed shared functions and wrapper helpers, then verify that each setup script still works and produces the expected mcp.json configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, shell
Domain
devops, tooling
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.