Skip to main content
POST
/
v1
/
mcp
LinqAlpha MCP
curl --request POST \
  --url https://api.linqalpha.com/v1/mcp \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <api-key>' \
  --data '
{
  "jsonrpc": "2.0",
  "method": "initialize",
  "id": 123,
  "params": {}
}
'
{
  "jsonrpc": "2.0",
  "id": 123,
  "result": {},
  "error": {
    "code": 123,
    "message": "<string>"
  }
}

Overview

LinqAlpha MCP gives AI assistants direct access to institutional-grade financial data for fundamental research. Through the Model Context Protocol, your AI (Claude, Cursor, etc.) can query company fundamentals, earnings estimates, stock prices, economic indicators, SEC filings, and earnings transcripts — all from a single endpoint.

Quick Start

If you already have an existing API key, you must request a new key with MCP permissions enabled. Existing keys issued before the MCP endpoint release do not have MCP access. Contact support@linqalpha.com to request a new key.
Add the following to your MCP client configuration:
{
  "mcpServers": {
    "linqalpha": {
      "url": "https://api.linqalpha.com/v1/mcp",
      "headers": { "x-api-key": "<your-api-key>" }
    }
  }
}

Use via Completion API

You can use LinqAlpha MCP tools directly from any LLM completion API (OpenAI, Anthropic, etc.) by making standard HTTP requests to our MCP endpoint. This lets you integrate LinqAlpha’s financial data tools into your own AI workflows and applications.

Step 1: List Available Tools

First, fetch the tool definitions to get their names and input schemas:
Python
import requests

MCP_URL = "https://api.linqalpha.com/v1/mcp"
HEADERS = {
    "Content-Type": "application/json",
    "x-api-key": "<your-api-key>"
}

# List all available tools
response = requests.post(MCP_URL, headers=HEADERS, json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list",
    "params": {}
})

tools = response.json()["result"]["tools"]

Step 2: Convert to OpenAI Tool Format

Transform MCP tool definitions into the format expected by OpenAI’s API:
Python
def mcp_to_openai_tools(mcp_tools):
    """Convert MCP tool definitions to OpenAI function calling format."""
    openai_tools = []
    for tool in mcp_tools:
        openai_tools.append({
            "type": "function",
            "function": {
                "name": tool["name"],
                "description": tool["description"],
                "parameters": tool["inputSchema"]
            }
        })
    return openai_tools

openai_tools = mcp_to_openai_tools(tools)

Step 3: Chat with Tool Calling

Use the converted tools in your OpenAI completion request, then execute any tool calls against LinqAlpha MCP:
Python
from openai import OpenAI
import json

client = OpenAI()

messages = [
    {"role": "user", "content": "What was NVIDIA's revenue for the last 4 quarters?"}
]

# 1. Send request with tools
response = client.chat.completions.create(
    model="gpt-4o",
    messages=messages,
    tools=openai_tools,
)

message = response.choices[0].message

# 2. If the model calls a tool, execute it via LinqAlpha MCP
if message.tool_calls:
    messages.append(message)

    for tool_call in message.tool_calls:
        # Execute tool call against LinqAlpha MCP
        mcp_response = requests.post(MCP_URL, headers=HEADERS, json={
            "jsonrpc": "2.0",
            "id": 1,
            "method": "tools/call",
            "params": {
                "name": tool_call.function.name,
                "arguments": json.loads(tool_call.function.arguments)
            }
        })

        tool_result = mcp_response.json()["result"]["content"][0]["text"]

        messages.append({
            "role": "tool",
            "tool_call_id": tool_call.id,
            "content": tool_result
        })

    # 3. Get final response with tool results
    final_response = client.chat.completions.create(
        model="gpt-4o",
        messages=messages,
        tools=openai_tools,
    )

    print(final_response.choices[0].message.content)
This pattern works with any LLM that supports function/tool calling — including Anthropic Claude API, Google Gemini, and open-source models. Just adapt the tool format conversion for your provider.

Available Tools

LinqAlpha exposes 22 financial data tools organized by category.

Fundamentals & Estimates

ToolDescription
fundamentals_data_queryQuery financial datasets including fundamentals, estimates, and ownership data
fundamentals_data_docsBrowse financial data schema documentation and available fields
stock_pricesGet historical and real-time stock price data
etf_referenceGet ETF metadata including expense ratios, strategies, and classifications
etf_metricsList available ETF performance metrics

Economic Data

ToolDescription
economic_data_queryQuery macroeconomic data (GDP, CPI, employment, Treasury yields, VIX, and more)
economic_indicatorsList available economic indicators grouped by category
economic_indicator_dataGet economic indicator time series data (GDP, CPI, unemployment)
economic_calendarGet upcoming economic data release schedule

Market Data

ToolDescription
forex_ratesGet foreign exchange currency pair rates and history
commodity_pricesGet commodity market data (energy, metals, grains, softs)
treasury_ratesGet US Treasury yield curve data across all maturities (1M-30Y)
market_symbolsList available market symbols for forex, commodities, and economic indicators
market_risk_premiumGet country-level market risk premium for CAPM calculations
ToolDescription
equity_database_queryQuery equity market database (stocks, events, documents)
transcript_searchFull-text search across earnings call transcripts and SEC filings

Research & Citations

ToolDescription
search_filingsSearch and cite SEC filings, earnings transcripts, and financial news
cite_web_sourceCreate a web-based research citation
create_research_sessionCreate a new research session for citation tracking
get_citationsRetrieve all citations created in the current research session
web_searchSearch the web with date range filtering for recent financial news and analysis

Platform

ToolDescription
my_platform_dataQuery your organization’s LinqAlpha platform data
list_guidesList available financial data guides and documentation
read_guideRead a specific financial data guide

Protocol

This endpoint implements JSON-RPC 2.0 over HTTP, following the MCP specification.

Supported Methods

MethodDescription
initializeInitialize MCP session and receive server capabilities
pingHealth check
notifications/initializedClient notification after initialization
tools/listList all available tools with their input schemas
tools/callExecute a tool with the given arguments

Example: List Tools

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/list",
  "params": {}
}
Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "stock_prices",
        "description": "Get historical and real-time stock price data",
        "inputSchema": { ... }
      }
    ]
  }
}

Example: Call a Tool

Request
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "fundamentals_data_query",
    "arguments": {
      "sql": "SELECT ticker, revenue, net_income FROM financials WHERE ticker = 'AAPL' ORDER BY date DESC LIMIT 4"
    }
  }
}
Response
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      {
        "type": "text",
        "text": "Query returned 4 rows..."
      }
    ]
  }
}

Rate Limits

  • 60 requests per minute per user
  • Exceeding the limit returns a JSON-RPC error with code -32000

Error Codes

CodeMeaning
-32600Invalid JSON-RPC request
-32601Method not found
-32602Invalid params (e.g., unknown tool name)
-32603Internal server error
-32000Rate limit exceeded

Authorizations

X-API-KEY
string
header
required

Body

application/json
jsonrpc
enum<string>
required

JSON-RPC version

Available options:
2.0
method
enum<string>
required

MCP method to invoke

Available options:
initialize,
ping,
notifications/initialized,
tools/list,
tools/call
id
integer

Request identifier

params
object

Method-specific parameters. For tools/call: { name: string, arguments: object }

Response

JSON-RPC 2.0 response

jsonrpc
enum<string>
Available options:
2.0
id
integer | null

Request identifier (null for error responses)

result
object

Method result (present on success)

error
object

Error object (present on failure)