Switch to simplified Twilio MCP integration using @yiyang.1i/sms-mcp-server

- Replace API Key/Secret auth with Account SID/Auth Token
- Configure MCP during Docker build instead of runtime
- Remove mcp-config.json and config directory
- Simplify startup script by removing MCP configuration logic
- Update documentation and test scripts for new auth method

The MCP server is now configured directly in the Dockerfile using
'claude mcp add-json' command, making the setup more reliable and
eliminating runtime configuration complexity.
This commit is contained in:
Vishal Jain
2025-06-17 21:48:00 +01:00
parent 6cb57c9dc6
commit d9bf0f4b53
8 changed files with 63 additions and 60 deletions

View File

@@ -28,14 +28,8 @@ RUN npm install -g @anthropic-ai/claude-code
# Ensure npm global bin is in PATH
ENV PATH="/usr/local/bin:${PATH}"
# Install Twilio MCP server
RUN npm install -g @twilio-alpha/mcp
# Create directories for configuration
RUN mkdir -p /app/config /app/.claude /home/claude-user/.claude
# Copy MCP configuration
COPY config/mcp-config.json /app/config/
RUN mkdir -p /app/.claude /home/claude-user/.claude
# Copy startup script
COPY scripts/startup.sh /app/
@@ -51,6 +45,16 @@ RUN chown -R claude-user:claude-user /app /home/claude-user
# Switch to non-root user
USER claude-user
# Configure MCP server during build if Twilio credentials are provided
RUN bash -c 'source /app/.env && \
if [ -n "$TWILIO_ACCOUNT_SID" ] && [ -n "$TWILIO_AUTH_TOKEN" ]; then \
echo "Configuring Twilio MCP server..." && \
/usr/local/bin/claude mcp add-json twilio \
"{\"command\":\"npx\",\"args\":[\"-y\",\"@yiyang.1i/sms-mcp-server\"],\"env\":{\"ACCOUNT_SID\":\"$TWILIO_ACCOUNT_SID\",\"AUTH_TOKEN\":\"$TWILIO_AUTH_TOKEN\",\"FROM_NUMBER\":\"$TWILIO_FROM_NUMBER\"}}"; \
else \
echo "No Twilio credentials found, skipping MCP configuration"; \
fi'
# Set working directory to mounted volume
WORKDIR /workspace