Skip to main content

Overview

The Financial MCP Server uses a hybrid authentication model depending on the data source and deployment method. Understanding the authentication requirements is crucial for proper setup and usage.
YFinance tools require no authentication, while FMP tools require an API key for full functionality.

Authentication Methods

1. No Authentication (YFinance)

YFinance tools work immediately without any setup:
Available without authentication:
  • Basic stock quotes
  • Company information
  • Historical data
  • Symbol search
  • Analyst recommendations
  • Insider transactions

2. FMP API Key (Professional Tools)

FMP tools require a valid API key for access:

Getting FMP API Key

Step 1: Create Account

  1. Visit Financial Modeling Prep
  2. Click “Sign Up” to create a free account
  3. Verify your email address
  4. Complete the registration process

Step 2: Access Dashboard

  1. Log in to your FMP account
  2. Navigate to the API Dashboard
  3. Find your API key in the “API Key” section
  4. Copy the key for use in your application

Step 3: Choose Plan

Environment Configuration

Local Development

Production Deployment

API Key Validation

Testing Your Setup

Server Response Indicators

Valid FMP API Key

Invalid/Missing FMP API Key

YFinance Fallback Active

Rate Limiting & Quotas

FMP Rate Limits

Rate limits are enforced per API key:

Rate Limit Headers

FMP responses include rate limit information:

Handling Rate Limits

The server automatically handles rate limiting:

Security Best Practices

1. API Key Protection

✅ DO: Store API keys in environment variables
❌ DON’T: Hardcode keys in source code
✅ DO: Add .env to .gitignore
❌ DON’T: Commit API keys to repositories
✅ DO: Use platform environment variable systems
  • Railway: Environment Variables tab
  • Heroku: Config Vars
  • Docker: Environment variables
❌ DON’T: Include keys in Docker images or config files

2. Access Control

3. Monitoring & Alerting

Troubleshooting

Common Issues

Symptoms: 401 Unauthorized errorsSolutions:
  • Verify API key is correct (copy-paste from FMP dashboard)
  • Check environment variable is set: echo $FMP_API_KEY
  • Restart server after setting environment variables
  • Ensure no extra spaces or characters in the key
Symptoms: 429 Too Many Requests errorsSolutions:
  • Check your FMP dashboard for usage statistics
  • Implement caching to reduce API calls
  • Upgrade to higher tier plan
  • Use YFinance endpoints for basic data
Symptoms: Server uses “demo” key despite setting FMP_API_KEYSolutions:
  • Restart terminal/shell after setting variables
  • Use printenv | grep FMP to verify variables are set
  • Check .env file is in correct directory
  • Ensure proper syntax in environment files

Debugging Commands

Migration Guide

From Demo to Production

  1. Get Production API Key
  2. Update Deployment Configuration
  3. Test Production Setup
  4. Monitor Usage
    • Check FMP dashboard regularly
    • Set up usage alerts
    • Plan for scaling if needed

Next Steps

Get FMP API Key

Sign up for free FMP account

Installation Guide

Complete server setup instructions

API Reference

Explore all available endpoints

Deployment Guide

Deploy to production platforms