Together.ai Mcp

MCPAI代理

提供方 Leonfinn

AI代理 stdio · 本地进程 API Key 社区 / 第三方 Claude DesktopClaudeCursorVS Code
查看接入方式

MCP server exposing Together AI inference endpoints (chat, image, vision, embeddings) as tools for Claude Desktop, Cursor, VS Code, and any other MCP-compatible client. Fixes silent empty-response bug in reasoning models.

一句话选型结论

按资料字段整理

Together.ai Mcp 属于AI代理类 MCP 服务器,stdio · 本地进程,API Key,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类AI代理 传输方式stdio · 本地进程 鉴权API Key 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

AI代理
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

llmimage generationembeddings

安装与配置

stdio · 本地进程 API Key
客户端在本机拉起子进程,数据不出本机
node /absolute/path/to/together-ai-mcp/index.js

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 node,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
给代理接外部能力

让代理在任务中途调用搜索、数据库等真实工具。

多步任务编排

把一串操作拆成步骤,由代理按顺序执行。

自动化重复流程

把固定流程交给代理跑,减少手工操作。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 使用前要准备好API Key对应的凭据,并按最小权限配置。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在AI代理场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 不方便管理密钥或第三方授权的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Together.ai Mcp当前 未标注 stdio · 本地进程 本地部署 有 未标注
Filesystem 560c4363 13 未标注 本地部署 无 2026-05-17
Server Everything (everything) 11 stdio · 本地进程 本地部署 有 2026-05-17
Time 7365cb6d 2 SSE · 服务端推送 远程部署 有 2026-05-18
Everything Claude Code 未标注 stdio · 本地进程 本地部署 有 2026-05-17
Openmemory 557e1585 未标注 stdio · 本地进程 本地部署 有 2026-05-17

服务器档案

AI代理
字段来自项目仓库与公开索引,中文说明由本站标注
提供方Leonfinn上游标注的维护方 Leonfinn
分类AI代理本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式API Key远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · node本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验未标注上游最后核验时间

详细介绍

9.1 KB
来自项目仓库与上游目录的原文,未做删改

together-ai-mcp

A Node.js Model Context Protocol (MCP) server that exposes Together AI's inference endpoints — chat completions, image generation, vision, and embeddings — as tools callable from Claude Desktop, Cursor, VS Code, and any other MCP-compatible client.

Why this exists

I created this MCP due to several issues I was having accessing models through Together AI.

1. Reasoning model silent empty responses

Together AI's largest reasoning models (GLM-5, Qwen3.5-397B, MiniMax M2.5, Kimi K2.5) write their chain-of-thought into non-standard response fields, and they exhaust the OpenAI SDK's default token budget before producing a final answer.

Two problems compound each other:

Token budget exhaustion. The OpenAI SDK sets a default max_tokens of 2048. For reasoning models, this budget is consumed entirely by the thinking phase — message.content is never populated. You get charged for tokens, no error is raised, and the response is silently empty.

Fragmented response fields. Different model families on Together AI write their output to different fields:

Field Used by
message.content Standard models; Qwen (inline `` tags)
message.reasoning_content DeepSeek-style format
message.reasoning Together AI format (GLM-5, MiniMax, Kimi)

Any code that only reads message.content — or even message.content \ · \ · message.reasoning — silently returns an empty string for some models.```js
// Broken — misses reasoning_content (DeepSeek format):
const text = message.content || message.reasoning || '';

// Fixed — covers all Together AI reasoning model formats:
const text = message.content || message.reasoning_content || message.reasoning || '';


The default `max_tokens` is raised to 8192 to give reasoning models enough budget to complete their chain of thought before producing a final answer.

### 2. Vision model failures

Using the OpenAI SDK's `chat.completions.create()` for vision requests fails silently against Together AI's vision API. Together AI requires `stream: false` to be set explicitly; the SDK may not send it. When it does fail, the SDK error contains no response body, making the root cause invisible.```js
// Broken — SDK may omit stream:false; errors are opaque:
const response = await openai.chat.completions.create({ model, messages });

