AI

MCP Server

POST/v2/mcp

Model Context Protocol (MCP) server for AI agents. Connect any MCP client (Claude, ChatGPT, Cursor, VS Code, Windsurf or your own agent) to one URL, https://api.bavest.co/v2/mcp, and use the Bavest v2 data routes as tools.

Quick start

{
  "mcpServers": {
    "bavest": {
      "url": "https://api.bavest.co/v2/mcp",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

Tools

Each tool wraps one REST route and is named after the route's operationId in snake case: equities.profile is equities_profile, etfs.topHoldings is etfs_top_holdings. initialize and tools/list work without a key and return the exact names and input schemas. A tool call counts against your plan like the REST call it wraps; a route outside your plan answers with an error.

Authentication

Send your API key in the x-api-key header, as on every REST route. Connectors that can only take a URL (Claude custom connectors, ChatGPT developer mode) may pass the same key as the optional api_key query parameter instead. URLs end up in logs and settings exports, so prefer the header.

Free in every plan, including the trial.

Authentication

Send your API key in the x-api-key header on every request to https://api.bavest.co. The samples read it from the BAVEST_API_KEY environment variable. Get an API key · Authentication guide

Parameters

None besides the API key: send it in the x-api-key header (preferred). Connectors that cannot set headers may send it as the optional api_key query parameter instead; URLs end up in logs, so use that only where no header is possible.

Try it

POST /v2/mcp

Sent only to api.bavest.co for this request; not stored.

Sign in to sendGet an API keySends with the key above, or sign in to use your account's key. Each request counts as one API call.

Request body

JSON-RPC 2.0 request following the MCP specification.

  • jsonrpcstringrequired

    JSON-RPC protocol version

    One of 2.0

  • idstring

    Request identifier (omit for notifications)

  • methodstringrequired

    MCP method to invoke

    One of initialize tools/list tools/call ping

  • paramsobject

    Method parameters (varies by method)

Response 200

MCP server response. The response format follows the Model Context Protocol specification and varies based on the MCP method invoked by the client. · application/json

  • jsonrpcstring

    JSON-RPC version

    Example 2.0

  • idstring

    Request identifier

  • resultobject

    MCP response payload (varies by method)

  • metaResponseMeta

    Response envelope metadata. Always present on a 200: time is set by core/response.py on every successful response. Errors carry the same block, built by the same code, so a client parses one meta shape whether the call succeeded or failed.

    • timeinteger

      Server-side processing time in milliseconds

      Example 17

    • parametersobject

      Echo of the request parameters the endpoint resolved

Errors

  • 401Missing or invalid API key.
  • 429Rate limit exceeded. Retry after the `Retry-After` header interval.
  • 500An unexpected error occurred on the server. If the issue persists, contact support with the X-Request-Id header value.
  • defaultAn unexpected error occurred on the server. If the issue persists, contact support with the X-Request-Id header value.

For AI agents: this page as Markdown at /docs/v2_mcp.md, every route in /llms.txt, the OpenAPI spec at /openapi.json.