Skip to content

fnc11/mcp_with_ollama

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCP with Ollama Integration

This project demonstrates how to run MCP Host with Ollama models and additional tools.


Installation

1. Install Ollama

Follow the Ollama installation guide for your OS.

On macOS:

ollama run llama3.2:latest

2. Install Go

Download and install Go from golang.org.

Verify installation:

go version

Add Go bin to your PATH:

export PATH="$PATH:$(go env GOPATH)/bin"

3. Install MCP Host (Go)

Install MCP Host using Go:

go install github.com/mark3labs/mcphost@latest

Verify installation:

mcphost --version

Create a Configuration File

Edit config.json to define your MCP servers and tools. Example:

{
	"globalShortcut": "cmd+Space",
	"mcpServers": {
		"sqlite": {
			"command": "uvx",
			"args": [
				"mcp-server-sqlite",
				"--db-path",
				"/Users/fnc11/playground/mcp_with_ollama/dbs/Car_Database.db"
			]
		},
		"ddg-search": {
			"command": "uvx",
			"args": [
				"duckduckgo-mcp-server"
			]
		},
		"filesystem": {
			"command": "npx",
			"args": [
				"-y",
				"@modelcontextprotocol/server-filesystem",
				"/Users/fnc11/playground/mcp_with_ollama/"
			]
		}
	}
}

Running Ollama Model with MCP Host

To run the llama3.2:latest model with MCP Host and your tools config:

mcphost -m ollama:llama3.2:latest --config 

Example Output

Below is a screenshot of MCP Host running with Ollama and the configured tools:

Running Example


Credits

This setup and tutorial closely follows the excellent guide from Mehul Gupta's blog post.
Full credit to the original author for the instructions and inspiration.


License

MIT

About

Example of running ollama models with mcp server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published