telebotstudio-mcp
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., "@telebotstudio-mcpsearch how to send a message with inline keyboard"
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.
TeleBot Studio MCP
Eliminate AI hallucinations. Ground your assistant in official TeleBot Studio documentation.
A production-ready Model Context Protocol (MCP) server indexing official documentation chunks via deterministic BM25 ranking. Zero embeddings. Zero external APIs.
Quick Start · Configuration · Architecture · Performance · Development
Why This Exists
Large Language Models are powerful, but they hallucinate API specifics. When you ask an LLM how to use TeleBot Studio, it guesses based on outdated training data or conflates it with similar libraries. This causes documentation drift—the gap between what the AI says and what the official docs actually specify.
The Model Context Protocol (MCP) fixes this by allowing AI assistants to dynamically query external tools at runtime.
TeleBot Studio MCP acts as a strict, deterministic gateway to the official TeleBot Studio markdown files. If the answer isn't in the official documentation, the server returns nothing. The AI stops guessing, and you stop debugging phantom functions.
Related MCP server: RAG Documentation MCP Server
Demo
Example: Terminal Execution
$ python server.py --transport http --port 9000
> TODO: Add actual terminal output after first run.Example: MCP Tool Call
{
"tool": "search_docs",
"arguments": {
"query": "how to send a message with inline keyboard"
}
}Expected Output
{
"results": [
{
"score": 14.321,
"source": "sending-messages.md",
"heading": "### Sending Messages with Inline Keyboards",
"content": "To send a message with an inline keyboard, pass an `InlineKeyboardMarkup` object to the `reply_markup` argument in `bot.send_message()`..."
}
]
}Screenshots
TODO: Replace placeholders with actual project screenshots.
GitHub Preview | MCP Inspector |
Claude Desktop | Cursor |
HTTP Mode Terminal | Search Results UI |
Comparison: Us vs. The Rest
Metric | Normal LLM | Generic RAG | Embedding Search | Vector DB (FAISS/Pinecone) | TeleBot Studio MCP |
Speed | Slow (Generation) | Medium | Slow (Embedding calc) | Medium (Network/Disk IO) | Fast (In-memory) |
Offline Capable | Yes | Rarely | No (Local models) | Yes (FAISS) / No (Pinecone) | 100% Offline |
Accuracy (Exact Match) | Low | Medium | Low (Semantic drift) | Low | High (Lexical BM25) |
Cost | High (Tokens) | High | High (OpenAI API) | Medium / High | $0.00 |
Setup Time | 0 mins | Hours | Hours | Days | Minutes |
Maintenance | N/A | High (Chunking drift) | High (Model updates) | High (Infra management) | Low (Update docs folder) |
Performance & Benchmarks
Benchmark results will be added after performance testing.
Why BM25 is enough: Vector databases shine across millions of documents with vague semantic queries. For a highly-technical API documentation corpus, developers search for exact function names, exact error codes, and specific class properties. BM25 mathematically outperforms semantic embeddings for exact-lexicon matching at this scale without the computational overhead.
Architecture & How It Works
System Architecture
graph TD
subgraph Data["Source Data"]
D[Official .md Docs]
end
subgraph Pipeline["In-Memory Pipeline"]
L[Markdown Loader] --> C[Heading-Aware Chunker]
C --> I[BM25 Indexer]
end
subgraph Server["FastMCP Server"]
T1[search_docs]
T2[get_page]
T3[search_api]
T4[search_errors]
end
subgraph Transport["Transport Layer"]
STD[STDIO]
HTTP[HTTP / Streamable HTTP]
end
subgraph Clients["MCP Clients"]
Claude[Claude Desktop]
Cur[Cursor]
Wind[Windsurf]
Other[OpenHands / Cline / Continue]
end
D --> L
I --> T1
I --> T2
I --> T3
I --> T4
T1 --> STD
T2 --> STD
T3 --> HTTP
T4 --> HTTP
STD --> Claude
STD --> Cur
HTTP --> Wind
HTTP --> Other
style Data fill:#f9f9f9,stroke:#333,stroke-width:2px
style Pipeline fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
style Server fill:#f3e5f5,stroke:#8e24aa,stroke-width:2px
style Transport fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
style Clients fill:#fff3e0,stroke:#ef6c00,stroke-width:2pxRequest Sequence Diagram
sequenceDiagram
participant U as User / AI Assistant
participant M as FastMCP Server
participant B as BM25 Engine
participant C as Doc Chunks (Memory)
U->>M: Invoke tool: search_docs("handle callback_query")
M->>B: Execute BM25 rank query
B->>C: Scan chunks (Term Frequency / Inverse Doc Freq)
C-->>B: Return scored matches
B-->>M: Top results with scores
M-->>U: Formatted MCP Tool Response
Note over U: LLM uses chunks as strict context.<br>No hallucinations allowed.✨ Features
Category | Capabilities |
📄 Parsing | Markdown documentation loader, Heading-aware chunking ( |
🔍 Search | BM25 search engine ( |
⚡ Server | Built on FastMCP, Native STDIO support, HTTP support, Streamable HTTP support. |
🔒 Privacy | Official documentation only, No embeddings generated, No vector database, No OpenAI API required. |
🏗️ Architecture | Production-ready, Zero cold-start latency, Single-file deployment capable. |
🛠️ MCP Tools
This server exposes 8 specialized tools, intentionally split to allow AI agents to target specific documentation areas:
Tool Name | Description |
| The primary tool. Full-text BM25 search across all chunks. Returns top ranked results. |
| Retrieves the full, unchunked content of a specific documentation page by its exact filename. |
| Returns a complete list of all available documentation pages, filenames, and titles. |
| Scoped search targeting exclusively code examples and usage snippets. |
| Scoped search restricted to API references, endpoints, and configuration parameters. |
| Searches for library installations, imports, and third-party dependency information. |
| Targets specific function definitions, signatures, and method explanations. |
| Searches for error codes, exception handling, troubleshooting guides, and common pitfalls. |
📁 Project Structure
telebotstudio-mcp/
├── docs/ # The official TeleBot Studio .md documentation files
├── loader.py # Markdown loader and heading-aware chunking logic
├── search.py # BM25 index builder and search execution engine
├── server.py # FastMCP server initialization, routing, and tool definitions
├── crawler.py # (Utility) Web crawler for fetching fresh documentation
├── download_docs.py # (Utility) Script to download and save docs to the /docs folder
├── requirements.txt # Python dependencies (rank-bm25, fastmcp, etc.)
├── README.md # You are here
└── .gitignore # Git ignore rules (venv, __pycache__, etc.)docs/: Contains the raw.mdfiles. This is the single source of truth for the knowledge base.loader.py: Reads the markdown files and splits them into chunks based on headings (#,##,###). This ensures context is never arbitrarily broken in the middle of a thought.search.py: Takes the chunks fromloader.py, tokenizes them, builds the BM25 index in memory, and exposes the search functions.server.py: The entry point. Wraps the search functions into MCP Tools using FastMCP and handles STDIO/HTTP transport.crawler.py: A helper script used during development to scrape the official TeleBot Studio website.download_docs.py: Automates the process of running the crawler and saving the output into thedocs/directory.
📥 Installation
Prerequisites
Python 3.9 or higher
pip(Python package manager)
1. Clone the Repository
git clone https://github.com/harshi79/telebotstudio-mcp.git
cd telebotstudio-mcp2. Create a Virtual Environment
Windows (PowerShell):
python -m venv venv
.\venv\Scripts\Activate.ps1macOS / Linux:
python3 -m venv venv
source venv/bin/activate3. Install Dependencies
TODO: Populate requirements.txt before first release.
⚙️ Configuration
Local Usage (STDIO & HTTP)
STDIO mode (Default for Claude, Cursor, etc.):
python server.pyHTTP mode (For remote clients or web dashboards):
python server.py --transport httpCustom Host & Port:
python server.py --transport http --host 0.0.0.0 --port 9000Claude Desktop
Open Claude Desktop Settings -> Developer -> Edit Config. Add the following JSON:
{
"mcpServers": {
"telebotstudio-docs": {
"command": "python",
"args": [
"C:\\ABSOLUTE\\PATH\\TO\\telebotstudio-mcp\\server.py"
]
}
}
}⚠️ Note for Windows users: You must use the absolute path to
server.pyand ensure it points to the Python executable inside your virtual environment if necessary (e.g.,C:\\...\\venv\\Scripts\\python.exe).
Cursor
Open Cursor Settings -> MCP -> Add new MCP server.
Set the type to STDIO.
Set the command to
pythonand the arguments to the absolute path of yourserver.pyfile.
Windsurf
Open Windsurf Settings -> Features -> Model Context Protocol.
Click "Add Server".
Provide the name
telebotstudio-docs, set the command topython, and add the absolute path toserver.pyas the argument.
Continue (.continuerc.json)
{
"experimental": {
"mcp": {
"servers": {
"telebotstudio-docs": {
"command": "python",
"args": ["/ABSOLUTE/PATH/TO/telebotstudio-mcp/server.py"]
}
}
}
}
}Cline
Open Cline in VS Code.
Open the MCP Settings panel.
Add a new STDIO server with
pythonas the command and the path toserver.pyas the argument.
OpenHands
In your OpenHands configuration, add the MCP server to the runtime environment variables or mount the directory and execute via standard terminal commands.
Docker
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["python", "server.py", "--transport", "http", "--host", "0.0.0.0", "--port", "9000"]Render.com (Deployable HTTP)
Create a new Web Service on Render.
Connect your GitHub repository.
Set the Build Command:
pip install -r requirements.txtSet the Start Command:
python server.py --transport http --port $PORTRender will automatically assign the
$PORTvariable.
🧪 Testing with MCP Inspector
The MCP Inspector is an official tool to test and debug MCP servers visually.
Start your server in HTTP mode:
python server.py --transport http --port 9000Run the MCP Inspector via npx:
npx @modelcontextprotocol/inspectorIn the Inspector UI, connect to
http://localhost:9000/mcp.
🛡️ Security & Privacy
This project is built with a strict Privacy-First architecture:
🔒 No Telemetry: Zero analytics, tracking, or phone-home mechanisms.
☁️ No Cloud Dependencies: Does not reach out to the internet at runtime.
🔑 No API Keys Required: Runs entirely without OpenAI, Anthropic, or third-party keys.
📴 Offline Capable: Once installed, disconnect from the internet and it works flawlessly.
🧠 No Data Leakage: Your queries and codebase context never leave your local machine.
🧐 Design Decisions
For a small-to-medium, highly-technical documentation corpus, introducing a vector database (Pinecone, Chroma, Qdrant) or an embedding model (OpenAI text-embedding-3-small) is massive overengineering that introduces unnecessary friction:
Latency: Generating embeddings requires an API call (OpenAI) or GPU inference (local models). BM25 searches the index in memory almost instantly.
Cost: OpenAI embeddings cost money. BM25 costs $0.00.
Privacy: Embedding APIs require sending your documentation to third parties. BM25 runs 100% locally and offline.
Dependencies: Vector DBs require running separate services (Docker containers, background processes). BM25 requires only the
rank-bm25Python package.Accuracy: For technical documentation, users search for exact function names, error codes, and specific class names (e.g.,
TeleBot.send_message). Lexical search (BM25) mathematically outperforms semantic search for exact-match queries.
Conclusion: BM25 is the mathematically optimal choice for small-to-medium, highly-technical documentation corpora.
❓ Frequently Asked Questions
🛠️ Development Guide
Want to hack on this project? Here is how it works under the hood.
How Chunking Works
We do not use arbitrary character counts (e.g., "split every 500 tokens"). Arbitrary splits destroy context. Instead, loader.py parses the AST of the Markdown file and splits exclusively on headings (#, ##, ###). This guarantees every chunk contains a complete, self-contained thought or API definition.
How Search Works
Chunks are tokenized into lowercase unigrams and bigrams.
rank-bm25calculates Term Frequency (how often a word appears in a chunk) and Inverse Document Frequency (how rare the word is across all chunks).When queried, scores are summed and sorted descending.
How to Add Docs
Delete the contents of
/docs.Add your new
.mdfiles.Restart the server. The index rebuilds automatically on boot.
How to Add Tools
Open
server.py.Define a new Python function.
Use the
@mcp.tool()decorator from FastMCP.Call the necessary functions from
search.py.
Coding Style
We enforce standard PEP 8. Type hinting is preferred but not strictly enforced for scripts. Keep functions pure where possible.
🗺️ Roadmap
Current (v0.1)
Core BM25 search engine integration
FastMCP server implementation
STDIO transport
HTTP / Streamable HTTP transport
Heading-aware markdown chunking
8 specialized documentation tools
Upcoming
Exact phrase match boosting (
"exact phrase")Heading hierarchy boosting (H1 matches rank higher than H3)
Filename/Source path boosting
LRU caching for repeated identical queries
Future
Docker Compose setup for isolated deployment
GitHub Actions CI/CD pipeline
Pytest unit and integration test suite
1-Click Render/Railway deployment templates
Long-term Vision
Abstract into a Generic Documentation MCP Framework (CLI tool to point at any repo/docs folder and generate an MCP server instantly).
📝 Changelog
v0.1.0 (Current)
Initial release.
Official markdown documentation parsed into heading-aware searchable chunks.
8 highly-targeted MCP tools exposed.
Support for STDIO and HTTP FastMCP transports.
🤝 Contributing
We love our contributors! This is an open-source project built for the community.
graph LR
F[Fork Repo] --> B[Create Feature Branch]
B --> C[Write Code & Tests]
C --> P[Push to Fork]
P --> R[Open Pull Request]
R --> M[Code Review & Merge]
style F fill:#f1f8e9,stroke:#4caf50,stroke-width:2px
style M fill:#e3f2fd,stroke:#2196f3,stroke-width:2pxFork the repository.
Create a feature branch (
git checkout -b feature/amazing-search-feature).Ensure your code passes basic linting.
Write a clear, descriptive commit message.
Open a Pull Request against the
mainbranch.
🙏 Credits
This project stands on the shoulders of open-source giants:
FastMCP - The incredible Python framework that makes building MCP servers trivial.
rank-bm25 - A pure Python implementation of BM25.
TeleBot Studio Documentation - The official documentation team for maintaining the source of truth.
Model Context Protocol - Anthropic's groundbreaking standard for AI tool integration.
📈 Star History
📄 License
TODO: Add LICENSE file.
Made with ❤️ by the yorifedeation. Grounding AI in reality, one chunk at a time.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/harshi79/telebotstudio-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server