Local Stock Analyst

Provides stock data and analysis tools using Finnhub with Alpha Vantage fallback and local RSI/MACD calculations.
  • typescript

0

GitHub Stars

typescript

Language

4 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs

This Local Stock Analyst MCP provides a local MCP server that exposes stock-analysis tools to Claude Desktop or cloud clients. It integrates primary data from Finnhub with Alpha Vantage as a fallback and includes local RSI and MACD calculations. You can run it locally in stdio mode for seamless Claude Desktop use or deploy it in HTTP mode for cloud hosting.

How to use

You interact with the server through an MCP client by selecting the available stock-analysis tools listed here. Start the server in stdio mode for local Claude Desktop integration, or deploy in HTTP mode for a cloud service. The server validates inputs, formats outputs consistently, and provides informational disclaimers with results.

How to install

Prerequisites you need before installation:

  • Node.js 20.x or later (recommended for stability)
  • npm
  • API keys for at least one provider: FINNHUB_API_KEY or ALPHAVANTAGE_API_KEY

Concrete steps to set up and run the MCP server locally:

# 1) Install dependencies
npm install

# 2) Create environment file from template
copy .env.example .env

# 3) Add your API keys to .env
# Edit .env to include FINNHUB_API_KEY and/or ALPHAVANTAGE_API_KEY
# 4) Build the project
npm run build

# 5) Start in stdio MCP mode (local Claude Desktop integration)
npm start
# 6) Start in HTTP mode (Render-style cloud hosting)
set MCP_TRANSPORT=http
set PORT=3000
npm start

Note: When running in HTTP mode, the server exposes an endpoint at /mcp and a health check at /healthz.

## Additional sections

Configuration and deployment details adapt to your environment. The server supports two transport modes: stdio for local Claude Desktop usage (default) and HTTP for cloud hosting. The following sections summarize how to configure, deploy, test, and troubleshoot.

## Claude Desktop (Windows) configuration

To connect Claude Desktop to the local MCP server, add or update a server entry in your Claude Desktop configuration with the following details. Use absolute paths for any file-based arguments and restart Claude Desktop after saving.

{ "mcpServers": { "local_stock_analyst": { "command": "node", "args": ["D:/mcpserverdemo/mcplocalstock/build/index.js"], "env": { "FINNHUB_API_KEY": "YOUR_FINNHUB_KEY", "ALPHAVANTAGE_API_KEY": "YOUR_ALPHA_VANTAGE_KEY" } } } }

Notes:
- Use absolute paths in args.
- Forward slashes are acceptable in Windows JSON paths.
- Restart Claude Desktop after saving changes.

Deploy on Render

You can deploy the server as a Web Service on Render. Follow these steps to ensure a smooth deployment.

# 1) Push this project to GitHub
# 2) In Render, create a new Web Service from your repository
# 3) Configure:
#    - Build Command: npm install && npm run build
#    - Start Command: npm start
# 4) Add environment variables:
#    - MCP_TRANSPORT=http
#    - FINNHUB_API_KEY=... (optional but recommended)
#    - ALPHAVANTAGE_API_KEY=... (optional fallback)
#    - PORT is auto-provided by Render
# 5) Deploy

After deployment, verify the endpoints:

  • Health: https://<your-service>.onrender.com/healthz should return {"status":"ok"}
  • MCP endpoint: https://<your-service>.onrender.com/mcp
## Troubleshooting

If you encounter issues, follow these practical checks to diagnose and resolve common problems.

- No tools visible in Claude: validate the claude\_desktop\_config.json JSON, ensure build/index.js exists after npm run build, and fully restart Claude Desktop.
- Auth errors: verify that API keys are correctly set in the config env or in the local .env file.
- Rate-limit errors: wait and retry, reduce call frequency, or use higher-tier API keys; the server will automatically attempt Alpha Vantage as fallback after Finnhub failures.
- Review logs: Claude Desktop logs usually reside under the user’s AppData path; MCP startup and errors are written to standard error by the MCP process.
## Logs

Claude Desktop logs are typically found in the user profile’s Claude logs directory. Server startup and runtime errors are written to standard error by the MCP process.

## Available tools

### get\_stock\_price

Fetches the latest stock price for a given ticker.

### get\_quote

Retrieves current quote data for a specified ticker.

### get\_company\_profile

Returns company overview and key profile details.

### get\_candles

Gets historical candle data for a ticker with specified interval and range.

### get\_stock\_news

Provides recent news related to a stock or company.

### get\_rsi

Calculates or retrieves RSI values for a ticker over a given period.

### get\_macd

Calculates or retrieves MACD values for a ticker.

### get\_key\_financials

Returns essential financial metrics for a company.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational