Token导航 LogoToken导航TokenDH.com
Hf MCP Summarize logo
运维云端stdio官方级别未说明来源级核验

Hf MCP Summarize

MCP Server

基于FastAPI和FastMCP的文本摘要服务,用于快速生成给定文本的摘要。

工具数

2

提示词数

0

GitHub Stars

0

资源数

0
FastMCPPythonHTTP服务FastAPI

安装说明

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

作者 / 组织

highfeature

提供方

highfeature

最后核验

2026/5/17 20:21

运行时

Python

快速接入

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

命令预览

uv run uvicorn src.main:app --reload --port=19140 --log-level debug

详细介绍

📚 流式HTTP FastAPI/FastMCP摘要生成器代理版本0.5(请参阅发行说明.md)

基于原件:https://github.com/open-webui/openapi-servers/tree/main/servers/summarizer-tool(FastMCP stdio)特别感谢他们。

我为什么要创建这个应用程序?

我正在为我的实验室寻找一个骨架模型,它可以包含全套:

  • 我在其他应用程序中使用的FastAPI函数
  • FastMCP为我的所有工具、提示、资源等提供服务
  • 一切记录在案,易于维护
  • 所有这些都在一个Docker容器中,我可以在需要时弹出

(减少descktop/server上使用的内存、端口等的数量)

此FastAPI/FastMCP服务器用于汇总给定的文本块。

假设您正在使用默认端口在相邻容器中运行一个ollama实例。

运行方式:

(hf-mcp-summarize) $ uvicorn main:app --reload --port=19140

将其添加到您的AI中:

添加您的mcp_settings.json

{
    "mcpServers": {
        ...
        "hf-mcp-summarize": {
            "disabled": false,
            "type": "streamable-http",
            "url": "http://0.0.0.0:19140/mcp-server/mcp/",
            "note": "For Streamable HTTP connections, add this URL directly in your MCP Client",
            "alwaysAllow": []
        },
        ...
    }
}

开放代码

插件opencode.json

{
  ...
  "mcp": {
    ...
    "hf-mcp-summarize": {
      "type": "remote",
      "url": "http://0.0.0.0:19140/mcp-server/mcp/",
      "oauth": false,
      "headers": {
        "Authorization": "Bearer {env:MY_API_KEY}"
      },
      "enabled": true
    },
    ...
  }
  ...
}

📦 端点列表

FastAPI路由:GEThttp://0.0.0.0:19140/health-检查

将返回类似{“status”:“healthy”}的dict

FastAPI路由:GEThttp://0.0.0.0:19140/

将返回一个类似于{“service”:“Weather MCP service”,“version”:“1.0.0”,“status”:“running”}的字典

FastMCP路由:POST/mcp服务器/mcp/add

简单无用的工具很难将a+b相加,并通过在总和上加10来作弊。 📥 请求 { a: 7 b: 3 } 📤 答复:

{
    "status": "success",
    "result": "20"
}

FastMCP路由:POST/mcp服务器/mcp/摘要/text

总结给定的文本块 📥 请求 主体:

{
    'text':'Your blob of text here. It can be unlimited, but is recommended to be within the context window of the LLM you are asking for a summary from.'
}

📤 答复:

{
    "status": "success",
    "summary": "A summary of your text."
}

🧩 环境变量

名称描述默认值
MODEL_NAME您尝试引用的模型的名称。应与您的ollama实例中的模型匹配。骆驼3
MODEL_URL您尝试访问的模型的URL路径http://host.docker.internal:11434

本地启动和调试

本地发布

# change with the LLM you want to use for summarize
export MODEL_NAME="hf-tool-llama3.2-3b-32k"
# change the URL of Ollama server
export MODEL_URL="http://0.0.0.0:11434/"
# change the 0.0.0.0:18990 not working for now when full docker to
# the IP address of sentry-nginx-1 and it's port.
# - SENTRY_URL="http://a87a15429de8e0c6e17217403ece2c13@0.0.0.0:18990/2"
export SENTRY_URL="http://a87a15429de8e0c6e17217403ece2c13@172.31.0.69:80/2"
source .venv/bin/activate
uv run uvicorn src.main:app --reload --port=19140 --log-level debug

或者使用Docker

docker compose -p hf-mcp-summarize up --build -d

在Codium中调试(Vscode完全开源,没有任何跟踪器)

添加此

        {
            "name": "Python Debugger: FastAPI",
            "type": "debugpy",
            "request": "launch",
            "module": "uvicorn",
            "args": [
                "main:app",
                "--reload",
                "--port",
                "19000"
            ],
            "env": {
                "MODEL": "hf-tool-llama3.2-3b-32k",
                "MODEL_URL": "http://0.0.0.0:11434/"
            },
            "jinja": true
        },

然后运行MCP检查器(如果您每天都在使用它,请创建一个别名;-)

npx -y @modelcontextprotocol/inspector
Starting MCP inspector...
⚙ Proxy server listening on 127.0.0.1:6277
🔑 Session token: 60095e43428a6e088eb77fee19951f148b5a839f0bc49fb519ed16d0a3f642ea
Use this token to authenticate requests or set DANGEROUSLY_OMIT_AUTH=true to disable auth

🔗 Open inspector with token pre-filled:
   http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=60095e43428a6e088eb77fee19951f148b5a839f0bc49fb519ed16d0a3f642ea
   (Auto-open is disabled when authentication is enabled)

🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀

image

http://127.0.0.1:19140/mcp-server/mcp/

目录标签

目录标签

FastMCPPythonHTTP服务FastAPI文本摘要本地部署AI工具

接入字段

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

stdio

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

oauth

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

2

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdiooauth部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP