This MCP server provides augmented language model capabilities specifically for stock market-related queries and generations. It implements the Model Context Protocol (MCP) to enhance LLM responses with accurate, timely stock market information.
To set up the stock-LLM server, follow these steps:
git clone https://github.com/username/stock-LLM.git
cd stock-LLM
pip install -r requirements.txt
.env
file in the root directory with the following:ALPHA_VANTAGE_API_KEY=your_api_key_here
PORT=8000
Replace your_api_key_here
with your actual Alpha Vantage API key.
To start the MCP server, run:
python server.py
The server will start on the port specified in your .env
file (default: 8000).
You can interact with the server using the Model Context Protocol. Here's an example of a basic request:
{
"messages": [
{"role": "user", "content": "What's the current price of AAPL?"}
],
"mcp": {
"augmentation": true
}
}
Send this as a POST request to the server's endpoint:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages":[{"role":"user","content":"What is the current price of AAPL?"}],"mcp":{"augmentation":true}}'
The server supports the following stock market functions:
You can customize the server's behavior with these configuration parameters in your requests:
augmentation
(boolean): Enable or disable the augmentation featuremax_history_days
(integer): Maximum number of days for historical data (default: 30)data_source
(string): Specify which data source to prioritize (default: "alpha_vantage")Example request with configuration:
{
"messages": [
{"role": "user", "content": "Show me TSLA stock performance over the last week"}
],
"mcp": {
"augmentation": true,
"max_history_days": 7,
"data_source": "alpha_vantage"
}
}
Check the server logs for detailed error information and debugging:
tail -f logs/server.log
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "stock-llm" '{"command":"npx","args":["-y","stock-llm"]}'
See the official Claude Code MCP documentation for more details.
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 > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"stock-llm": {
"command": "npx",
"args": [
"-y",
"stock-llm"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"stock-llm": {
"command": "npx",
"args": [
"-y",
"stock-llm"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect