First Run

Estimated reading time: less than 1 minute 预计阅读时间: 小于 1 分钟

Full walkthrough is in the Chinese version: /guide/start/first-run.

Start

cargo run -p app --release
# or with debug logs
RUST_LOG=debug cargo run -p app --release

Expected logs:

INFO Web server started on 0.0.0.0:8080
INFO MCP plugin initialized (transport: http, mode: embedded, path: /mcp)
INFO summer-ai-relay registered: openai / claude / gemini

Verify OpenAPI

open http://localhost:8080/docs

Verify auth

TOKEN=$(curl -s -X POST http://localhost:8080/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{"username":"Admin","password":"123456"}' | jq -r .data.access_token)

curl -s http://localhost:8080/api/user/info \
  -H "Authorization: Bearer $TOKEN" | jq .

Verify MCP

curl -X POST http://localhost:8080/api/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"0.1"}}}'

Standalone mode:

cargo run -p summer-mcp --features standalone --bin summerrs-mcp -- \
  --database-url 'postgres://admin:123456@localhost/summerrs-admin'

Verify AI Relay

After creating a token in the AI admin (/api/ai-admin/token):

curl -X POST http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer sk-xxx" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"Hello"}]}'

Troubleshooting

SymptomLikely cause
connection refused 5432Postgres not running
relation "sys.user" does not existSQL not initialized
Authentication required even with tokenToken expired or JWT_SECRET rotated
summer-ai-relay channel not foundNo channels configured in AI admin yet