Skip to content

EthanFrostpro/quanta-quest-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP Service: FinancialModelingPrep (FMP) Proxy

This service acts as a secure and standardized intermediary between Claude and the third-party FinancialModelingPrep (FMP) API. It simplifies the vast FMP API into a set of logical, consistent MCP endpoints, handles authentication, and enforces standard error handling and logging.

Running the Service

  1. Install Dependencies:

    pip install -r requirements.txt
  2. Configure API Key: Create a .env file in the root directory of this project and add your FMP API key:

    FMP_API_KEY="YOUR_FINANCIAL_MODELING_PREP_API_KEY"
    
  3. Start the Service:

    python -m mcp_fmp_proxy

    The service will be available at http://127.0.0.1:8000.

API Documentation

This service uses FastAPI, which automatically generates interactive API documentation. Once the service is running, you can access it at:

This documentation provides a complete and interactive reference for all available endpoints, including their request and response models.

Available Endpoints (Summary)

Below is a summary of the implemented endpoints. For detailed request/response formats, please refer to the auto-generated documentation linked above.

Company Data (/company)

  • POST /company/profile

    • Description: Retrieves core profile information for a single company.
    • Request Body: {"symbol": "AAPL"}
  • POST /company/quote

    • Description: Retrieves real-time or delayed price quotes for one or more symbols.
    • Request Body: {"symbols": ["AAPL", "MSFT"]}

Financial Statements (/financials)

  • POST /financials/statement
    • Description: Retrieves income, balance sheet, or cash flow statements.
    • Request Body: {"symbol": "AAPL", "statement_type": "income", "period": "annual", "limit": 2}
    • statement_type can be income, balance_sheet, or cash_flow.
    • period can be annual or quarter.

Running Tests

To ensure the service is functioning correctly, you can run the test suite:

  1. Make sure your FMP_API_KEY is correctly set in the .env file.
  2. Run the tests using pytest:
    python -m pytest

Extending the Service

This service is designed to be easily extensible. To add a new set of endpoints (e.g., for "Market Performance"):

  1. Create a new router file: Create mcp_fmp_proxy/routers/market_performance.py.

  2. Define Models and Endpoints: In the new file, define the Pydantic models for your requests and implement the FastAPI APIRouter with the desired endpoints. Use the get_data_from_fmp function from fmp_client.py to interact with the FMP API.

  3. Include the Router: In mcp_fmp_proxy/main.py, import your new router and include it in the FastAPI app:

    from .routers import market_performance
    
    # ...
    app.include_router(
        market_performance.router,
        prefix="/market",
        tags=["Market Performance"]
    )

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages