This Stock Market MCP Server allows you to fetch real-time stock market data and company financial information through the Alpha Vantage API. It's designed to provide stock prices, market reports, and comprehensive financial data using Model Context Protocol.
Clone the repository to your local machine:
git clone <repository-url>
cd stock-market-mcp-server
Install dependencies:
npm install
Build the project:
npm run build
To use this server with Claude Desktop, you need to add the server configuration:
For MacOS:
Edit the configuration file at: ~/Library/Application Support/Claude/claude_desktop_config.json
For Windows:
Edit the configuration file at: %APPDATA%/Claude/claude_desktop_config.json
Add this configuration:
{
"mcpServers": {
"stock-market-server": {
"command": "/path/to/stock-market-server/build/index.js"
}
}
}
Replace /path/to/stock-market-server
with the actual path to your installation.
The server provides several tools to access stock market data:
Retrieves the current price of a stock by its ticker symbol.
Parameters:
symbol
: Stock ticker symbol (e.g., AAPL, MSFT, AMZN)Example usage:
get_ticker_price AAPL
Generates a comprehensive report on the current US market conditions.
Example usage:
get_market_report
Retrieves financial statements for a specified company.
Parameters:
symbol
: Stock ticker symbolstatement_type
: Type of statement (income, balance, or cashflow)Example usage:
get_financial_statement AAPL income
Provides key metrics and basic information about a company.
Parameters:
symbol
: Stock ticker symbolExample usage:
get_company_overview TSLA
Since MCP servers communicate via standard input/output (stdio), debugging can be challenging. You can use the MCP Inspector tool:
npm run inspector
After running this command, the Inspector will provide a browser URL where you can access debugging tools.
Please be aware of Alpha Vantage API rate limits when using this server. The free API key typically has limitations on the number of requests you can make per minute and per day.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.