TOOL4LM is a versatile MCP server that enhances local or remote Large Language Models with a comprehensive suite of utility tools:
- Mathematical Computing: Evaluate mathematical expressions with adjustable precision using
calc.eval
- Multi-Engine Web Search: Conduct searches across multiple engines like SearXNG and DuckDuckGo with
web.search
- Web Content Access: Fetch web pages securely with size/time limits (
web.fetch
) and extract readable content from HTML (web.read
) - Local Document Management: Search within sandboxed directories (
doc.find
), read various file formats including text, markdown, HTML, and PDF (doc.read
), and build/manage search indexes (index.build
) - Academic Research: Search scholarly papers on platforms like arXiv and Crossref (
sch.search
), retrieve detailed metadata using DOIs or arXiv IDs (sch.get
) - Wikipedia Integration: Search Wikipedia titles (
wiki.search
) and retrieve article summaries (wiki.get
)
All tools support both dot notation and underscore aliases (e.g., calc.eval
or calc_eval
) for flexible integration.
Enables searching and retrieving academic papers and metadata from arXiv preprint repository
Provides access to academic paper metadata and information through DOI (Digital Object Identifier) lookups via Crossref
Enables web search functionality through DuckDuckGo's search engine with support for deduplication and result filtering
Provides web search capabilities through SearXNG metasearch engine instances with configurable endpoints
Allows searching Wikipedia articles and retrieving article summaries with multi-language support
TOOL4LM — Multi-Tool MCP Server for Local LMs
All-in-one tools to supercharge your local or remote LLMs.
Search smarter. Calculate faster. Summarize better.
TOOL4LM là một MCP (Model Context Protocol) server viết bằng Node.js/TypeScript giúp bổ sung công cụ cho các mô hình ngôn ngữ chạy cục bộ (LM Studio/Ollama/…): web search, đọc & tóm tắt trang, tìm & đọc tài liệu nội bộ, tra cứu học thuật, và máy tính. Không cần API key mặc định.
✨ Tính năng
- 🔎 Web Search: tìm nhiều nguồn (SearXNG + DuckDuckGo HTML), khử trùng lặp, trả về tiêu đề + URL + snippet.
- 🌐 Web Fetch/Read: tải trang có giới hạn kích thước/thời gian (chống SSRF) và trích văn bản “đọc được” để tóm tắt.
- 📂 Doc Search/Read: tìm & đọc tài liệu trong thư mục sandbox (txt/md/html/pdf). PDF dùng
pdf-parse
(lazy-load). - 📚 Scholar Search/Get: tra cứu học thuật (arXiv + Crossref + Wikipedia) và lấy metadata theo DOI/arXivId.
- 🧮 Calculator: đánh giá biểu thức với
mathjs
, hỗ trợprecision
(làm tròn).
🧰 Tool & tham số (tên chính ⇄ alias gạch dưới)
Tool | Khi nào dùng | Tham số (shape) |
---|---|---|
calc.eval ⇄ calc_eval | Tính toán cục bộ | { expr: string, precision?: number } |
web.search ⇄ web_search | Tìm web đa engine | { q: string, max?: number, lang?: string, site?: string, engines?: string[], k?: number, limit?: number } |
web.fetch ⇄ web_fetch | Tải 1 URL (HTML/binary) | { url: string, timeout?: number, max_bytes?: number, headers?: Record<string,string> } |
web.read ⇄ web_read | Trích văn bản “đọc được” | { url: string, html?: string } |
doc.find ⇄ doc_find | Tìm trong thư mục sandbox | { q: string, top?: number, limit?: number } |
doc.read ⇄ doc_read | Đọc 1 file trong sandbox | { path: string } |
index.build ⇄ index_build | Build chỉ mục tài liệu | { root?: string } |
sch.search ⇄ sch_search | Tìm bài/paper/DOI | { q: string, top?: number, limit?: number } |
sch.get ⇄ sch_get | Lấy metadata paper | { doi?: string, arxivId?: string, url?: string } |
wiki.search ⇄ wiki_search | Tìm tiêu đề Wikipedia | { q: string, lang?: string } |
wiki.get ⇄ wiki_get | Lấy summary Wikipedia | { title: string, lang?: string } |
Đã bật
openWorldHint
nên nếu model lỡ thêm field lạ host vẫn chấp nhận; nhưng khuyến nghị dùng đúng tham số như bảng để ổn định.
🔧 Cài đặt & chạy
Khi chạy thành công sẽ in:[TOOL4LM] started. Sandbox: <đường_dẫn_sandbox>
⚙️ Cấu hình MCP (LM Studio)
Thêm vào mcp.json
của LM Studio:
Trên Windows, nên dùng
/
trong JSON để tránh escape\
.
📝 Ví dụ luồng sử dụng
Tra cứu web có trích dẫn → web.search
→ web.fetch
→ web.read
→ tóm tắt + đính kèm URL.
Tài liệu nội bộ → doc.find
→ doc.read
→ tóm tắt + trích đoạn (ghi kèm path
).
Học thuật → sch.search
→ sch.get
theo DOI/arXivId.
Tính toán → calc.eval
với ^
/pow(a,b)
(hoặc đã normalize **
).
🌍 Biến môi trường
SANDBOX_DIR
— thư mục tài liệu (mặc định:./sandbox
).SEARXNG_ENDPOINTS
— danh sách endpoint/search
của SearXNG, cách nhau dấu phẩy.ENGINE_ORDER
— ví dụsearxng,duckduckgo
.LANG_DEFAULT
,REGION_DEFAULT
— gợi ý ngôn ngữ/khu vực khi tìm web.MAX_FETCH_BYTES
— giới hạn dung lượng tải trang.FETCH_TIMEOUT_MS
— timeout tải trang (ms).
🤝 Đóng góp
Issues/PRs rất hoan nghênh! Nếu thấy bug/đề xuất, mở issue giúp mình nhé.
📜 Giấy phép
☕ Ủng hộ
Nếu bạn thấy dự án hữu ích, có thể ủng hộ mình qua PayPal:
hoặc bấm nút bên dưới:
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A multi-tool MCP server that enhances local LLMs with web search, document reading, scholarly research, Wikipedia access, and calculator functions. Provides comprehensive tools for information retrieval and computation without requiring API keys by default.
Related MCP Servers
- AsecurityFlicenseAqualityAn MCP server that fetches real-time documentation for popular libraries like Langchain, Llama-Index, MCP, and OpenAI, allowing LLMs to access updated library information beyond their knowledge cut-off dates.Last updated -12Python
- -securityFlicense-qualityA customized MCP server that enables integration between LLM applications and documentation sources, providing AI-assisted access to LangGraph and Model Context Protocol documentation.Last updated -1Python
- AsecurityFlicenseAqualityA lightweight MCP server that provides a unified interface to various LLM providers including OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama.Last updated -6593Python
- -securityFlicense-qualityA lightweight MCP server that enables LLMs to search the web via DuckDuckGo, search GitHub code repositories, and extract clean content from web pages in LLM-friendly formats.Last updated -6TypeScript