API Documentation
Client Libraries
Introduction
MCPFinancials provides a JSON-RPC interface for accessing financial data, metrics, and analysis tools. This API is designed to be easily integrated with large language models (LLMs) and other applications that need reliable financial data context.
Our API follows the JSON-RPC 2.0 specification, providing a simple and consistent interface for all methods. The base URL for all API requests is:
https://mcpfinancials.com/api/jsonrpc
Authentication
MCPFinancials API offers two access levels:
Public Access
Public access to the API is available without authentication, but with limited rate limits and feature restrictions. Use the following endpoint for public access:
https://mcpfinancials.com/api/jsonrpc
API Key Authentication
For higher rate limits and access to premium features, use API key authentication. API keys can be obtained by registering for a paid account.
To use API key authentication, include your API key in the request headers:
{ "Content-Type": "application/json", "X-API-Key": "your_api_key_here" }
Authenticated requests should be sent to the secure endpoint:
https://mcpfinancials.com/api/jsonrpc/secure
JSON-RPC Interface
All API requests follow the JSON-RPC 2.0 specification. Requests must be sent as POST requests with a JSON body in the following format:
Responses will also follow the JSON-RPC 2.0 specification:
If an error occurs, the response will include an error object:
Financial Metrics
MCPFinancials provides a comprehensive set of financial metrics and ratios for analysis. Use these methods to discover and calculate financial metrics:
Get Available Metrics
Returns a list of all available financial metrics and their schemas.
discover.getAvailableMetrics
View details →Get Metric Schema
Returns the schema for a specific financial metric.
discover.getMetricSchema
View details →Calculate Ratio
Calculate a financial ratio using provided values.
finance.calculateRatio
View details →Calculate Metric
Calculate any financial metric by ID using provided values.
finance.calculateMetric
View details →discover.getAvailableMetrics
Get a list of all available financial metrics and their basic information.
Parameters:
category (optional)
Filter metrics by category (e.g., "profitability", "liquidity")
creator_id (optional)
Filter metrics by creator ID
is_custom (optional)
Filter metrics by whether they are custom or standard
Example Request:
Example Response:
SEC EDGAR Data
MCPFinancials provides access to SEC EDGAR filings and data through the following methods:
Get Company Filings
Retrieve a list of filings for a specific company.
edgar.getCompanyFilings
View details →Get Filing Content
Retrieve the content of a specific SEC filing.
edgar.getFilingContent
View details →Search Filings
Search for specific information across SEC filings.
edgar.searchFilings
View details →Get Financial Data
Extract structured financial data from SEC filings.
edgar.getFinancialData
View details →Market Data
Access historical and current stock market data through the following methods:
Get Historical Data
Retrieve historical stock price data for a date range.
marketstack.getHistoricalData
View details →Technical Indicators
Calculate technical indicators for financial analysis:
Calculate RSI
Calculate Relative Strength Index for a series of prices.
technicals.rsi
View details →Calculate Bollinger Bands
Calculate Bollinger Bands for a series of prices.
technicals.bollinger
View details →Calculate Stochastic Oscillator
Calculate Stochastic Oscillator for a series of prices.
technicals.stochastic
View details →Rate Limits
The MCPFinancials API enforces rate limits to ensure fair usage. Rate limits vary by authentication method:
Authentication | Rate Limit | Period |
---|---|---|
Public (no API key) | 50 requests | per hour |
Basic plan | 500 requests | per hour |
Pro plan | 5,000 requests | per hour |
If you exceed your rate limit, the API will return a 429 Too Many Requests error. You can check your current rate limit usage in the response headers:
- X-RateLimit-Limit: Maximum number of requests allowed in the current period
- X-RateLimit-Remaining: Number of requests remaining in the current period
- X-RateLimit-Reset: Time (in seconds) until the rate limit resets
Error Handling
The MCPFinancials API uses standard JSON-RPC error codes. Here are some common error codes you may encounter:
Code | Message | Description |
---|---|---|
-32700 | Parse error | Invalid JSON was received by the server |
-32600 | Invalid request | The JSON sent is not a valid Request object |
-32601 | Method not found | The method does not exist / is not available |
-32602 | Invalid params | Invalid method parameter(s) |
-32603 | Internal error | Internal JSON-RPC error |
-32000 to -32099 | Server error | Reserved for implementation-defined server errors |
-32001 | Rate limit exceeded | You have exceeded your rate limit |
Python Client
Use our Python client library to easily integrate MCPFinancials into your Python applications:
JavaScript Client
Use our JavaScript client library to easily integrate MCPFinancials into your web applications: