Skip to main content
Glama
groovyjuice

J-Quants Timeseries MCP

by groovyjuice

J-Quants Timeseries MCP

This is a personal MCP server that fetches daily Japanese stock bars from the J-Quants API V2 and returns a CSV that ChatGPT can save to the "Timeseries Data" folder in Google Drive.

Main behavior

  • Search listed stocks by ticker code or company name

  • Fetch all pages of /v2/equities/bars/daily

  • Convert unadjusted and adjusted OHLCV plus limit-up/limit-down flags into a CSV

  • Read the destination folder ID from Render secret settings and include it in the tool result

  • When a ticker is ambiguous, return candidates instead of guessing

Related MCP server: Enhanced MCP Stock Query System

Environment variables

Name

Description

JQUANTS_API_KEY

J-Quants V2 API key. Required.

GOOGLE_DRIVE_FOLDER_ID

ID of the destination Drive folder. Required.

MCP_ACCESS_TOKEN

Secret path for the MCP URL. At least 32 characters. Required.

PORT

HTTP listening port. Set automatically by Render.

RENDER_EXTERNAL_HOSTNAME

Public host name set automatically by Render.

Do not write the API key, Drive folder ID, or access token into source, conversations, or logs.

Local testing

python -m venv .venv
.venv/bin/pip install -r requirements.txt
PYTHONPATH=. .venv/bin/python -m unittest discover -s tests -v

In Windows PowerShell, replace the Python from the virtual environment with .venv\\Scripts\\python.exe.

Startup

JQUANTS_API_KEY=... GOOGLE_DRIVE_FOLDER_ID=... MCP_ACCESS_TOKEN=32文字以上の秘密文字列 python server.py

The connection URL has the following format.

https://<Renderのホスト名>/mcp/<MCP_ACCESS_TOKEN>

Treat this entire URL as secret information. This is lightweight protection for personal use, not a robust method that replaces OAuth authentication. If it leaks, regenerate MCP_ACCESS_TOKEN.

On the ChatGPT side

  1. In the web version of ChatGPT, enable Developer mode under "Settings" → "Security and login".

  2. In the Plugins addition screen, register the MCP URL above.

  3. In the conversation, select the J-Quants app and Google Drive from Developer mode.

  4. Ask: "Get Kioxia's timeseries data."

The tool returns the CSV body, the file name, and the destination folder ID read from the secret settings. ChatGPT uploads that CSV to the specified Google Drive folder.

J-Quants Free limitations

With the Free plan, the stock prices you can retrieve are limited to the past two years excluding the most recent 12 weeks. Check the actual returned first_date and last_date.

Related MCP Connectors

Related MCP Servers

  • -
    license
    Not graded
    quality
    D
    maintenance
    Provides real-time and historical stock market data through the Alpha Vantage API. Enables users to get current stock prices and retrieve historical stock data for any major stock symbol via natural language queries.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI-powered natural language stock market queries with real-time data from Yahoo Finance and CSV fallback. Uses Google Gemini to interpret queries and automatically fetch stock prices, comparisons, and market summaries.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables access to Japanese stock market data via the free J-Quants API, providing tools for company search, daily quotes, and financial statements.
    1
    MIT
  • A
    license
    B
    quality
    C
    maintenance
    Enables AI assistants to access real-time Japanese and global stock market data, including quotes, charts, technical analysis, and market screening.
    7
    9 npm
    MIT