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

Social Vibe Translator

MCP Server

一个基于FastAPI和MCP服务器的工具,用于分析消息语气并将其重写为五种不同的风格(专业、友好、说服、简洁、同理心),并提供平台特定建议。

工具数

1

提示词数

0

GitHub Stars

0

资源数

0
自然语言处理PythonOpenAI

安装说明

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

作者 / 组织

UdayBattula

提供方

UdayBattula

最后核验

2026/5/17 20:19

运行时

Python

快速接入

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

命令预览

python -m venv .venv

详细介绍

社交氛围翻译器

初学者友好的FastAPI+MCP服务器,分析语气并将消息重写为五种“氛围”:专业、友好、有说服力、简洁、同情。它还提供了特定于平台的提示。

特性

  • MCP工具 rewrite_vibes JSON I/O
  • FastAPI端点 /rewrite_vibes
  • OpenAI支持的一代产品,具有离线回退功能
  • Chroma用于平台/用户接地的检索增强生成(RAG)
  • 结构化JSON输出(OpenAI JSON模式)
  • 以法学硕士为评判标准,回归启发式
  • 请求/响应的Pydantic模型
  • 清晰的提示和简单的模板

需求

  • Python 3.10+
  • OpenAI API密钥(可选;如果丢失,则返回到确定性输出)

安装

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt

环境

创建一个 .env 项目根目录中的文件:

OPENAI_API_KEY=your_openai_api_key_here
# Set to 1 to auto-start MCP stdio mode when running server module directly
MCP_STDIO=0

运行FastAPI服务器

uvicorn server:app --reload --app-dir .

服务器运行于 http://127.0.0.1:8000.

种子RAG指南(一次)

curl -X POST http://127.0.0.1:8000/seed_guidelines

HTTP使用示例

发布 http://127.0.0.1:8000/rewrite_vibes

curl -s -X POST http://127.0.0.1:8000/rewrite_vibes \
  -H 'Content-Type: application/json' \
  -d '{"message": "Can we move the meeting to tomorrow?", "platform": "Email"}' | jq .

MCP服务器使用情况

此项目公开了一个名为的MCP工具 rewrite_vibes 通过stdio。您可以通过以下方式运行stdio模式:

python -m server --stdio

如果 MCP_STDIO=1 已设置 .env,导入模块时,stdio服务器将自动启动。

在Puch AI中注册此MCP服务器:

  • 工具名称: rewrite_vibes
  • 命令: python -m server --stdio

请求/响应模式

  • 输入JSON: { "message": str, "platform": Optional[str] }
  • 输出JSON字段:

- original_message:str - tone_analysis: { overall_tone: str, rationale: str } - vibes:每组5个项目 { vibe, rewritten_text, explanation, use_cases } - platform_tips: { platform: str, tips: str }

其他端点:

  • POST /rewrite_top → 排名前N的重写 target_tone
  • POST /seed_guidelines → 将种子平台/音调指南导入向量库
  • POST /feedback_accept → 商店接受个性化RAG的重写

请求/响应示例

请求:

{
  "message": "Need to push the deadline by two days. Can we adjust?",
  "platform": "LinkedIn"
}

示例响应:

{
  "original_message": "Need to push the deadline by two days. Can we adjust?",
  "tone_analysis": {
    "overall_tone": "Neutral",
    "rationale": "Heuristic analysis based on keywords and phrasing."
  },
  "vibes": [
    {
      "vibe": "Professional",
      "rewritten_text": "[Professional] Need to push the deadline by two days. Can we adjust?",
      "explanation": "Uses professional tone cues based on simple template guidance.",
      "use_cases": [
        "Use when you need a professional tone.",
        "Useful for quick edits when time is limited."
      ]
    },
    {
      "vibe": "Friendly",
      "rewritten_text": "[Friendly] Need to push the deadline by two days. Can we adjust?",
      "explanation": "Uses friendly tone cues based on simple template guidance.",
      "use_cases": [
        "Use when you need a friendly tone.",
        "Useful for quick edits when time is limited."
      ]
    },
    {
      "vibe": "Persuasive",
      "rewritten_text": "[Persuasive] Need to push the deadline by two days. Can we adjust?",
      "explanation": "Uses persuasive tone cues based on simple template guidance.",
      "use_cases": [
        "Use when you need a persuasive tone.",
        "Useful for quick edits when time is limited."
      ]
    },
    {
      "vibe": "Concise",
      "rewritten_text": "[Concise] Need to push the deadline by two days. Can we adjust?",
      "explanation": "Uses concise tone cues based on simple template guidance.",
      "use_cases": [
        "Use when you need a concise tone.",
        "Useful for quick edits when time is limited."
      ]
    },
    {
      "vibe": "Empathetic",
      "rewritten_text": "[Empathetic] Need to push the deadline by two days. Can we adjust?",
      "explanation": "Uses empathetic tone cues based on simple template guidance.",
      "use_cases": [
        "Use when you need an empathetic tone.",
        "Useful for quick edits when time is limited."
      ]
    }
  ],
  "platform_tips": {
    "platform": "linkedin",
    "tips": "Stay professional, avoid slang, include a clear ask, and keep paragraphs short."
  }
}

开发说明

  • 服务器在可用时使用异步OpenAI客户端;如果没有密钥,它就会回到本地启发式方法。
  • 保持请求简短,以尽量减少令牌使用。如果消息很长,则会被截断。

目录标签

目录标签

自然语言处理PythonOpenAI本地部署语气分析消息重写FastAPI

接入字段

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

stdio

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

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdionone部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP