mcpField
L
llm-mcp-server-template

llm-mcp-server-template

Local
github.com/coderzzyAI & Agents1Updated 79w ago

About llm-mcp-server-template

A template project for developing LLM-MCP servers, with a server example for comparing numbers and a client example for model calls. It also documents MCP server and client roles, debugging, and possible development paths.

Key features

  1. 01Number comparison server example
  2. 02Client examples for model calls
  3. 03MCP server and client guidance
  4. 04Inspector-based server debugging

Use cases

  1. 01Prototyping an MCP server
  2. 02Trying model calls through an MCP client
  3. 03Exploring MCP debugging and client approaches

MCP support

The project provides an MCP server example and client examples for model calls. It describes using mcp-server-inspector to debug the server.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

llm-mcp-server-template

LLM-MCP server 开发的模版项目

  • server为数字比大小能力
  • client为各模型、各种调用方式

MCP

  • https://modelcontextprotocol.io/introduction
  • 简单理解,
    • 模型(client)是大脑,负责规划和执行文本类任务,如第一步写代码,第二步执行,第三步分析。
    • MCP(Server)是工具,负责提供模型需要的其他能力,如数学计算、文件读写、网络请求等。
MCP-Server
  • 主要负责实现mcp能力,如数学计算、文件读写、网络请求等
  • https://modelcontextprotocol.io/quickstart/server
  • 开发过程中,可以使用 mcp-server-inspector 工具协助调试
  • 几种类型的server:
    • 1、本地Stdio,client直接调用本地的server文件(python or nodejs)
      • plus: 把node项目推远程npm仓库,npx运行,实现半远程调用的效果
    • 2、远程聚合平台SSE,如Glama.ai、MCP.so等
MCP-Client
  • 主要负责协调模型和mcp-server,最终实现"模型调用了mcp能力"
  • 几种类型的client:
    • 1、直接用现成的客户端软件,如Cursor、MCP Inspector等。
    • 2、云平台上的各种智能体agent,如阿里云百炼应用管理。
    • 3、自己写脚本支持

项目相关

环境准备
# 安装 uv 包管理工具,若已有,则跳过
curl -LsSf https://astral.sh/uv/install.sh | sh
source ~/.local/bin/env
uv --version

# 安装python3.10,若已有,则跳过
uv python list
uv python install 3.10

cd server
# server 目录,创建虚拟环境, 若已有,则跳过
uv venv --python 3.10
source .venv/bin/activate
uv add "mcp[cli]" httpx

# server目录,开发的时候用mcp-server-inspect调试
mcp dev math.py

cd client
# client 目录,创建虚拟环境, 若已有,则跳过
uv venv --python 3.10
source .venv/bin/activate
uv add openai openai-agents socksio
touch .env  # 在.env文件中,设置OPENAI_API_KEY等

# client 目录,正常运行
source .venv/bin/activate
python openai_client.py
项目结果

MCP Server,mcp-server-inspect调试页面: mcp-server-inspect

MCP Client,不使用mcp和使用mcp的对比:

  • 命令行调用结果: openai_client_result1
  • openai的dashboard上的log记录, mcp确实是两次调用: openai_client_result2

TODO

1、 mcp-server,本地开发和调试
2、mcp-server,发布远程托管平台
3、mcp-client,使用openai-agent-sdk调用server
4、mcp-client,使用anthropic-sdk调用本地server
5、mcp-client,使用原生的写法(参考https://deepseek.csdn.net/67e383ff45a25f3de59f7bb0.html)调用本地server 6、mcp-client,使用langchain-mcp-adapter调用server
7、固定功能的 mcp-client + mcp-server,使用electron封装成桌面应用

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.