ollama-ssh-mcp
Provides tools to interact with a remote Ollama instance through a managed SSH tunnel. Supports chatting with models, optional system prompts, JSON or JSON-schema output, temperature and thinking controls, model selection, named multi-turn conversations, listing installed and loaded models, and forgetting conversations.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ollama-ssh-mcp ask the gpu box model to summarize this stack trace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ollama-ssh-mcp
MCP server that gives an MCP client (Claude Code) access to an Ollama instance on another machine, where Ollama listens only on 127.0.0.1. It reaches it through an SSH local forward that the server manages itself.
The tunnel opens on the first tool call, on a random free local port, so it never collides with a hand-made
-L 11434forward.If the
sshprocess dies (laptop suspend, Wi-Fi change), the next call reopens it. A connection error mid-request triggers one restart and retry.The tunnel closes when the MCP server exits. Nothing runs while the server is unused, and the model unloads on Ollama's normal idle timer.
Tools
Tool | Purpose |
| Prompt the model. Optional |
| List installed models and which are loaded on the GPU. |
| Drop one named conversation, or all of them. |
Related MCP server: MCP Ollama
Config
Env | Default | |
| (required) | e.g. |
|
| Ollama port on the remote host |
|
| default model |
|
| context window sent on every request; match other clients of the same model, since a different value forces a reload |
Register with Claude Code
claude mcp add -s user ollama -e OLLAMA_SSH_TARGET=user@gpu-box.local \
-- ~/.local/bin/uv run --project ~/Projects/ollama-ssh-mcp ollama-ssh-mcpPinned to mcp<2. The 2.x SDK renamed FastMCP to MCPServer.
Available Tools
3 toolschatA
Send a prompt to the local model and return its reply.
Args:
prompt: The user message.
system: Optional system prompt. With conversation, only applied when the conversation starts.
conversation: Optional name; prior turns under this name are sent as context and this turn is
appended. Kept in memory for the life of this MCP server process.
model: Ollama model name (default from OLLAMA_MODEL).
format: "json", or a JSON schema object, to force structured output.
think: Enable the model's thinking mode (slower; off by default).
temperature: Sampling temperature; use 0 for extraction tasks.
Inputs: prompt (required), model, think, format, +3 more.
forget_conversationB
Drop a named conversation's history, or all of them if no name is given.
Inputs: conversation.
modelsB
List models installed on the remote Ollama and which are currently loaded in GPU memory.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool maps to a clearly distinct action: chat runs inference, models lists installed/loaded models, and forget_conversation clears history. There is no plausible way to confuse one for another, even though chat and forget_conversation both touch conversation state (one appends, one deletes).
Two tools use verb-style names (chat, forget_conversation) while models is a bare noun, and chat is a single generic verb rather than verb_noun. The names remain readable and reasonably predictable, but the convention is mixed rather than uniform.
Three tools is a slim but well-scoped surface for a thin Ollama-over-SSH wrapper, and each tool earns its place: generate, enumerate models, reset context. It sits just below the ideal range but does not feel artificially padded or truncated.
Core chat workflow is covered, but there are notable gaps: no model management (pull/delete), no way to inspect or list existing conversations (only drop them), and no stop/stream control. Agents can work around these via the chat tool alone, but the surface is not full lifecycle coverage for the domain.
Maintenance
Related MCP Connectors
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Chat, image, video, and audio models from many vendors behind one remote MCP server and one key.
Secure and manage MCP servers through the Speakeasy AI Control Plane from your agent.
Termalin's hosted MCP server. Claude, ChatGPT or any MCP client runs commands, moves files over SFTP, queries databases and reads server metrics and monitoring alerts on your servers, keylessly through Termalin Connectors: no SSH key is handed over and no inbound port is opened. Per-host command policy and an audit log. Needs a termal.in Pro or Team account (new accounts start with a 14-day Pro trial).
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables seamless integration between Ollama's local LLM models and MCP-compatible applications, supporting model management and chat interactions.13817 npm180AGPL 3.0
- AlicenseAqualityDmaintenanceIntegrates Ollama's local AI models with MCP clients, enabling listing models, viewing model details, and asking questions to models.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to access local or cloud LLMs, manage and run models, generate completions and embeddings, chat with tool/function support, and use web search/fetch through Ollama Cloud.817 npmAGPL 3.0
- AlicenseNot gradedqualityAmaintenanceEnables MCP-compatible clients to manage and interact with local or cloud-hosted Ollama models, including listing, pulling, generating, chatting, embeddings, and web search/fetch operations.817 npmAGPL 3.0