Related MCP Server Resources

Explore more AI models, providers, and integration options:

  • Explore AI Models
  • Explore AI Providers
  • Explore MCP Servers
  • LangDB Pricing
  • Documentation
  • AI Industry Blog
  • Ollama MCP Database Assistant
  • Readwise MCP
  • MCP Model Context Protocol Server
  • Kubectl MCP Tool
  • IR Toolshed MCP Server
Back to MCP Servers
LLM Tool-Calling Assistant

LLM Tool-Calling Assistant

Public
o6-webwork/mcp-template

Connects local LLMs to external tools (calculator, knowledge base) via MCP protocol, enabling automatic tool detection and execution to enhance query responses.

Verified
python
0 tools
May 30, 2025
Updated May 30, 2025

๐Ÿง  LLM Tool-Calling Assistant with MCP Integration

Connect your local LLM to real-world tools, knowledge bases, and APIs via MCP.

This project connects a local LLM (e.g. Qwen) to tools such as a calculator or a knowledge base via the MCP protocol. The assistant automatically detects and calls these tools to help answer user queries.


๐Ÿ“ฆ Features

  • ๐Ÿ”ง Tool execution through MCP server
  • ๐Ÿง  Local LLM integration via HTTP or OpenAI SDK
  • ๐Ÿ“š Knowledge base support (data.json)
  • โšก Supports stdio and sse transports

๐Ÿ—‚ Project Files

FileDescription
server.pyRegisters tools and starts MCP server
client-http.pyUses aiohttp to communicate with local LLM
clientopenai.pyUses OpenAI-compatible SDK for LLM + tool call logic
client-stdio.pyMCP client using stdio
client-see.pyMCP client using SSE
data.jsonQ&A knowledge base

๐Ÿ“ฅ Installation

Requirements

Python 3.8+

Install dependencies:

pip install -r requirements.txt

requirements.txt

aiohttp==3.11.18
nest_asyncio==1.6.0
python-dotenv==1.1.0
openai==1.77.0
mcp==1.6.0

๐Ÿš€ Getting Started

1. Run the MCP server

python server.py

This launches your tool server with functions like add, multiply, and get_knowledge_base.

2. Start a client

Option A: HTTP client (local LLM via raw API)

python client-http.py

Option B: OpenAI SDK client

python client-openai.py

Option C: stdio transport

python client-stdio.py

Option D: SSE transport

Make sure server.py sets:

transport = "sse"

Then run:

python client-sse.py

๐Ÿ’ฌ Example Prompts

Math Tool Call

What is 8 times 3?

Response:

Eight times three is 24.

Knowledge Base Question

What are the healthcare benefits available to employees in Singapore?

Response will include the relevant answer from data.json.


๐Ÿ“ Example: 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..." } ]

๐Ÿ”ง Configuration

Inside client-http.py or clientopenai.py, update the following:

LOCAL_LLM_URL = "..." TOKEN = "your-api-token" LOCAL_LLM_MODEL = "your-model"

Make sure your LLM is serving OpenAI-compatible API endpoints.


๐Ÿงน Cleanup

Clients handle tool calls and responses automatically. You can stop the server or client using Ctrl+C.


๐Ÿชช License

MIT License. See LICENSE file.

Publicly Shared Threads0

Discover shared experiences

Shared threads will appear here, showcasing real-world applications and insights from the community. Check back soon for updates!

Share your threads to help others
Related MCPs5
  • Ollama MCP Database Assistant
    Ollama MCP Database Assistant

    An interactive chat interface that combines Ollama's LLM capabilities with PostgreSQL database acces...

    Added May 30, 2025
  • Readwise MCP
    Readwise MCP

    A local Model Context Protocol server that connects LLM clients (like Claude) to Readwise, enabling ...

    1 tools
    Added May 30, 2025
  • MCP Model Context Protocol Server
    MCP Model Context Protocol Server

    A server implementation demonstrating how AI models can interact with external tools and services th...

    Added May 30, 2025
  • Kubectl MCP Tool
    Kubectl MCP Tool

    A Model Context Protocol server that enables AI assistants to interact with Kubernetes clusters thro...

    Added May 30, 2025
  • IR Toolshed MCP Server
    IR Toolshed MCP Server

    A Model Context Protocol server that provides network analysis tools for security professionals, ena...

    Added May 30, 2025