MCP.so
Sign In
Servers

Together.ai Mcp

@Leonfinn

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.

Overview

What is Together.ai MCP?

Together.ai MCP is 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.

How to use Together.ai MCP?

Install Node.js 18+, obtain a Together AI API key, clone the repository, run npm install, copy .env.example to .env, add your API key, then configure the server in your MCP client (e.g., Claude Desktop) by adding a together-ai entry to the JSON config with the path to index.js and required environment variables.

Key features of Together.ai MCP

  • Chat completions with any Together AI text or reasoning model
  • Correctly handles reasoning models that write output to non-standard fields
  • Image generation via FLUX, SDXL models, saved as PNG files
  • Vision analysis using Llama 3.2 Vision or Qwen 2.5 VL
  • Embeddings generation for RAG/retrieval pipelines
  • Uses direct fetch calls for vision and image generation to avoid SDK limitations

Use cases of Together.ai MCP

  • Use Claude Desktop, Cursor, or VS Code to chat with reasoning models like GLM-5, Qwen3.5, or MiniMax M2.5
  • Generate images from text prompts inside your MCP client
  • Ask a vision model questions about an image (public URL or local file)
  • Create text embeddings for semantic search or RAG without leaving your editor

FAQ from Together.ai MCP

What problem does the reasoning model fix solve?

Together AI’s reasoning models write chain-of-thought to non-standard fields (reasoning_content, reasoning) and exhaust the default 2048 token budget. This server raises max_tokens to 8192 and reads all three possible response fields so no model silently returns an empty answer.

Why are vision requests handled differently from chat?

The OpenAI SDK may silently omit stream: false, causing vision requests to fail with an opaque error. This server uses a raw fetch call with explicit stream: false and includes the full API error body in the exception.

What are the runtime and dependency requirements?

Node.js 18+ and a Together AI API key. The server depends on @modelcontextprotocol/sdk and the openai package (used with Together AI’s base URL).

Where are generated images saved?

Images are saved as PNG files to the directory specified by the IMAGE_OUTPUT_DIR environment variable.

Are there any model limitations I should know?

The server works with any model on Together AI’s serverless API. Models that require a dedicated endpoint (e.g., some Llama 4 variants) will return a 400 error. Use the correct tool for each model type: chat/reasoning models via together_chat, image via together_generate_image, vision via together_vision, and embeddings via together_embed.

Tags

More from AI & Agents