πŸ¦™ ollama-mcpo-adapter

by tappi287

4 392 downloads Not rated yet MIT
GitHub

About

Adapter to expose MCPO, the MCP-to-OpenAPI proxy server, tools in Ollama-compatible format

Details

License
MIT

Explore

- πŸ”Œ Connect to a MCPO instance
- βš™οΈ Launch your own MCPO server programmatically via MCPOService
- πŸ” List MCP tools exposed via OpenAPI as Ollama-compatible tool functions

---

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name πŸ¦™ ollama-mcpo-adapter
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

pip install ollama-mcpo-adapter

Assuming you have MCPO running like this:

uvx mcpo --port 5090 --config /path/to/mcp_config.json

You can get all available functions in Ollama ToolCall format with the adapter:
from ollama_mcpo_adapter import OllamaMCPOAdapter

adapter = OllamaMCPOAdapter(host="localhost", port=5090, config_path="/path/to/mcp_config.json")

You can start a MCPO service with this extension:

python
from ollama_mcpo_adapter import MCPOService

mcp_config = {
"mcpServers": {
"time": {"command": "uvx", "args": ["mcp-server-time", "--local-timezone=Europe/Berlin"]}
}
}
mcpo = MCPOService("127.0.0.1", 4090, config=mcp_config,

config_path="path/to/mcp_config.json")

pytest

---

tools = adapter.list_tools_ollama()

You can omit the config path. But discovery of MCP server names is more reliable with a provided config.
Otherwise, the server names will be read from the automatically generated OpenAPI docs MCPO provides which might change in the future.

---

client = Client(host="http://127.0.0.1:11434")
response = client.chat(
model="qwen2.5-coder:14b-instruct-q4_K_M",
messages=[{"role": "user", "content": "Write a file..."}],
tools=tools,
)

And finally call the tools:


if response.message.tool_calls:
adapter.call_tools_from_response(response.message.tool_calls)

---

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83e\udd99 ollama-mcpo-adapter": {
            "ollama-mcpo-adapter": {
                "command": "uvx",
                "args": [
                    "mcpo",
                    "--port",
                    "5090",
                    "--config",
                    "/path/to/mcp_config.json"
                ]
            }
        }
    }
}

McpServers

{
    "ollama-mcpo-adapter": {
        "command": "uvx",
        "args": [
            "mcpo",
            "--port",
            "5090",
            "--config",
            "/path/to/mcp_config.json"
        ]
    }
}

Expose MCPO, the MCP-to-OpenAPI proxy server, tools as Ollama-compatible functions using a simple Python adapter and optional runtime service.

---

✨ Features

- πŸ”Œ Connect to a MCPO instance
- βš™οΈ Launch your own MCPO server programmatically via MCPOService
- πŸ” List MCP tools exposed via OpenAPI as Ollama-compatible tool functions

---

πŸš€ Quickstart

1. Install

pip install ollama-mcpo-adapter

Usage with Existing MCPO Instance

Assuming you have MCPO running like this:
uvx mcpo --port 5090 --config /path/to/mcp_config.json
You can get all available functions in Ollama ToolCall format with the adapter: ```python from ollama_mcpo_adapter import OllamaMCPOAdapter

adapter = OllamaMCPOAdapter(host="localhost", port=5090, config_path="/path/to/mcp_config.json")

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.