Together AI MCP server

Together AI MCP server

together-ai-mcp•byleonfinn

An MCP server that makes Together AI chat, image generation, vision, and embedding models available as callable tools.

License: MIT•Runtime: Awaiting documentation review•Category: ai agents-models

WHAT IT DOES

  • •Provides a together_chat tool for calling text and reasoning models with prompt, multi-turn messages, system prompt, temperature, and max_tokens options.
  • •Generates images with FLUX or SDXL models and saves them as PNG files to a configured output directory.
  • •Analyzes images via a vision tool that accepts a public image URL or a local file path converted to base64.
  • •Generates text embeddings for retrieval and RAG pipelines.

BEST FOR

  • •Using Together AI reasoning models such as GLM-5 or Qwen3.5 through an MCP client, with handling for their fragmented response fields.
  • •Producing images from prompts and saving them to local disk from within an MCP-compatible client.
  • •Building embeddings for RAG or retrieval work from an MCP client.

ABOUT TOGETHER-AI-MCP

Together AI MCP server is cataloged as an MCP server attributed to leonfinn. An MCP server that makes Together AI chat, image generation, vision, and embedding models available as callable tools. It is categorized under ai agents-models. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: MIT. Check the source repository's current license and terms before using, modifying or distributing this software.

Capability inspector

Capability definitions are not reviewed. Unreviewed imports are not exposed as trusted interfaces.

Tools (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Resources (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

Prompts (0)

No reviewed records to display. This does not establish that upstream lacks this capability.

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Together AI MCP server are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

Can it call any model on Together AI?

Yes, the server works with any model on Together AI's serverless API when given its model ID, though image, vision, and embedding models must be called through their respective tools.

How does it handle reasoning models' empty responses?

It reads content, reasoning_content, and reasoning fields and raises the default max_tokens to 8192 so reasoning models have budget to finish their chain of thought.

Upstream README

View this exact version on GitHub

README.md · b778242e02f1 · Fetched 2026-11-13 11:52:04 UTC

Original upstream text, without AI rewriting. Scripts, forms and unsafe links are filtered for safety.

Showing the last retrieved documentation snapshot; check the source for current changes.

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:

FieldUsed by
message.contentStandard models; Qwen (inline <think> tags)
message.reasoning_contentDeepSeek-style format
message.reasoningTogether 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.

// 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.

// 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

Setup

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:

{
  "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.

ParameterTypeDefaultDescription
modelstringmeta-llama/Llama-3.3-70B-Instruct-TurboModel ID
promptstring—User message (use this OR messages)
messagesarray—Multi-turn [{role, content}] array
systemstring—System prompt (used with prompt only)
temperaturenumber0.70.0–2.0
max_tokensinteger8192Raised from SDK default to give reasoning models enough budget for chain-of-thought

together_generate_image

Generate images using FLUX or SDXL models.

ParameterTypeDefaultDescription
promptstringrequiredImage description
modelstringblack-forest-labs/FLUX.1-schnellModel ID
widthinteger1024Image width in pixels
heightinteger1024Image height in pixels
stepsinteger4Diffusion steps
ninteger1Number of images
negative_promptstring—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.

ParameterTypeDefaultDescription
promptstringrequiredQuestion or instruction
modelstringmeta-llama/Llama-3.2-11B-Vision-InstructModel ID
image_urlstring—Public image URL
image_pathstring—Local file path (converted to base64)
max_tokensinteger1024Max response length

together_embed

Generate text embeddings for RAG and retrieval pipelines.

ParameterTypeDefaultDescription
inputstring | string[]requiredText to embed
modelstringBAAI/bge-large-en-v1.5Embedding 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:

{
  "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

ModelIDNotes
Llama 3.3 70Bmeta-llama/Llama-3.3-70B-Instruct-TurboDefault — fast general-purpose
DeepSeek V3deepseek-ai/DeepSeek-V3Strong at code and reasoning
DeepSeek R1deepseek-ai/DeepSeek-R1Reasoning model
GLM-5 (744B)zai-org/GLM-5Reasoning model — requires fix above
Qwen3.5 397BQwen/Qwen3.5-397B-A17BReasoning model — requires fix above
MiniMax M2.5MiniMaxAI/MiniMax-M2.5Reasoning model — requires fix above
Kimi K2.5moonshotai/Kimi-K2.5Reasoning model — requires fix above
Qwen 2.5 7BQwen/Qwen2.5-7B-Instruct-TurboLightweight / low cost

Image generation

ModelID
FLUX.1-schnellblack-forest-labs/FLUX.1-schnell
FLUX.1-devblack-forest-labs/FLUX.1-dev
Stable Diffusion XLstabilityai/stable-diffusion-xl-base-1.0

Vision

ModelID
Llama 3.2 11B Visionmeta-llama/Llama-3.2-11B-Vision-Instruct
Qwen 2.5 VL 72BQwen/Qwen2.5-VL-72B-Instruct

Embeddings

ModelID
BGE LargeBAAI/bge-large-en-v1.5
M2-BERT 32Ktogethercomputer/m2-bert-80M-32k-retrieval
Snowflake ArcticSnowflake/snowflake-arctic-embed-m

Running tests

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


License

MIT

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Together AI MCP server from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/together-ai-mcp)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

Downloads and pulls

Separate sources, scopes and periods. Never combined or treated as installations, active users or security reviews.

No reviewed package or image identity; download statistics are not listed yet.

Related ai agents-models MCP Servers

Alternative and complementary servers in the same category

View all in ai agents-models →
Knowledge Graph Memory
@modelcontextprotocol/server-memory•Model Context Protocol

Store and retrieve entities, relations and observations in a persistent local knowledge graph.

create_entitiescreate_relationsadd_observations+6 more
92K
AI & Multi-Agent
Sequential Thinking
@modelcontextprotocol/server-sequential-thinking•Model Context Protocol

Organize problem solving into revisable, branching thought steps through an MCP tool.

sequential_thinking
92K
AI & Multi-Agent

Query-aware context compression with an MCP plugin for coding agents, plus Python and HTTP interfaces for reducing the context sent to a language model.

146
AI & Multi-Agent