TSETMC History MCP

TSETMC History MCP

Provides access to Iranian stock market historical data (price/trade and retail/institutional) via BrsApi, with tools, prompts, and resources for analysis.

Category
Visit Server

README

TSETMC History MCP

Streamable HTTP MCP server for TSETMC historical market data via BrsApi. Built with TypeScript + Bun.

Twin of Codal-MCP: same transport, packaging, and test style.

Supports:

  1. Price & trade daily history (History.php type=0)
  2. Retail / institutional daily history (type=1)
  3. Field documentation as MCP resources
  4. Analysis prompts (trend + money flow + full pipeline)

Transport: Streamable HTTP only (no stdio / legacy SSE server).

For a full onboarding walkthrough of the API and this repo, read History_API_Guide.md.

Setup

bun install
cp .env.example .env
# set BRS_API_KEY=...
bun run start

Health: GET http://127.0.0.1:3000/health
MCP endpoint: http://127.0.0.1:3000/mcp

Tools

Tool Upstream Purpose
get_price_history type=0 Daily price/trade bars (date, tvol, pc, …)
get_client_type_history type=1 Daily حقیقی/حقوقی counts, volumes, values
list_history_fields local Catalog of both modes and field names

Both history tools accept l18 plus optional date_start / date_end (client-side filter).

Prompts

Prompt Purpose
analyze_price_trend Analyze price/trade JSON
analyze_money_flow Analyze retail vs institutional JSON
history_agent_pipeline End-to-end fetch + analyze checklist

Resources

URI Content
history://fields Index of modes
history://fields/price Type 0 field black doc
history://fields/client-type Type 1 field black doc

Markdown sources live in src/resources/docs/.

Cursor / client config example

{
  "mcpServers": {
    "tsetmc-history": {
      "url": "http://127.0.0.1:3000/mcp"
    }
  }
}

Tests

bun test

Tests cover every tool, field resource, and prompt via an in-process Streamable HTTP client (handler.fetch). No live API key required.

Env

Variable Required Description
BRS_API_KEY yes (live API) BrsApi key (HISTORY_API_KEY alias also accepted)
PORT no Default 3000
HOST no Default 127.0.0.1
MCP_PATH no Default /mcp

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured