MarketTwits MCP
The MarketTwits MCP server allows you to search and retrieve financial market messages from the @markettwits Telegram channel by instrument and time range. It supports various symbol formats including TradingView-style exchange prefixes and aliases (e.g., SI1! → USDRUB). You can filter messages by a flexible time window using either explicit start/end datetimes or a lookback period. Messages are returned newest-first in either a plain timestamped text format or a structured JSON format. Before returning results, the server automatically fetches any missing historical messages for the requested window. Relevance is determined by a configurable instrument-to-hashtag mapping.
Provides tools for searching and retrieving messages from the Telegram channel @markettwits, including filtering by financial instrument and hashtags, and automatically syncing message history.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@MarketTwits MCPWhat are the latest twits about WBD?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MarketTwits MCP
Local SQLite archive and MCP search service for the Telegram channel
@markettwits (-1001203560567).
What it stores
Telegram text messages are stored in data/market_twits.sqlite3 with:
channel ID
UTC message datetime
Telegram message ID
text only
views count
extracted hashtags
The normalized message_hashtags table makes hashtag queries efficient. The
sync_coverage_ranges table records successfully downloaded intervals, including
empty ones, without concealing gaps between disjoint downloads.
Every Telegram fetch is appended to data/download_control.csv with:
channel_id,last_message_id,last_message_datetime,messages_requested,status,input_timestampRelated MCP server: telegram-mcp
Telegram credentials
Sign in at https://my.telegram.org/apps and create an application.
Copy
.env.exampleto.env.Set
TELEGRAM_API_ID,TELEGRAM_API_HASH, andTELEGRAM_PHONE.
Use a Telegram user account. Telegram bots generally cannot retrieve historical
channel messages. On the first sync, Telethon asks for the login code and creates
data/telegram_user.session. Later MCP calls reuse that authorized session.
Never commit .env or the session file; both are excluded by .gitignore.
Install and initial 2024-to-now download
cd C:\_tools\202607_tradingview_mcp\twits_mcp
Copy-Item .env.example .env
# Edit .env first.
uv sync
uv run twits-syncThe initial sync downloads from telegram.history_start in config.yaml through
the current UTC time. It can be stopped and safely rerun: messages are upserted by
(channel_id, message_id). A failed or interrupted partial range is not marked
covered. Already committed batches and the final partial batch remain in SQLite,
and the audit row reports the number committed during that attempt.
Instrument mapping
Edit instrument_hashtags.csv. It uses one row per relationship:
instrument,hashtag
WBD,#WBD
PSKY,#PSKY
BRENT,#ормуз
BRENT,#нефтьMatching is case-insensitive. One instrument can have several hashtags, and the same hashtag can be mapped to several instruments. The tool does not guess links: an unmapped instrument returns an error.
The production mapping accepts either instrument,hashtag or
instrument,hashtag,frequency; frequency is ignored by MCP queries. Mapping
files must be UTF-8, with or without BOM. UTF-8 with BOM is recommended for
reliable Cyrillic editing in Excel.
To regenerate a review file containing every stored hashtag and the number of distinct messages containing it, run:
uv run twits-tagsThis writes tags/instrument_hashtags.draft.csv with the columns
instrument,hashtag,frequency. Existing assignments in that output are
preserved on later runs; frequencies are always recalculated from SQLite and
new hashtags are added as UNMAPPED.
Run the MCP server
Stdio:
uv run twits-mcpHTTP:
uv run twits-mcp streamable-http --host 127.0.0.1 --port 8020The HTTP endpoint is http://127.0.0.1:8020/mcp.
Codex registration:
codex mcp add market-twits --url http://127.0.0.1:8020/mcpTool
asset_twits(
instrument="WBD",
start="2026-07-20T19:00:00Z",
end="2026-07-22T19:00:00Z",
format="structured"
)start and end are inclusive. Both accept ISO-8601 timestamps;
values without an offset are interpreted as UTC and values with an offset are
converted to UTC. end defaults to the current UTC time. If start is omitted,
the legacy days parameter calculates start = end - days and defaults to five
days. A request with start > end returns an error; equal values request that
exact timestamp.
instrument accepts either a bare symbol or TradingView-style
EXCHANGE:SYMBOL. The exchange prefix is discarded before mapping. Supported
examples include CME_MINI:NQ1!, RUS:MX1!, ICEEUR:BRN1!,
BITSTAMP:BTCUSD, and COMEX:GC1!. Both SI1! and RUS:SI1! are normalized
to USDRUB. Instrument aliases are configured in instrument_aliases.json.
Before querying SQLite, the tool downloads any part of the requested date window
not recorded in sync_coverage_ranges. Results are newest first. format="text" is
the default and returns timestamp-prefixed strings. format="structured"
returns message objects:
{
"instrument": "WBD",
"start": "2026-07-20T19:00:00Z",
"end": "2026-07-22T19:00:00Z",
"format": "structured",
"count": 1,
"truncated": false,
"messages": [
{
"id": "-1001203560567:123456",
"ts": "2026-07-22T18:27:00Z",
"text": "ЕС одобрил слияние Warner Bros. и Paramount",
"hashtags": ["#PSKY", "#WBD"]
}
]
}Structured IDs combine the Telegram channel and message IDs, so they remain
stable across overlapping requests. Message bodies have country flags,
promotional/legal footers, repeated whitespace, and inline hashtags removed;
warning markers are retained and hashtags are returned in their own array.
Structured timestamps and sync ranges use ISO-8601 UTC with Z notation.
Every bounded window is returned in full: there is no result cap or silent
truncation, and truncated is therefore false. The response also reports how
many Telegram messages were fetched during that call.
Notes
Telegram history is downloaded newest-first and written to SQLite in batches of 500 messages.
Requests earlier than
history_startare clamped to that configured boundary.Requests later than now fetch only through the current UTC time.
SQLite uses WAL mode and a 30-second busy timeout.
Concurrent calls in one MCP process share a synchronization lock, preventing duplicate downloads of the same missing interval.
Available Tools
1 toolasset_twitsA
Return relevant MarketTwits messages, newest first.
Relevance is defined exclusively by the instrument-to-hashtag links in
instrument_hashtags.csv. An optional exchange prefix is discarded, and
SI1! is treated as USDRUB. Each returned message is formatted as
[22-Jul-26 19:27 UTC] message text.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Calendar days to look back | |
| datetime | No | ISO-8601 end time converted to UTC; a value without an offset is interpreted as UTC. Defaults to current UTC time | |
| instrument | Yes | Market instrument from instrument_hashtags.csv, optionally using EXCHANGE:SYMBOL. SI1! is treated as USDRUB |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full transparency burden. It discloses several behavioral traits: result ordering (newest first), output format (`[22-Jul-26 19:27 UTC] message text`), input normalization (exchange prefix discarded, SI1! treated as USDRUB), and the exact relevance mechanism. It does not mention authentication, rate limits, or error behavior, but for a read-style retrieval tool, this level of disclosure is solid.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is three compact sentences, each earning its place: the first states the core purpose and ordering, the second explains relevance and input edge cases, and the third gives the exact output format. There is no redundancy or fluff, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool with no output schema, the description provides an output format example and clearly defines relevance. The schema covers parameters comprehensively, and the description includes enough behavioral context for correct invocation. It could additionally mention result limits or error conditions, but given the tool's apparent simplicity, the existing description is largely complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides descriptions for all three parameters, covering defaults, ranges, and special cases (e.g., ISO-8601 datetime interpretation, SI1! mapping). The tool description does not add significant semantics beyond the schema; it repeats the exchange prefix and SI1! handling but offers no new insights into days or datetime meaning. Since schema coverage is 100%, the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description opens with 'Return relevant MarketTwits messages, newest first,' clearly stating the action and resource. It further defines 'relevant' explicitly, which distinguishes the tool's behavior from generic message lookups. The specificity of the relevance definition and output format makes the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There are no sibling tools, so no alternatives are mentioned. However, the description clearly states 'Relevance is defined exclusively by the instrument-to-hashtag links,' which signals when this tool is appropriate (when that specific relevance model is desired) and implies a limitation. It also notes edge cases like exchange prefix handling and SI1! mapping, but does not provide explicit when-to-use vs. when-not-to-use guidance beyond its inherent purpose.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
With only one tool, there is no possibility of confusing it with others. The purpose is clearly defined and unambiguous.
The single tool name 'asset_twits' is clear and descriptive. With only one tool, there is no inconsistency in naming patterns.
One tool feels thin for a server named 'MarketTwits MCP', which implies a broader scope. However, it could be appropriate if the intended use is narrowly focused on retrieving messages.
The tool covers only the retrieval of relevant messages. There are no tools for exploring assets, hashtags, or other common operations, leaving significant gaps in the surface.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
TradeOS MCP: ticker search, My Agent, chart TA, macro news. npm stdio or HTTP.
Query SEC EDGAR filings, XBRL financials, and company data through MCP. STDIO & Streamable HTTP.
MCP server for querying Forkast documentation
Read-only MCP server for The Quiet Protocol's engines, benchmarks, proof, and business data.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceSelf-hosted financial data terminal for AI agents. Scrapes and serves SEC filings (full-text search), 13F institutional holdings, insider and congressional trades, FINRA short data, FRED economic indicators, CFTC futures positioning, VIX/put-call ratios, and daily stock prices over MCP.204AGPL 3.0
- FlicenseNot gradedqualityBmaintenanceAn MCP server that connects to a Telegram group chat, persists messages to a local SQLite database, and exposes tools to search, retrieve, and send messages via SSE.
- AlicenseAqualityCmaintenanceA local MCP server that enables full-text and semantic search over your own Telegram chats using your personal MTProto login, with everything running locally.7MIT
- FlicenseNot gradedqualityBmaintenanceCaches Telegram channel posts locally in SQLite and exposes them via MCP tools for querying and management.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yar822/twits_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server