Skip to content

Commit b885990

Browse files
committed
Add MXCP user configuration for LLM API keys
Added missing MXCP user configuration that was needed for LLM functionality: - Created deployment/mxcp-user-config.yml.template with: - Transport config for Docker (streamable-http on 0.0.0.0:8001) - LLM model configurations (OpenAI GPT-4o, GPT-3.5, Anthropic Claude) - Environment variable references for API keys - Updated Dockerfile to: - Create /home/mxcp/.mxcp directory - Copy user config template to ~/.mxcp/config.yml - Set proper ownership for mxcp user - Updated setup-project.sh to copy user config template - Updated README.md to document: - New template file in customizable components - Required OPENAI_API_KEY and ANTHROPIC_API_KEY secrets This ensures MXCP projects have proper LLM configuration out of the box.
1 parent 95597fb commit b885990

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ This repository provides standardized deployment infrastructure for MXCP project
2424
- `config.env.template` - AWS account, ECR repository, service names
2525
- `mxcp-site-docker.yml.template` - MXCP configuration with project name
2626
- `profiles-docker.yml.template` - dbt profiles with project name
27+
- `mxcp-user-config.yml.template` - MXCP user config with LLM API keys
2728
- `Dockerfile` - Generic container build pattern
2829
- `start.sh` - Generic container startup script
2930
- `requirements.txt` - Base MXCP dependencies
@@ -38,6 +39,8 @@ This repository provides standardized deployment infrastructure for MXCP project
3839
- `AWS_SECRET_ACCESS_KEY` - For deployment access
3940
- `MXCP_DATA_ACCESS_KEY_ID` - For data download (if needed)
4041
- `MXCP_DATA_SECRET_ACCESS_KEY` - For data download (if needed)
42+
- `OPENAI_API_KEY` - For LLM functionality (optional)
43+
- `ANTHROPIC_API_KEY` - For Claude models (optional)
4144

4245
### Required Tools
4346
- **Git** - For repository management

deployment/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ COPY . .
2727
COPY deployment/mxcp-site-docker.yml ./mxcp-site.yml
2828
COPY deployment/profiles-docker.yml ./profiles.yml
2929

30+
# Create MXCP user configuration directory and copy config
31+
RUN mkdir -p /home/mxcp/.mxcp
32+
COPY deployment/mxcp-user-config.yml.template /home/mxcp/.mxcp/config.yml
33+
3034
# PROJECT-SPECIFIC: UAE Business License Data Preparation
3135
# Squirro can modify this section for their data sources
3236
ARG MXCP_DATA_ACCESS_KEY_ID
@@ -44,7 +48,7 @@ ENV AWS_ACCESS_KEY_ID=""
4448
ENV AWS_SECRET_ACCESS_KEY=""
4549

4650
# Ensure directories have correct permissions
47-
RUN chmod -R 755 ./data ./logs && chown -R mxcp:mxcp ./data ./logs
51+
RUN chmod -R 755 ./data ./logs && chown -R mxcp:mxcp ./data ./logs /home/mxcp/.mxcp
4852

4953
# Set environment variables
5054
ENV PYTHONPATH=/app
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
mxcp: 1
2+
3+
# Transport configuration for Docker deployment
4+
transport:
5+
provider: streamable-http
6+
http:
7+
host: 0.0.0.0
8+
port: 8001
9+
10+
# LLM Models Configuration
11+
# Add your API keys here or use environment variables
12+
models:
13+
gpt-4o:
14+
provider: openai
15+
api_key: ${OPENAI_API_KEY}
16+
model: gpt-4o
17+
gpt-3.5-turbo:
18+
provider: openai
19+
api_key: ${OPENAI_API_KEY}
20+
model: gpt-3.5-turbo
21+
claude-3-5-sonnet-20241022:
22+
provider: anthropic
23+
api_key: ${ANTHROPIC_API_KEY}
24+
model: claude-3-5-sonnet-20241022

setup-project.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ sed -i "s/{{PROJECT_NAME}}/$PROJECT_NAME/g; s/{{AWS_REGION}}/$AWS_REGION/g" depl
9898

9999
print_success "Created deployment/profiles-docker.yml"
100100

101+
# Copy MXCP user configuration
102+
cp deployment/mxcp-user-config.yml.template deployment/mxcp-user-config.yml
103+
104+
print_success "Created deployment/mxcp-user-config.yml"
105+
101106
# Summary
102107
echo ""
103108
print_success "🎉 Project setup complete!"
@@ -113,6 +118,7 @@ echo "- deployment/config.env"
113118
echo "- justfile"
114119
echo "- deployment/mxcp-site-docker.yml"
115120
echo "- deployment/profiles-docker.yml"
121+
echo "- deployment/mxcp-user-config.yml"
116122
echo ""
117123
echo -e "${BLUE}Project: ${GREEN}$PROJECT_NAME${NC}"
118124
echo -e "${BLUE}Region: ${GREEN}$AWS_REGION${NC}"

0 commit comments

Comments
 (0)