Harvey API Overview
The H.A.R.V.E.Y. (Holistic Analysis and Regulation Virtual Expert for You) API is a FastAPI service that provides conversational pricing analysis capabilities. It acts as an MCP (Model Context Protocol) client, launching the Pricing MCP server and exposing HTTP endpoints for frontend consumption.Base URL
When running locally:Architecture
Harvey API follows the MCP client-mediated access model:- Client Role: Acts as an MCP client, communicating with the Pricing MCP server
- Transport: Supports both
stdioandsse(Server-Sent Events) transports - LLM Integration: Uses OpenAI models for natural language orchestration and planning
- No Server-Side Keys: The MCP server doesn’t require API keys when used via Harvey
Available Endpoints
POST /chat
Conversational endpoint for pricing analysis queries
POST /upload
Upload Pricing2Yaml files for analysis
GET /health
Health check endpoint for monitoring
DELETE /pricing/{filename}
Delete uploaded YAML assets
Authentication
Currently, the Harvey API does not require authentication for requests. However, it requires:OPENAI_API_KEYenvironment variable for LLM operationsOPENAI_MODELenvironment variable (defaults togpt-5)
Configuration
Key environment variables:Python module path for the Pricing MCP server entrypoint
Transport mechanism:
stdio or sseURL for the MCP server when using SSE transport (e.g.,
http://mcp-server:8085/sse)OpenAI API key for H.A.R.V.E.Y. assistant
OpenAI model to use for natural language processing
Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL
Local Development
Docker Deployment
Build and run the Harvey API container:MCP Compliance
Harvey follows the MCP 2025-06-18 specification:- Calls server tools with structured JSON arguments
- Expects JSON content blocks in responses
- Reads server resources using
resources/read(e.g.,resource://pricing/specification) - Does not advertise optional client capabilities for roots, sampling, or elicitation
- Planning and LLM usage happen client-side
Error Handling
The API uses standard HTTP status codes:200 OK- Successful request201 Created- Resource created (upload)204 No Content- Successful deletion400 Bad Request- Invalid request parameters404 Not Found- Resource not found502 Bad Gateway- MCP server communication error
CORS
CORS is enabled for all origins (*) to support frontend integration. In production, configure this more restrictively.
Next Steps
Chat Endpoint
Learn how to submit pricing queries
Upload YAML
Upload Pricing2Yaml files for analysis