// Fixed — raw fetch, explicit stream:false, full error body in exception:
const response = await fetch('https://api.together.xyz/v1/chat/completions', {
  method: 'POST',
  headers: { Authorization: `Bearer ${apiKey}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({ model, messages, max_tokens, stream: false }),
});
if (!response.ok) {
  const body = await response.text();
  throw new Error(`Vision API error ${response.status}: ${body.slice(0, 200)}`);
}

Features

  • Chat completions — any Together AI text or reasoning model, with full prompt and multi-turn message support
  • Reasoning model support — correctly handles GLM-5, Qwen3.5-397B, MiniMax M2.5, Kimi K2.5 (see above)
  • Image generation — FLUX.1-dev, FLUX.1-schnell, Stable Diffusion XL; images saved to disk
  • Vision — analyse images via Llama 3.2 Vision or Qwen 2.5 VL
  • Embeddings — generate vectors for RAG/retrieval pipelines via BGE and Snowflake Arctic models

Installation

Prerequisites

  • Node.js 18+
  • A Together AI API key — get one at api.together.ai

Setup```bash

git clone https://github.com/your-username/together-ai-mcp
cd together-ai-mcp
npm install
cp .env.example .env

Edit .env and add your TOGETHER_API_KEY


### Add to Claude Desktop

Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:```json
{
  "mcpServers": {
    "together-ai": {
      "command": "node",
      "args": ["/absolute/path/to/together-ai-mcp/index.js"],
      "env": {
        "TOGETHER_API_KEY": "your_api_key_here",
        "IMAGE_OUTPUT_DIR": "/path/to/save/images"
      }
    }
  }
}

See examples/claude-config.md for Cursor and VS Code configuration.


Tools

together_chat

Call any Together AI chat or reasoning model.

Parameter Type Default Description
model string meta-llama/Llama-3.3-70B-Instruct-Turbo Model ID
prompt string — User message (use this OR messages)
messages array — Multi-turn [{role, content}] array
system string — System prompt (used with prompt only)
temperature number 0.7 0.0–2.0
max_tokens integer 8192 Raised from SDK default to give reasoning models enough budget for chain-of-thought

together_generate_image

Generate images using FLUX or SDXL models.

Parameter Type Default Description
prompt string required Image description
model string black-forest-labs/FLUX.1-schnell Model ID
width integer 1024 Image width in pixels
height integer 1024 Image height in pixels
steps integer 4 Diffusion steps
n integer 1 Number of images
negative_prompt string — What to exclude

Images are saved as PNG files to IMAGE_OUTPUT_DIR.

> Note: Image generation uses a direct fetch call rather than the OpenAI SDK's images.generate() because the SDK strips custom parameters like steps when calling Together AI's endpoint.

together_vision

Analyse an image using a vision model.

Parameter Type Default Description
prompt string required Question or instruction
model string meta-llama/Llama-3.2-11B-Vision-Instruct Model ID
image_url string — Public image URL
image_path string — Local file path (converted to base64)
max_tokens integer 1024 Max response length

together_embed

Generate text embeddings for RAG and retrieval pipelines.

Parameter · Type · Default · Description
input · string \ · string[] · required · Text to embed
model · string · BAAI/bge-large-en-v1.5 · Embedding model ID


Models

The server works with any model available on Together AI's serverless API — just pass its model ID. No configuration changes are needed.

The tables below list the models I personally use. They are provided as a reference, not as a hard limit.

Finding model IDs

Browse all available models at api.together.ai/models. Each model's page shows its exact ID string. Pass that ID as the model parameter to any tool:```json
{
"tool": "together_chat",
"params": {
"model": "any-model-id-from-together-ai",
"prompt": "Hello"
}
}


The only constraint is that image generation models must be called via `together_generate_image`, vision models via `together_vision`, and embedding models via `together_embed` — you cannot call an image model through `together_chat`.

> **Dedicated endpoints:** Some models (e.g. `meta-llama/Llama-4-Maverick-17B-128E-Instruct-FP8`) require a dedicated endpoint rather than the serverless API. Calling these via this server will return a 400 error from Together AI.

---

### Models I use

#### Chat / Reasoning

| Model | ID | Notes |
|---|---|---|
| Llama 3.3 70B | `meta-llama/Llama-3.3-70B-Instruct-Turbo` | Default — fast general-purpose |
| DeepSeek V3 | `deepseek-ai/DeepSeek-V3` | Strong at code and reasoning |
| DeepSeek R1 | `deepseek-ai/DeepSeek-R1` | Reasoning model |
| GLM-5 (744B) | `zai-org/GLM-5` | Reasoning model — requires fix above |
| Qwen3.5 397B | `Qwen/Qwen3.5-397B-A17B` | Reasoning model — requires fix above |
| MiniMax M2.5 | `MiniMaxAI/MiniMax-M2.5` | Reasoning model — requires fix above |
| Kimi K2.5 | `moonshotai/Kimi-K2.5` | Reasoning model — requires fix above |
| Qwen 2.5 7B | `Qwen/Qwen2.5-7B-Instruct-Turbo` | Lightweight / low cost |

#### Image generation

| Model | ID |
|---|---|
| FLUX.1-schnell | `black-forest-labs/FLUX.1-schnell` |
| FLUX.1-dev | `black-forest-labs/FLUX.1-dev` |
| Stable Diffusion XL | `stabilityai/stable-diffusion-xl-base-1.0` |

#### Vision

| Model | ID |
|---|---|
| Llama 3.2 11B Vision | `meta-llama/Llama-3.2-11B-Vision-Instruct` |
| Qwen 2.5 VL 72B | `Qwen/Qwen2.5-VL-72B-Instruct` |

#### Embeddings

| Model | ID |
|---|---|
| BGE Large | `BAAI/bge-large-en-v1.5` |
| M2-BERT 32K | `togethercomputer/m2-bert-80M-32k-retrieval` |
| Snowflake Arctic | `Snowflake/snowflake-arctic-embed-m` |

---

## Running tests```bash
npm test

The test suite uses Node.js's built-in test runner and mocks all external dependencies — no API key required to run tests.


Project structure```

together-ai-mcp/
├── index.js # MCP server and handler logic
├── package.json
├── .env.example
├── test/
│ └── index.test.js # Full test suite (node:test, no external framework)
└── examples/
├── chat.md # Example prompts for each tool and model
└── claude-config.md # Configuration for Claude Desktop, Cursor, VS Code
```


Dependencies

  • @modelcontextprotocol/sdk — MCP server framework
  • openai — OpenAI-compatible client used with Together AI's baseURL

License

MIT

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Together.ai Mcp 怎么安装?

在客户端按下面的安装命令接入:node /absolute/path/to/together-ai-mcp/index.js。装完在客户端配置里引用同一个包或端点。

Together.ai Mcp 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Together.ai Mcp 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Together.ai Mcp 需要 API Key 吗?

资料标注需要API Key认证,使用前准备好对应凭据,并按最小权限配置。

Together.ai Mcp 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、VS Code、Windsurf、Codex;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Together.ai Mcp 能提供哪些能力?

资料显示能力标签包括 llm、image generation、embeddings、inference。具体工具清单以官方文档为准。

Together.ai Mcp 需要什么运行环境?

运行时为 node;属于本地进程,需要在本机装好运行环境。

Together.ai Mcp 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 未标注。