
A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

An MCP server offering financial analysis tools, resources, and prompts backed by the Financial Modeling Prep API.
Financial Modeling Prep MCP Server is cataloged as an MCP server attributed to cdtait. An MCP server offering financial analysis tools, resources, and prompts backed by the Financial Modeling Prep API. It is categorized under finance crypto. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.
Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.
Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.
能力定义尚未审核。未核验的采集内容不会作为可信接口展示。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
暂无可展示的已审核记录。这不表示上游不支持此能力。
Email delivery is not connected. This page does not collect email addresses or create subscriptions.
Browse the registry for current listings instead.
Reviews for Financial Modeling Prep MCP Server are not available yet
Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.
It uses the Financial Modeling Prep API and provides tools, resources, and prompts for financial analysis.
Yes, it includes analysis prompts that generate investment analyses using predefined prompt templates.
It supports stateful and stateless modes for flexible deployment.
README.md · aa4500ad54d6 · 采集于 2026-11-13 08:09:44 UTC
保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。
当前显示最后一次成功采集的文档快照,请以来源页面为准。
A Model Context Protocol (MCP) server that provides tools, resources, and prompts for financial analysis using the Financial Modeling Prep API.
/health endpoint for load balancer health checksThe codebase is organized to align with the FMP API documentation structure found at FMP API Documentation. Each module corresponds to a specific section of the API:
The codebase uses a standardized approach for retrieving quotes across different asset types:
The unified quote endpoint is used for retrieving quotes for all asset types, including:
Each module provides specialized formatting for its respective asset type:
This standardization improves code maintainability and provides a consistent approach to retrieving asset prices throughout the application.
get_aftermarket_quote: Added new function for retrieving aftermarket trading data
get_historical_price_eod_light: Added new function for retrieving historical commodity price data
get_quote_change: Updated to use the "stock-price-change" endpoint instead of "quote-change" endpoint
get_financial_estimates: Updated to match the actual "analyst-estimates" endpoint structure
get_price_target_news: Improved to use the "price-target-news" endpoint
get_key_metrics: Enhanced comprehensive financial metrics tool
Tests are similarly organized with one test file per module, following a consistent pattern to ensure comprehensive coverage.
Clone the repository:
git clone https://github.com/cdtait/fmp-mcp-server.git
cd fmp-mcp-server
Set up the environment using either pip or uv:
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install pip if not available (rare but possible in some environments)
# curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py
# Install dependencies
python -m pip install -r requirements.txt
# For development (includes testing dependencies)
python -m pip install -e ".[dev]"
# Install uv if you don't have it yet
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH=~/.local/bin/:${PATH}
# Create and activate the environment
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
# For development (includes testing dependencies)
uv pip install -e ".[dev]"
Set up your Financial Modeling Prep API key:
# Copy the template
cp .env.template .env
# Edit the .env file to add your API key
# Replace 'your_api_key_here' with your actual API key from FMP
You can get an API key by registering at Financial Modeling Prep.
Set up your OpenAI API key (if using the chat agent):
# Add your OpenAI API key to the .env file
echo "OPENAI_API_KEY=your_openai_api_key_here" >> .env
Verify installation with tests:
# Run unit tests
python -m pytest tests/ -v
# Run acceptance tests with mock data
TEST_MODE=true python -m pytest tests/acceptance_tests.py -v
This project follows a Test-Driven Development (TDD) approach. The test suite is organized in the tests/ directory.
The project implements a comprehensive testing strategy with three distinct test types:
Unit Tests (test_company.py, test_quotes.py, etc.)
Integration Tests (test_server.py, test_resources.py)
Acceptance Tests (acceptance_tests.py)
This multi-level approach provides confidence in both individual components and the system as a whole, ensuring that the application works correctly in isolation and when integrated with the real API.
# Run all unit and integration tests
python -m pytest
# Run with coverage report
python -m pytest --cov=src tests/
# Run specific test file
python -m pytest tests/test_company.py
# Run tests with specific marker
python -m pytest -m acceptance
The project includes acceptance tests that validate integration with the real FMP API. These tests require a valid API key and can also run with mock data.
To run acceptance tests:
# Option 1: Run with the real API
# Set your API key
export FMP_API_KEY=your_api_key_here
# Run the acceptance tests with real API
python -m pytest tests/acceptance_tests.py -v
# Option 2: Run with mock data
# This doesn't require an API key and uses mock responses
TEST_MODE=true python -m pytest tests/acceptance_tests.py -v
These tests verify:
The acceptance tests are designed to check format and structure without asserting specific values that may change over time (like stock prices). This makes them suitable for CI/CD pipelines with a valid API key secret.
Using TEST_MODE=true enables running the acceptance tests in CI environments without requiring a real API key, using the mock responses defined in conftest.py.
fmp-mcp-server/
├── src/ # Source code
│ ├── api/ # API client functionality
│ │ ├── client.py # FMP API client
│ ├── tools/ # MCP tools implementation
│ │ ├── analyst.py # Analyst ratings tools
│ │ ├── charts.py # Stock chart tools
│ │ ├── commodities.py # Commodities tools
│ │ ├── company.py # Company profile tools
│ │ ├── crypto.py # Cryptocurrency tools
│ │ ├── etf.py # ETF analysis tools
│ │ ├── forex.py # Forex tools
│ │ ├── indices.py # Market indices tools
│ │ ├── market.py # Market data tools
│ │ ├── market_hours.py # Market hours tools
│ │ ├── market_performers.py # Market performers tools
│ │ ├── quote.py # Stock quote tools
│ │ ├── search.py # Search tools
│ │ ├── statements.py # Financial statements tools
│ │ └── technical_indicators.py # Technical analysis tools
│ ├── resources/ # MCP resources implementation
│ │ ├── company.py
│ │ └── market.py
│ ├── prompts/ # MCP prompts implementation
│ │ └── templates.py
│ └── agent_chat_client.py # OpenAI Agent-based chat client
├── scripts/ # Deployment and automation scripts
│ └── mcp-aws-ecs-setup.sh # AWS ECS deployment script
├── tests/ # Test suite
│ ├── conftest.py # Pytest fixtures
│ ├── acceptance_tests.py # API integration tests
│ ├── test_analyst.py # Tests for analyst tools
│ ├── test_api_client.py # Tests for API functionality
│ ├── test_calendar.py # Tests for calendar tools
│ ├── test_charts.py # Tests for chart tools
│ ├── test_commodities.py # Tests for commodities tools
│ ├── test_company.py # Tests for company profile tools
│ ├── test_crypto.py # Tests for cryptocurrency tools
│ ├── test_etf.py # Tests for ETF tools
│ ├── test_forex.py # Tests for forex tools
│ ├── test_indices.py # Tests for indices tools
│ ├── test_market.py # Tests for market tools
│ ├── test_market_hours.py # Tests for market hours tools
│ ├── test_market_performers.py # Tests for market performers tools
│ ├── test_prompts.py # Tests for prompts
│ ├── test_quotes.py # Tests for quote tools
│ ├── test_resources.py # Tests for resources
│ ├── test_search.py # Tests for search tools
│ ├── test_server.py # Integration tests
│ ├── test_statements.py # Tests for financial statements tools
│ └── test_technical_indicators.py # Tests for technical indicators tools
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
└── server.py # Main server implementation
You can run the server in different ways:
# Run the server directly (stdio mode)
python -m src.server
# Or use the MCP CLI for development
mcp dev src/server.py
# Install in Claude Desktop
mcp install src/server.py
# Run as an SSE server
python -m src.server --sse --port 8000
Note: Streamable HTTP transport is the recommended transport for production deployments, superseding SSE transport.
The server supports Streamable HTTP transport with both stateful and stateless operation modes:
# Stateful Streamable HTTP (maintains session state)
python -m src.server --streamable-http --port 8000
# Stateless Streamable HTTP (no session persistence)
python -m src.server --streamable-http --stateless --port 8000
# Stateless with JSON responses (instead of SSE streams)
python -m src.server --streamable-http --stateless --json-response --port 8000
Transport Modes:
Endpoints:
http://localhost:8000/mcphttp://localhost:8000/healthDocker Support:
# Default SSE mode
docker run -p 8000:8000 -v $(pwd)/.env:/app/.env ghcr.io/cdtait/fmp-mcp-server:latest
# Streamable HTTP stateful mode
docker run -p 8000:8000 -e TRANSPORT=streamable-http -v $(pwd)/.env:/app/.env ghcr.io/cdtait/fmp-mcp-server:latest
# Streamable HTTP stateless mode
docker run -p 8000:8000 -e TRANSPORT=streamable-http -e STATELESS=true -v $(pwd)/.env:/app/.env ghcr.io/cdtait/fmp-mcp-server:latest
# Streamable HTTP stateless JSON mode
docker run -p 8000:8000 -e TRANSPORT=streamable-http -e STATELESS=true -e JSON_RESPONSE=true -v $(pwd)/.env:/app/.env ghcr.io/cdtait/fmp-mcp-server:latest
If you encounter import errors when running the server, verify that:
Your virtual environment is activated:
source .venv/bin/activate # On Windows: .venv\Scripts\activate
All dependencies are properly installed:
python -m pip install -r requirements.txt
You're in the project root directory when running commands
This starts the server in SSE (Server-Sent Events) mode, which allows connecting the MCP Inspector or other MCP clients over HTTP.
The project includes a chat agent that connects to the FMP MCP server via SSE and provides an interactive CLI interface for financial data queries.
# In one terminal window
python -m src.server --sse
# Ensure you have the OpenAI API key set
export OPENAI_API_KEY=your_openai_api_key_here
# Run the chat agent
python -m src.agent_chat_client
View trace: https://platform.openai.com/traces/trace?trace_id=trace_abc123...
You: What is the current price of Apple?
Running: What is the current price of Apple?
The current price of Apple Inc. (AAPL) is $202.52.
You: Compare AAPL and MSFT's financial performance
Running: Compare AAPL and MSFT's financial performance
...
Type exit or quit to end the chat session.
There are several ways to run the server with Docker:
# Build and run with Docker (includes health check endpoint)
docker build -t fmp-mcp-server .
docker run -p 8000:8000 -e FMP_API_KEY=your_api_key_here fmp-mcp-server
# Or use docker-compose with default port (8000)
# Method 1: Export environment variables (less secure)
export FMP_API_KEY=your_api_key_here
docker-compose up
# Method 2 (PREFERRED): Use a .env file (more secure)
# First, create a .env file in the project root with your API key
echo "FMP_API_KEY=your_api_key_here" > .env
docker-compose up
# Use docker-compose with a custom port
# Using environment variable
PORT=9000 docker-compose up
# Using both .env file and custom port
echo "FMP_API_KEY=your_api_key_here" > .env
PORT=9000 docker-compose up
# Pull the latest image
docker pull ghcr.io/cdtait/fmp-mcp-server:latest
# Run with environment variable for API key
docker run -p 8000:8000 -e FMP_API_KEY=your_api_key_here ghcr.io/cdtait/fmp-mcp-server:latest
# Run with custom port
docker run -p 9000:8000 -e FMP_API_KEY=your_api_key_here ghcr.io/cdtait/fmp-mcp-server:latest
# Run with a mounted .env file (PREFERRED)
# First create your .env file with your API key
echo "FMP_API_KEY=your_api_key_here" > .env
# Then mount it when running the container
docker run -p 8000:8000 -v $(pwd)/.env:/app/.env ghcr.io/cdtait/fmp-mcp-server:latest
The server will always listen on port 8000 inside the container, but Docker maps this to the specified host port (default 8000 or the value of the PORT environment variable).
Note: It's preferable to use the .env file approach for storing your API key rather than exporting it in your shell, as it reduces the risk of accidentally leaking the key in your command history or environment variables.
The MCP Inspector is a useful tool for testing your MCP server. You can use it to explore available tools, resources, and prompts, and test them interactively.
The easiest way to run the MCP Inspector is using Node.js:
# Using npx (no installation required)
npx @modelcontextprotocol/inspector
# Or if you have the package installed globally
mcp-inspector
Once the MCP Inspector is running:
http://localhost:8000/sse
PORT=9000), use that port instead: http://localhost:9000/sseYou can test the health check endpoint once the server is running:
# Test the dedicated health endpoint (ALB-compatible GET request)
curl http://localhost:8000/health
# Expected response:
# {"status":"healthy","service":"fmp-mcp-server"}
# Test MCP redirect endpoint (ALB-compatible GET request)
curl http://localhost:8000/mcp/
# Expected response: HTTP 307 redirect (indicates service is running)
# Test full MCP functionality (JSON-RPC POST request)
curl -L -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "ping",
"params": {}
}' \
http://localhost:8000/mcp
# Expected response:
# event: message
# data: {"jsonrpc":"2.0","id":1,"result":{}}
# Test with ALB (after deployment)
curl http://your-alb-dns-name.region.elb.amazonaws.com/health
# Test full MCP functionality via ALB
curl -L -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "ping",
"params": {}
}' \
http://your-alb-dns-name.region.elb.amazonaws.com/mcp
Once the server is running and connected to an MCP client like Claude Desktop or the MCP Inspector, you can:
Get company profiles:
Get financial statements:
Get stock quotes and price information:
Get analyst ratings:
Get market indices and performers:
Check market status:
Analyze ETFs:
Get commodity, crypto, and forex information:
Get technical analysis:
Use analysis prompts:
The server uses the following environment variables:
FMP_API_KEY: Your Financial Modeling Prep API key (required)
OPENAI_API_KEY: Your OpenAI API key (required for using the chat agent)
PORT: Host port to use when running with Docker Compose (defaults to 8000)
TEST_MODE: Set to "true" to use mock data in acceptance tests
You can set these variables in a .env file in the project root:
# Example .env file contents
FMP_API_KEY=your_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
PORT=9000
TEST_MODE=true # For testing with mock data
This project implements a comprehensive CI/CD pipeline with multiple stages:
Every pull request and push to main automatically triggers:
Unit Tests: Testing individual components with pytest
Integration Tests: Validating component interaction
TEST_MODE=trueDeployment (when merged to main):
The workflow configuration is located in .github/workflows/ci.yml.
Tests with the real FMP API are run:
This separate workflow helps ensure compatibility with the external API while keeping the main CI pipeline fast and avoiding unnecessary API costs.
To run the acceptance tests workflow manually:
The acceptance tests workflow configuration is located in .github/workflows/acceptance-tests.yml.
When ready to publish a stable version:
To create a new release:
The release workflow configuration is located in .github/workflows/release.yml.
Docker images are published to GitHub Container Registry with various tags:
# Development (from CI pipeline)
docker pull ghcr.io/cdtait/fmp-mcp-server:latest # Latest build from main branch
docker pull ghcr.io/cdtait/fmp-mcp-server:a7f33fe2ce0265e0 # Specific commit
# Production releases (from release workflow)
docker pull ghcr.io/cdtait/fmp-mcp-server:stable # Latest stable release
docker pull ghcr.io/cdtait/fmp-mcp-server:v1.2.3 # Specific version
See the Using Docker section for detailed instructions on running the container.
The project includes comprehensive AWS ECS deployment automation with production-ready features including load balancing, service discovery, and duplicate detection.
The following scripts are available in the scripts/ directory:
mcp-aws-ecs-setup.sh - Main ECS deployment script with duplicate detectionadd-load-balancer.sh - Adds Application Load Balancer for stable external accessadd-service-discovery.sh - Adds AWS Cloud Map service discovery for internal communicationcleanup-duplicates.sh - Identifies and removes duplicate servicesAmazonECS_FullAccessAmazonEC2ReadOnlyAccessIAMFullAccess (or CloudWatchLogsFullAccess + SecretsManagerReadWrite)CloudWatchReadOnlyAccess# Make scripts executable
chmod +x scripts/*.sh
# Run the main setup script
./scripts/mcp-aws-ecs-setup.sh
The script will prompt for:
# Add Application Load Balancer for stable external access
./scripts/add-load-balancer.sh
This provides a stable DNS name like mcp-alb-123456789.eu-west-2.elb.amazonaws.com instead of changing IP addresses.
# Add AWS Cloud Map for internal service discovery
./scripts/add-service-discovery.sh
This enables services to find each other using DNS names like mcp-streamable.fmp-mcp-services within the VPC.
All scripts include intelligent duplicate detection:
🔄 DUPLICATE DETECTED: Service 'mcp-streamable-service-a1a90073' already uses task family 'mcp-task-stream'
🚨 DUPLICATE SERVICE DETECTED! 🚨
Service 'mcp-streamable-service-a1a90073' already runs the same task definition family 'mcp-task-stream'
Recommended actions:
1. Update existing service 'mcp-streamable-service-a1a90073' (RECOMMENDED)
2. Create new service anyway (will cause duplicates and extra costs)
3. Exit and cleanup manually
# Check for and remove duplicate services
./scripts/cleanup-duplicates.sh
This script:
You can pre-configure deployments by setting environment variables:
# Create deployment configuration
cat > .env << EOF
REGION=eu-west-2
CLUSTER_NAME=mcp-cluster
TASK_FAMILY=mcp-task-stream
CONTAINER_IMAGE=ghcr.io/cdtait/fmp-mcp-server:latest
PORT=8001
FMP_API_KEY=your_api_key_here
EOF
# Source the environment
source .env
# Run scripts without prompts
./scripts/mcp-aws-ecs-setup.sh
./scripts/add-load-balancer.sh
mcp-aws-ecs-setup.sh):add-load-balancer.sh):add-service-discovery.sh):=== SETUP COMPLETE ===
Cluster: mcp-cluster
Region: eu-west-2
Service: mcp-streamable-service-abc123
- Endpoint: http://3.10.53.254:8001/mcp/
- Transport: streamable-http (stateless)
- Task Definition: mcp-task-stream:1
Test command:
curl http://3.10.53.254:8001/mcp/meta
MCP Inspector Connection URL:
http://3.10.53.254:8001/mcp/
=== APPLICATION LOAD BALANCER SETUP COMPLETE ===
Load Balancer: mcp-alb
DNS Name: mcp-alb-689612947.eu-west-2.elb.amazonaws.com
Your service is now accessible at:
http://mcp-alb-689612947.eu-west-2.elb.amazonaws.com/mcp/meta
Test commands:
curl http://mcp-alb-689612947.eu-west-2.elb.amazonaws.com/mcp/meta
curl http://mcp-alb-689612947.eu-west-2.elb.amazonaws.com/mcp/
=== SERVICE DISCOVERY SETUP COMPLETE ===
Namespace: fmp-mcp-services
Service: mcp-streamable
DNS Name: mcp-streamable.fmp-mcp-services
Your service can now be reached at:
- Internal DNS: mcp-streamable.fmp-mcp-services
- From within the VPC: http://mcp-streamable.fmp-mcp-services:8001
# Scale service to 2 instances for high availability
aws ecs update-service --region eu-west-2 --cluster mcp-cluster --service SERVICE_NAME --desired-count 2
# Force new deployment (useful for updates)
aws ecs update-service --region eu-west-2 --cluster mcp-cluster --service SERVICE_NAME --force-new-deployment
# View service status
aws ecs describe-services --region eu-west-2 --cluster mcp-cluster --services SERVICE_NAME
# Check load balancer health
aws elbv2 describe-target-health --region eu-west-2 --target-group-arn TARGET_GROUP_ARN
# View logs
aws logs tail /ecs/mcp-task-stream --region eu-west-2 --follow
The server provides multiple health check options:
/health{"status": "healthy", "service": "fmp-mcp-server"}/mcp/Load Balancer Features:
This project includes production-ready Terraform configuration for deploying the FMP MCP server to AWS with enterprise-grade features and cost optimization.
# Navigate to terraform directory
cd terraform/fmp-mcp-modular
# Copy and configure variables
cp terraform.tfvars.example terraform-my-region.tfvars
# Edit with your values (region, domain, etc.)
# Deploy infrastructure
terraform init
terraform plan -var-file="terraform-my-region.tfvars" -out="my-region.tfplan"
terraform apply my-region.tfplan
# Set API key in AWS Secrets Manager
SECRET_ARN=$(terraform output -raw secret_arn)
aws secretsmanager put-secret-value \
--secret-id $SECRET_ARN \
--secret-string '{"API_KEY":"your-fmp-api-key-here"}'
# Get application URL
terraform output application_url
For global deployment with automatic failover:
# Deploy to multiple regions with separate state files
terraform apply -var-file="terraform-eu-west-1.tfvars" \
-state="terraform-eu-west-1.tfstate" \
-state-out="terraform-eu-west-1.tfstate"
terraform apply -var-file="terraform-eu-west-2.tfvars" \
-state="terraform-eu-west-2.tfstate" \
-state-out="terraform-eu-west-2.tfstate"
# Route53 automatically provides latency-based routing
The infrastructure includes intelligent weekend-only scheduling:
# Enable weekend-only mode (69-83% cost savings)
terraform apply -var-file="terraform-my-region.tfvars" \
-var="enable_weekend_only=true" \
-var="destroy_albs_when_scaled_down=false"
# Manual scaling operations
aws ecs update-service \
--cluster $(terraform output -raw ecs_cluster_name) \
--service $(terraform output -raw ecs_service_name) \
--desired-count 0 # Scale down
The Terraform configuration creates:
See the complete documentation at terraform/fmp-mcp-modular/README.md for detailed architecture diagrams, configuration options, and management commands.
Code coverage is tracked across different testing stages:
Codecov is used to aggregate and visualize coverage metrics, with separate flags for each testing stage.
Claim this server with your GitHub account to request manual ownership verification.
Link to the catalog listing for Financial Modeling Prep MCP Server from your README. This badge does not certify ownership, compatibility or security.
[](https://awesome-mcp.com/servers/fmp-mcp-server)Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.
来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。
尚无已审核的包 / 镜像标识,暂不展示下载统计。
Alternative and complementary servers in the same category

A stateless streamable HTTP MCP server for interacting with the official source of government spending data.

A hosted, remote MCP server for Fortnox that lets AI assistants answer questions from a company's bookkeeping and propose changes for approval before writing them.

OptimistFi is a read-only remote MCP server that provides perpetual futures market data, perps prop firm rules and pricing, and US equity investment research.