Go MCP server demo with local LLM tool calling

Go MCP server demo with local LLM tool calling

go-mcp-demo•bypatrick7241

A demonstration project pairing an MCP Server and Client, using a local Ollama model to invoke tools through natural language.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Provides an MCP Server plus Client communication framework.
  • •The MCP server registers a read_file tool that reads a specified .sql file.
  • •The MCP server registers a query_db tool that runs arbitrary SQL and returns results.
  • •Uses a local Ollama model, by default on port 11434, for reasoning.

BEST FOR

  • •Executing natural-language requests to read .sql files through an MCP server.
  • •Running MySQL queries via natural-language instructions.

ABOUT GO-MCP-DEMO

Go MCP server demo with local LLM tool calling is cataloged as an MCP server attributed to patrick7241. A demonstration project pairing an MCP Server and Client, using a local Ollama model to invoke tools through natural language. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Go MCP server demo with local LLM tool calling are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What is the default port of the MCP server?

The MCP server listens by default on port 2002.

Which model does the demo use by default?

The example uses the qwen2:1.5b model pulled and run through Ollama.

上游原版 README

在 GitHub 查看同一版本原文

README.md · c19b9a083f88 · 采集于 2026-11-13 10:35:33 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

go-mcp-demo

本项目基于 mark3labs/mcp-go 实现了一个 MCP Server 与 MCP Client 通信的演示,结合 Ollama 启动本地大语言模型,实现自然语言调用工具的能力。

b站演示视频

✨ 功能概览

  • 集成 MCP Server + Client 通信框架
  • 支持基于自然语言执行:
    • 读取本地 .sql 文件
    • 执行任意 MySQL 查询
  • 使用 Ollama 本地大模型进行推理(默认端口:http://localhost:11434)

🚀 快速开始

1. 安装 Ollama

请参考官网:https://ollama.com
根据操作系统下载安装 Ollama CLI 工具。


2. 拉取并运行模型

在命令行中执行以下命令,拉取你需要的模型(示例使用 qwen2:1.5b):

ollama pull qwen2:1.5b
ollama run qwen2:1.5b

模型将监听本地端口:http://localhost:11434/api/generate


3. 修改配置文件

打开并编辑 pkg/config/config.yml:

ollama:
  model: qwen2:1.5b

mysql:
  host: localhost
  port: 3306
  user: root
  password: your_password
  database: your_database

sql:
  sqlFilePath: E:/your/path/to/test.sql

✅ 注意事项:

  • model 名称需与 ollama pull 和 ollama run 保持一致
  • mysql 信息替换为你本地或远程数据库连接参数
  • sqlFilePath 设置为你希望读取的 .sql 文件绝对路径

4. 启动主服务(Client)

进入主服务目录并运行:

cd cmd/server
go run main.go

默认监听地址:http://localhost:2001


5. 启动 MCP 服务(Server)

在新终端中启动 MCP 服务:

cd cmd/mcp-server
go run main.go

默认监听地址:http://localhost:2002 服务将自动注册以下工具:

  • read_file: 读取指定的 .sql 文件内容
  • query_db: 执行任意 SQL 并返回查询结果

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Go MCP server demo with local LLM tool calling from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/go-mcp-demo)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools