DE

DeepQ Chinese Financial AI MCP Server

Access DeepQ's Chinese Financial AI MCP server to power LLMs with comprehensive financial data, analytics tools, and model-ready resources.

Quick Install
npx -y @shenqingtech/deepq-financial-toolkit-mcp-server

Overview

DeepQ Chinese Financial AI MCP Server is a Model Context Protocol (MCP) compatible backend designed to provide LLMs with domain-specific tools, data, and model-ready assets for Chinese financial use cases. It exposes tool-like endpoints and contextual resources — market time series, fundamentals, news, embeddings, document search, and analytics primitives — so an LLM can call out to reliable services instead of hallucinating or relying solely on its parameters.

This server is useful when you need tight integration between a retrieval-augmented generation pipeline and specialized financial knowledge in Chinese: it standardizes tool discovery through MCP, offers preprocessed data and embeddings, and provides developer-friendly APIs and connectors so building chatbots, research assistants, or automated monitoring systems becomes quicker and more reproducible.

Features

  • MCP-compatible tool registry for LLMs to discover and call domain tools
  • Market data access: time series, tick-level snapshots, and simple aggregation endpoints
  • Fundamentals and corporate filings retrieval for Chinese securities
  • News and event ingestion, with search and summarization-ready payloads
  • Embeddings API and vector-search integration for semantic retrieval
  • Document ingestion: PDF/CSV/HTML loaders, chunking, and metadata extraction
  • Prompt templates and response formatting helpers for consistent outputs
  • Authentication and basic rate-limiting, suitable for production integration
  • Dockerized deployment and environment-based configuration

Installation / Configuration

Clone the repo, configure environment variables, then run with Docker Compose or directly.

  1. Clone the repository
git clone https://github.com/shenqingtech/deepq-financial-toolkit-mcp-server.git
cd deepq-financial-toolkit-mcp-server
  1. Example environment variables (.env)
# Server settings
PORT=8080
API_KEY=your_api_key_here

# Data & storage
DATABASE_URL=postgres://user:pass@localhost:5432/deepq
VECTOR_STORE=milvus
VECTOR_STORE_HOST=127.0.0.1
VECTOR_STORE_PORT=19530

# Embedding provider (optional)
EMBEDDING_PROVIDER=openai
EMBEDDING_API_KEY=sk-...

# Optional feature toggles
ENABLE_NEWS_INGEST=true
ENABLE_MARKET_FEED=true
  1. Run with Docker Compose
docker-compose up -d

Or run locally (example for a Python-based server):

pip install -r requirements.txt
python -m deepq_mcp_server.main

Adjust deployment to your infrastructure (Kubernetes manifests, systemd, cloud run) as needed.

Available Resources

The server organizes domain assets and tools into discoverable resources for LLMs and developers.

ResourcePurpose
Market Data APIQuery time-series, OHLC, and pre-aggregated indicators
Fundamentals APIRetrieve company profiles, balance sheets, income statements
News & EventsIngested Chinese financial news with summarization metadata
Embeddings & Vector SearchGenerate or query embeddings for semantic retrieval
Document StoreIngest PDFs/CSVs, chunk documents, attach metadata
Prompt TemplatesReusable prompts for research, compliance, and summarization
Tool Registry (MCP)Tool manifests so LLMs can discover callable endpoints

Each resource exposes REST endpoints and JSON schemas suitable for programmatic use and for inclusion in an MCP tool manifest.

Use Cases

  • Financial Research Assistant

    • Flow: ingest financial reports → generate embeddings → use semantic search to retrieve relevant passages → LLM calls summarization tool to produce Chinese-language research notes.
    • Example: monthly earnings summarization for a basket of A-share companies.
  • Intelligent Chatbot for Investors

    • Flow: LLM uses MCP tool registry to call market-data endpoints and returns up-to-date price, volume and short analytic snippets instead of relying on stale model knowledge.
    • Example: user asks “本季度某公司营收增长原因是什么?” → server provides fundamentals + recent news → model synthesizes answer.
  • Compliance & Audit Workflows

    • Flow: ingest filings and regulatory notices, run keyword scans and similarity search to detect risky disclosures, produce audit-ready reports.
    • Example: automated screening of corporate filings for predefined risk signals.
  • Quantitative Backtesting Support

    • Flow: request historical time series slices and indicator computations from the API to feed backtesting systems or strategy notebooks.
    • Example: collect 3 years of daily OHLC for factor research and compute rolling Sharpe ratios.
  • Automated Monitoring & Alerts

    • Flow: stream market events and news into the server, trigger summarization and alert generation when thresholds are exceeded.
    • Example: real-time alert when an issuer’s sentiment score drops sharply after a press release.

Quick Examples

Curl example: request search over documents

curl -X POST "http://localhost:8080/api/v1/tools/document_search" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"收入增长原因", "top_k":5}'

Python example: call embeddings endpoint

import requests, os
API_KEY = os.environ["API_KEY"]
r = requests.post(
    "http://localhost:8080/api/v1/tools/embeddings",
    headers={"Authorization": f"Bearer {API_KEY}"},
    json={"texts": ["公司财报摘要"], "model": "text-embedding-zh"}
)
print(r.json())

Next Steps

  • Inspect the MCP tool registry endpoint to discover tool manifests programmatically.
  • Configure your LLM orchestration layer to use the server’s MCP manifests so models can call tools directly.
  • Extend ingestion pipelines to feed your proprietary datasets (CSV, PDFs) into the document store for private-search and summarization.