Replace startup token authentication with per-SSE-connection auth. Each client now passes Bearer token in Authorization header when connecting. Server validates against config.yaml tokens and creates isolated Server instance per connection. - server.py: accept (auth, agent) instead of (config_path, token) - main.py: extract Bearer token, authenticate, create server per connection - Remove GRIST_MCP_TOKEN from docker-compose environments
47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
# Test environment - ephemeral, branch-isolated
|
|
services:
|
|
grist-mcp:
|
|
build:
|
|
context: ../..
|
|
dockerfile: Dockerfile
|
|
container_name: grist-mcp-test-${TEST_INSTANCE_ID:-default}
|
|
ports:
|
|
- "3000" # Dynamic port
|
|
environment:
|
|
- CONFIG_PATH=/app/config.yaml
|
|
volumes:
|
|
- ../../tests/integration/config.test.yaml:/app/config.yaml:ro
|
|
depends_on:
|
|
mock-grist:
|
|
condition: service_healthy
|
|
networks:
|
|
- test-net
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:3000/health')"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 10s
|
|
|
|
mock-grist:
|
|
build:
|
|
context: ../../tests/integration/mock_grist
|
|
container_name: mock-grist-test-${TEST_INSTANCE_ID:-default}
|
|
ports:
|
|
- "8484" # Dynamic port
|
|
environment:
|
|
- PORT=8484
|
|
networks:
|
|
- test-net
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8484/health')"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 10s
|
|
|
|
networks:
|
|
test-net:
|
|
name: grist-mcp-test-${TEST_INSTANCE_ID:-default}
|
|
driver: bridge
|