Skip to main content
Glama

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)

ToolKhi nào dùngTham số (shape)
calc.evalcalc_evalTính toán cục bộ{ expr: string, precision?: number }
web.searchweb_searchTìm web đa engine{ q: string, max?: number, lang?: string, site?: string, engines?: string[], k?: number, limit?: number }
web.fetchweb_fetchTải 1 URL (HTML/binary){ url: string, timeout?: number, max_bytes?: number, headers?: Record<string,string> }
web.readweb_readTrích văn bản “đọc được”{ url: string, html?: string }
doc.finddoc_findTìm trong thư mục sandbox{ q: string, top?: number, limit?: number }
doc.readdoc_readĐọc 1 file trong sandbox{ path: string }
index.buildindex_buildBuild chỉ mục tài liệu{ root?: string }
sch.searchsch_searchTìm bài/paper/DOI{ q: string, top?: number, limit?: number }
sch.getsch_getLấy metadata paper{ doi?: string, arxivId?: string, url?: string }
wiki.searchwiki_searchTìm tiêu đề Wikipedia{ q: string, lang?: string }
wiki.getwiki_getLấ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

npm install npm run build npm start

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:

{ "mcpServers": { "TOOL4LM": { "command": "node", "args": ["--enable-source-maps", "C:/path/to/tool4lm/dist/server.js"], "type": "mcp", "env": { "SANDBOX_DIR": "C:/path/to/your_docs", "SEARXNG_ENDPOINTS": "https://searx.be/search,https://searx.tiekoetter.com/search", "ENGINE_ORDER": "searxng,duckduckgo", "LANG_DEFAULT": "vi", "REGION_DEFAULT": "vn", "MAX_FETCH_BYTES": "1048576", "FETCH_TIMEOUT_MS": "8000" } } } }

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ẫnweb.searchweb.fetchweb.read → tóm tắt + đính kèm URL.
Tài liệu nội bộdoc.finddoc.read → tóm tắt + trích đoạn (ghi kèm path).
Học thuậtsch.searchsch.get theo DOI/arXivId.
Tính toáncalc.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

MIT


☕ Ủ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:

Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

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.

  1. ✨ Tính năng
    1. 🧰 Tool & tham số (tên chính ⇄ alias gạch dưới)
      1. 🔧 Cài đặt & chạy
        1. ⚙️ Cấu hình MCP (LM Studio)
          1. 📝 Ví dụ luồng sử dụng
            1. 🌍 Biến môi trường
              1. 🤝 Đóng góp
                1. 📜 Giấy phép
                  1. ☕ Ủng hộ

                    Related MCP Servers

                    • A
                      security
                      F
                      license
                      A
                      quality
                      An 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 -
                      1
                      2
                      Python
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A 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 -
                      1
                      Python
                      • Linux
                      • Apple
                    • A
                      security
                      F
                      license
                      A
                      quality
                      A lightweight MCP server that provides a unified interface to various LLM providers including OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama.
                      Last updated -
                      6
                      593
                      Python
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A 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 -
                      6
                      TypeScript
                      • Apple
                      • Linux

                    View all related MCP servers

                    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/khanhs-234/tool4lm'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server