Token导航 LogoToken导航TokenDH.com
Generate Chart App logo
AI代理未说明官方级别未说明来源级核验

Generate Chart App

MCP Server

一个使用MCP和LLM技术生成图表的示例项目,结合LangChain和MCP-ECharts实现图表渲染。

工具数

1

提示词数

0

GitHub Stars

0

资源数

0
图表生成数据可视化TypeScript模型集成本地部署

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

fankangsong

提供方

fankangsong

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

一个 mcp + llm 生成 chart 的示例项目 An example project for generating charts using MCP + LLM

概览

这是一个 langchain + mcp-echarts 的示例项目,其中使用 langchina 生态工具来编写核心的代码,使用 nuxt 来作为接口和视图开发的框架,外部依赖 mpc-echarts 来渲染图表,大模型根据提问来生成 mcp 参数,最终通过 mcp-echarts 生成图表到前端页面渲染;

mcp-echarts 启动

mcp-echarts 是一个 MCP 服务,启动方式:

# 全局安装
pnpm i -g mcp-echarts

# 启动
mcp-echarts -t sse

访问 http://localhost:3033/heath

返回如下内容启动成功:

{
  "status": "healthy",
  "service": "mcp-echarts"
}

大模型接口

验证你的 LLM 模型是否支持 function call,可以运行下面的命令:

curl --location --request POST 'http://127.0.0.1/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data-raw '{
  "model": "gpt-4o-mini",
  "messages": [
    {
      "role": "user",
      "content": "北京的天气如何"
    }
  ],
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "get_weather",
        "description": "获取天气",
        "parameters": {
          "type": "object",
          "properties": {
            "city": { "type": "string" }
          },
          "required": ["city"]
        }
      }
    }
  ]
}'

如果返回内容包含 choices 字段,说明支持 function call:

{
  "id": "chatcmpl-66aa9fc8-1d7f-46cc-b1c2-2b5a466d7bb0",
  "object": "chat.completion",
  "created": 1761296168,
  "model": "qwen3-coder-30b-a3b-instruct-fp8",
  "choices": [
    {
      "index": 0,
      "message": {
        "role": "assistant",
        "content": null,
        "refusal": null,
        "annotations": null,
        "audio": null,
        "function_call": null,
        "tool_calls": [
          {
            "id": "chatcmpl-tool-c4e0efe92fff4ddaabb0e60f41d6c99c",
            "type": "function",
            "function": {
              "name": "get_weather",
              "arguments": "{\"city\": \"北京\"}"
            }
          }
        ],
        "reasoning_content": null
      },
      "logprobs": null,
      "finish_reason": "tool_calls",
      "stop_reason": null
    }
  ],
  "service_tier": null,
  "system_fingerprint": null,
  "usage": {
    "prompt_tokens": 274,
    "total_tokens": 296,
    "completion_tokens": 22,
    "prompt_tokens_details": null
  },
  "prompt_logprobs": null,
  "kv_transfer_params": null
}

启动项目

  1. 参考 .env.example 创建 .env 文件
  2. 安装依赖:pnpm install
  3. 启动项目:pnpm dev

目录标签

目录标签

图表生成数据可视化TypeScript模型集成本地部署MCP服务LLM集成

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

none

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明none部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP