MCP Server Node.js

Provides an MCP-based AI agent system for financial analysis and portfolio management using local AI models and real-time market data.
  • javascript

0

GitHub Stars

javascript

Language

7 months ago

First Indexed

3 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
{
  "mcpServers": {
    "nbwolfer-mcpservernode": {
      "command": "node",
      "args": [
        "master-server.js"
      ],
      "env": {
        "PORT": "8001",
        "LLM_MODEL": "gemma3:4b",
        "FINNHUB_API_KEY": "YOUR_FINNHUB_API_KEY",
        "OLLAMA_BASE_URL": "http://127.0.0.1:11434"
      }
    }
  }
}

You set up an MCP server on Node.js to orchestrate specialized AI agents for financial analysis and portfolio management. It routes user queries to the right agent, fetches real-time market data, and returns actionable investment guidance through a RESTful API and local AI models. This enables you to offer smart financial advice, portfolio reviews, and risk assessments in a scalable, modular way.

How to use

You interact with the MCP server by running the local master agent and the portfolio analysis server, then sending queries to the master endpoint. The master server analyzes each request and routes it to the most suitable agent (portfolio analysis, risk analysis, or general chat). You can build client workflows that submit a user query and an identifier, and receive a structured response that indicates which agent handled the request and the resulting analysis or advice.

How to install

# Prerequisites: ensure you have Node.js 18+ and npm/yarn installed
node -v
npm -v

# Optional: install yarn
# npm install -g yarn
# 1. Install dependencies for the MCP server
npm install

# 2. Create environment configuration
# Add the following to a file named .env in your project root
FINNHUB_API_KEY=your_finnhub_api_key_here
OLLAMA_BASE_URL=http://127.0.0.1:11434
PORT=8001
LLM_MODEL=gemma3:4b
# 3. Start the Master Agent server
node master-server.js

# The server will run on http://localhost:8001

# 4. Optionally start the Portfolio Analysis server as an alternative route
node server.js

Additional sections

Configuration and runtime details are kept in code and environment variables. The master agent handles incoming queries and forwards them to specialized agents for portfolio analysis, risk analysis, or general chat. Market data is fetched via Finnhub, and AI models run locally via Ollama. The system exposes a RESTful API with endpoints for master routing and portfolio analysis.

Security and reliability notes: set API keys and secrets securely, respect API rate limits, and monitor local model memory usage. Ollama runs Gemma 3:4B locally and consumes memory accordingly. Consider enabling caching for market data and portfolio summaries to improve latency.

Troubleshooting highlights: ensure Ollama service is running, verify environment variables are loaded, and confirm that the designated ports are not in use. If you encounter port conflicts, run the server on a different port (for example, PORT=8002) and restart the master server.

Notes: this setup is intended for development and demonstration purposes. For production deployments, implement security hardening, rate limiting, logging, and packaging (Docker or Kubernetes) as part of your deployment strategy.

Available tools

master_agent

Routes incoming queries to the appropriate specialized agent based on AI routing logic.

portfolio_analysis_agent

Performs portfolio analysis and provides strategy recommendations.

risk_analysis_agent

Assesses portfolio risk, volatility, and mitigation suggestions.

general_chatbot_agent

Handles general financial questions and chat interactions.

ollama_integration

Interacts with the local Ollama service to run AI models like Gemma.

finnhub_integration

Fetches real-time market data via Finnhub API.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
MCP Server Node.js MCP Server - nbwolfer/mcpservernode | VeilStrat