Skip to content

VS Code Integration

You can use mcp-ollama-python in VS Code in two ways:

  1. Companion extension (recommended) — UI for start/stop, models, and logs
  2. MCP config only — wire the server into the editor’s MCP settings JSON

Install MCP Ollama Manager:

Then:

  1. pip install mcp-ollama-python (or use the extension’s Install Now prompt)
  2. Command Palette → MCP Ollama: Configure Server
  3. MCP Ollama: Start Server

More detail: Companion VS Code Extension.

MCP Configuration (without the extension)

Add the Ollama MCP server to your VS Code / Cursor MCP settings:

{
  "mcpServers": {
    "ollama": {
      "command": "py",
      "args": ["-m", "mcp_ollama_python"],
      "disabled": false
    }
  }
}

On Linux/macOS you may prefer "command": "python3" instead of "py".

Usage Examples

Chat with a Model

{
  "tool": "ollama_chat",
  "arguments": {
    "model": "llama3.2:latest",
    "messages": [
      { "role": "user", "content": "Explain quantum computing" }
    ]
  }
}

Generate Embeddings

{
  "tool": "ollama_embed",
  "arguments": {
    "model": "nomic-embed-text",
    "input": ["Hello world", "Embeddings are great"]
  }
}

List Available Models

{
  "tool": "ollama_list",
  "arguments": {
    "format": "markdown"
  }
}