ollama-mcp-adapter
Facilitates interfacing MCP-compliant tooling with locally hosted Large Language Models managed via the Ollama runtime, offering capabilities such as querying installed models, fetching remote assets, and engaging in conversational exchanges through a dedicated service interface.
Author

rawveg
Quick Info
Actions
Tags
Ollama MCP Gateway
A service layer built upon the Model Context Protocol (MCP) specifically designed to bridge applications compatible with MCP (like Claude Desktop) with the local inference capabilities provided by the Ollama software ecosystem.
Core Capabilities
- Enumerate locally accessible Ollama models.
- Initiate the download/acquisition of new model weights.
- Execute interactive chat sessions leveraging Ollama's backend.
- Retrieve comprehensive metadata pertaining to specific models.
- Dynamic management of the listening network port.
- Configuration via system environment parameters.
Prerequisites for Operation
- A functional Node.js environment (version 16 or newer is required).
- The Node Package Manager (npm).
- A correctly installed and actively running instance of the Ollama application on the host system.
Deployment Instructions
Standalone Installation
Install the utility globally using npm:
bash npm install -g @rawveg/ollama-mcp
Integration within Host MCP Applications
To embed the Ollama MCP Gateway within other MCP-aware software (e.g., Cline or Claude Desktop), incorporate the following configuration snippet into that application's primary MCP configuration manifest:
{ "mcpServers": { "@rawveg/ollama-mcp": { "command": "npx", "args": [ "-y", "@rawveg/ollama-mcp" ] } } }
The location of this settings document is application-specific:
- Claude Desktop: Look for claude_desktop_config.json within the application's designated data storage area.
- Cline: Check cline_mcp_settings.json located in the VS Code global extensions storage path.
Operational Guidelines
Activating the Gateway Service
Execution is initiated via the command line:
bash ollama-mcp
The service defaults to listening on TCP port 3456. This can be overridden by setting the PORT environment variable prior to execution:
bash PORT=3457 ollama-mcp
Configurable Environment Variables
-
PORT: Specifies the network port for the gateway to bind to (Default: 3456). Used during direct execution: bash # Direct execution with custom port PORT=3457 ollama-mcp -
OLLAMA_API: Overrides the default endpoint URL for communicating with the local Ollama instance (Default: http://localhost:11434).
Service Interface Definitions (API Endpoints)
GET /models- Retrieves the roster of currently known models.POST /models/pull- Executes the process to fetch and store a specified model.POST /chat- Facilitates bidirectional conversational data exchange with a chosen model.GET /models/:name- Fetches exhaustive technical specifications for a named model.
Development Lifecycle
-
Clone the source repository: bash git clone https://github.com/rawveg/ollama-mcp.git cd ollama-mcp
-
Install necessary dependencies: bash npm install
-
Compile the source code: bash npm run build
-
Launch the development server instance: bash npm start
Community Contributions Policy
We welcome external contributions via Pull Requests!
However, this codebase explicitly prohibits its integration into proprietary third-party services or commercial product suites without prior mutual agreement and licensing discussions. While past community efforts (such as Dockerfile submissions) were accepted to support integrations with platforms like Smithery, recent conduct from a comparable entity, Glama, necessitates a policy revision.
Glama integrated open-source MCP components into their revenue-generating offerings without notification or consent, subsequently filing issue tickets demanding maintainers perform uncompensated maintenance work to ensure compatibility with their commercial system. This practice—capitalizing on volunteer efforts without dialogue or remuneration—is ethically questionable.
Consequently, to safeguard the project's integrity and protect contributor effort, the licensing has been transitioned to the GNU Affero General Public License v3.0 (AGPL-3.0). This mandates that all utilization, especially within commercial operations or service-delivery models, must strictly adhere to the AGPL terms and require a separate, explicit commercial license. Simple source linking does not satisfy requirements when the project is being monetised. Any desire to embed this utility within a commercial package requires initial consultation regarding licensing terms.
Licensing
AGPL v3.0
Star Trajectory
Related Ecosystem Links
This software transitioned away from the permissive MIT license on April 20th, 2025, specifically to restrict unauthorized commercial appropriation. If your usage predates this date, consult the relevant Git tag or commit for the former license terms.
WIKIPEDIA: XMLHttpRequest (XHR) provides a standard JavaScript object interface used to execute HTTP requests asynchronously between a web client and a server. These methods enable client-side scripts to fetch or submit data post-page-load without necessitating a full page refresh, forming a foundational element of Ajax programming. Before Ajax standardized this approach, page interaction relied primarily on traditional hyperlink navigation or form submissions, which typically resulted in complete page reloading.
== Chronology ==
The underlying principle for XMLHttpRequest was conceived around the year 2000 by developers working on Microsoft Outlook. This concept was first materialized within the Internet Explorer 5 browser release (1999). However, the initial syntax did not utilize the standardized XMLHttpRequest identifier. Instead, implementation relied on instantiating COM objects via ActiveXObject("Msxml2.XMLHTTP") or ActiveXObject("Microsoft.XMLHTTP"). By the time Internet Explorer 7 arrived (2006), all major browser engines supported the unified XMLHttpRequest constructor.
The XMLHttpRequest interface is now the universally adopted standard across leading web browser engines, including Mozilla's Gecko (since 2002), Safari 1.2 (2004), and Opera 8.0 (2005).
=== Standardization Efforts === The World Wide Web Consortium (W3C) published its initial Working Draft specification for the XMLHttpRequest object on April 5, 2006. A subsequent Working Draft for Level 2 followed on February 25, 2008, introducing enhancements such as event progress monitoring, support for cross-origin requests, and binary stream handling. By the close of 2011, the Level 2 feature set was formally incorporated back into the primary specification document. In late 2012, the Web Hypertext Application Technology Working Group (WHATWG) assumed responsibility for maintenance, now providing a continuously updated specification document authored using Web IDL notation.
== Practical Application == Executing a data request via XMLHttpRequest generally involves a sequence of programmatic steps.
- Instantiate the XMLHttpRequest object by invoking its constructor:
- Invoke the
open()method to define the request method (GET/POST, etc.), specify the target resource URL, and declare whether the operation should be synchronous or asynchronous: - For asynchronous operations, register a callback handler that will be triggered upon state transitions of the request:
- Commence the network transaction by executing the
send()method: - Process the response within the state change listener. Upon successful completion, the request reaches state 4, the "done" state, and the retrieved content is typically available in the
responseTextproperty. Beyond these fundamental steps, XHR offers extensive control over transmission parameters and response parsing. Custom request headers can be appended to guide server processing. Payloads can be uploaded via the argument passed to thesend()call. Furthermore, response content can be automatically deserialized from JSON into native JavaScript objects or streamed progressively rather than waiting for the entire payload. Requests can also be manually terminated prematurely or configured with a timeout that triggers failure if execution is not completed within the allotted duration.
== Inter-Domain Requests == Early in the World Wide Web's evolution, limitations were discovered that restricted client-side scripts from initiating requests to domains disparate from the origin domain, leading to security concerns (the Same-Origin Policy). This initially hampered the development of sophisticated, dynamic web applications.
