Quick Start
Prerequisites
Section titled “Prerequisites”- Go 1.25+
- Docker (for local dependencies)
GOPRIVATE=github.com/MediDrive-Tech/*for private modules
1. Start Dependencies
Section titled “1. Start Dependencies”# Spanner emulatorgcloud emulators spanner start
# Valkey (Redis-compatible)docker run -d --name valkey -p 6379:6379 valkey/valkey:82. Set Environment
Section titled “2. Set Environment”# API key format: token:org_id:client_nameexport MCP_API_KEY_MAPPINGS="dev-test-key:org-dev:dev-client"export MCP_PORT="8080"export MCP_HOST="0.0.0.0"export SPANNER_NEMT_CORE_URL="projects/local/instances/test/databases/nemt"export VALKEY_HOST="127.0.0.1"export VALKEY_PORT="6379"export GOOGLE_MAPS_API_KEY="your-dev-key"3. Build and Run
Section titled “3. Build and Run”make buildmake run4. Test MCP Connection
Section titled “4. Test MCP Connection”Initialize session
Section titled “Initialize session”curl -s -X POST http://localhost:8080/mcp \ -H "Authorization: Bearer dev-test-key" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"capabilities":{}}}' | jq .List tools
Section titled “List tools”curl -s -X POST http://localhost:8080/mcp \ -H "Authorization: Bearer dev-test-key" \ -H "Content-Type: application/json" \ -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' | jq '.result.tools[].name'Call verify_member
Section titled “Call verify_member”curl -X POST http://localhost:8080/mcp \ -H "Authorization: Bearer dev-test-key" \ -H "Content-Type: application/json" \ -d '{ "jsonrpc":"2.0","id":3,"method":"tools/call", "params":{ "name":"verify_member", "arguments":{ "member_id":"MED-12345", "name":"John Doe", "dob":"1990-01-15", "channel":"web" } } }'5. Local Development with go.work
Section titled “5. Local Development with go.work”When developing alongside shared MediDrive libraries:
go work init .go work use ../nemt-objects ../nemt-trip-service ../toolsgo.work and go.work.sum are in .gitignore – developer-local only.
Endpoints
Section titled “Endpoints”| Endpoint | Auth | Purpose |
|---|---|---|
GET /health |
None | Health check (Spanner + Valkey) |
POST /mcp |
Bearer token | MCP StreamableHTTP endpoint |
Authentication
Section titled “Authentication”Requests to /mcp require a Bearer token in the Authorization header. Tokens are mapped to organizations via the MCP_API_KEY_MAPPINGS environment variable:
token:org_id:client_nameMultiple mappings are comma-separated. The org_id is injected into the request context and used for multi-tenant isolation. The lob_id is resolved from member data during verify_member.