LLM Tool-Calling Assistant
Этот проект подключает локального LLM (например, Qwen) к таким инструментам, как калькулятор или база знаний, через протокол MCP . Помощник автоматически обнаруживает и вызывает эти инструменты, чтобы помочь ответить на запросы пользователя.
📦 Особенности
🔧 Выполнение инструмента через сервер MCP
🧠 Локальная интеграция LLM через HTTP или OpenAI SDK
📚 Поддержка базы знаний (
data.json)⚡ Поддерживает транспорты
stdioиsse
Related MCP server: MCP Server with Local LLM
🗂 Файлы проекта
Файл | Описание |
| Регистрирует инструменты и запускает сервер MCP |
| Использует |
| Использует совместимый с OpenAI SDK для LLM + логику вызова инструментов |
| Клиент MCP, использующий stdio |
| Клиент MCP с использованием SSE |
| База знаний вопросов и ответов |
📥 Установка
Требования
Питон 3.8+
Установить зависимости:
pip install -r requirements.txtrequirements.txt
aiohttp==3.11.18
nest_asyncio==1.6.0
python-dotenv==1.1.0
openai==1.77.0
mcp==1.6.0🚀 Начало работы
1. Запустите MCP-сервер
python server.pyЭто запустит ваш сервер инструментов с такими функциями, как add , multiply и get_knowledge_base .
2. Запустить клиент
Вариант A: HTTP-клиент (локальный LLM через необработанный API)
python client-http.pyВариант B: клиент OpenAI SDK
python client-openai.pyВариант C: стандартный транспорт
python client-stdio.pyВариант D: транспорт SSE
Убедитесь, что server.py устанавливает:
transport = "sse"Затем выполните:
python client-sse.py💬 Примеры подсказок
Вызов математического инструмента
What is 8 times 3?Ответ:
Eight times three is 24.Вопрос базы знаний
What are the healthcare benefits available to employees in Singapore?Ответ будет включать соответствующий ответ из data.json .
📁 Пример: data.json
[
{
"question": "What is Singapore's public holiday schedule?",
"answer": "Singapore observes several public holidays..."
},
{
"question": "How do I apply for permanent residency in Singapore?",
"answer": "Submit an online application via the ICA website..."
}
]🔧 Конфигурация
Внутри client-http.py или clientopenai.py обновите следующее:
LOCAL_LLM_URL = "..."
TOKEN = "your-api-token"
LOCAL_LLM_MODEL = "your-model"Убедитесь, что ваш LLM обслуживает конечные точки API, совместимые с OpenAI.
🧹 Уборка
Клиенты обрабатывают вызовы и ответы инструментов автоматически. Вы можете остановить сервер или клиента с помощью Ctrl+C .
🪪 Лицензия
Лицензия MIT. См. файл LICENSE .
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.
Related MCP Servers
- FlicenseCqualityCmaintenanceA 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.221
- Flicense-qualityDmaintenanceIntegrates local language models (like Qwen3-8B) with MCP clients, providing tools for chat, code analysis, text generation, translation, and content summarization using your own hardware.
- Alicense-qualityDmaintenanceAutomatically converts CLI tools, APIs, and programs into MCP servers for LLM and agentic use, enabling rapid integration without manual server implementation.1MIT
- Flicense-qualityCmaintenanceExposes MCP tools that enable remote LLMs to query local Docker containers, OS processes, and system services in real time.
Related MCP Connectors
Self-hosted MCP gateway: turn any API, database or MCP server into AI connectors — no code.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Appeared in Searches
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/o6-webwork/mcp-template'
If you have feedback or need assistance with the MCP directory API, please join our Discord server