The Marketstack MCP Server provides access to financial data via API endpoints, exposing them as MCP tools for integration into compatible systems. You can:
- Retrieve end-of-day and intraday stock data for multiple tickers
- Access stock splits, dividends, and ticker-specific details
- List or search for supported tickers and exchanges
- Obtain information about stock market indices
- Access currency, timezone, and government bond data
- Retrieve ETF tickers and their holdings
- Benefit from in-memory caching to improve performance and respect API rate limits
Used for code linting as part of the MCP server implementation, configured via eslint.config.js.
Used for repository hosting and issue tracking for the MCP server project.
Provides the licensing for the project under the GNU General Public License.
Used as the compiled target language for the MCP server implementation.
Required runtime environment for the MCP server (v18 or later recommended).
Package manager used for installing dependencies and running build scripts.
Used for code formatting, configured via .prettierrc file.
Main programming language used for implementing the MCP server.
Marketstack MCP Server
A Model Context Protocol (MCP) server that exposes various Marketstack API endpoints as MCP tools, providing access to financial data including end-of-day, intraday, splits, dividends, tickers, exchanges, currencies, timezones, bonds, and ETF data. This server simplifies integrating Marketstack data into MCP-compatible agents and systems.
Prerequisites
- Node.js (v18 or later recommended)
- npm (comes with Node.js)
- Marketstack API key
- (Optional) MCP-compatible client or runner (e.g., VSCode extension, CLI)
Setup
- Clone the repository or ensure you are in the project directory.
- Install dependencies:
- Configuration:
- Obtain a Marketstack API key from https://marketstack.com/.
- Configure the
MARKETSTACK_API_KEY
environment variable via your MCP runner's settings. This is the recommended method for seamless integration with the MCP client. Avoid using.env
files for this purpose when running via an MCP runner.
Building and Running
- Build the server:This will create a
build
directory with the compiled JavaScript code. - Run the server:or directly:
- Via MCP runner:
Configure your MCP client to run the server using stdio transport.
Example MCP settings entry (adjust
/path/to/mcp-marketstack
to your actual path and replaceYOUR_API_KEY_HERE
with your actual key):
Available Tools
The server exposes Marketstack API endpoints as distinct MCP tools, categorized by function:
- Market Data
- Reference Data
- Financial Instruments
Detailed input schemas and descriptions for each tool are automatically discoverable by MCP agents connecting to the server via introspection.
Project Structure
The project follows a modular structure:
Caching
The server implements an in-memory Least Recently Used (LRU) cache for tool responses. This helps reduce redundant calls to the Marketstack API, improving performance and adhering to rate limits.
- Mechanism: The cache stores responses based on the tool name and input parameters.
- Configurable TTLs: Each tool has a configurable Time To Live (TTL) for its cached data, defined in
src/cacheConfig.ts
. This allows for different caching durations based on the update frequency of the data provided by each Marketstack endpoint.
Licensing
This project is licensed under the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See the LICENSE
file for details.
Contributing
Contributions are welcome! Please follow the standard fork-and-pull request workflow.
Support
For issues or questions, please open an issue on the GitHub repository.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
Exposes various Marketstack API endpoints as MCP tools, providing access to financial market data including EOD, intraday, splits, dividends, tickers, exchanges, and other financial information.
Related MCP Servers
- AsecurityAlicenseAqualityMCP server that provides AI assistants access to stock market data including financial statements, stock prices, and market news through a Model Context Protocol interface.Last updated -11433PythonMIT License
- AsecurityAlicenseAqualityA Model Context Protocol implementation for the CoinMarketCap API that provides standardized access to cryptocurrency market data, exchange information, and blockchain metrics.Last updated -2622528JavaScriptMIT License
- -securityFlicense-qualityProvides real-time access to global stock market data including current prices, historical charts, and company financial information through a Model Context Protocol (MCP) server for AI assistants.Last updated -TypeScript
- AsecurityAlicenseAqualityMCP service that provides real-time access to Binance cryptocurrency market data, allowing AI agents to fetch current prices, order books, candlestick charts, and trading statistics through natural language queries.Last updated -1239024JavaScriptApache 2.0