Ollama Agent
A TypeScript example showcasing the integration of Ollama with the Model Context Protocol (MCP) servers. This project provides an interactive command-line interface for an AI agent that can utilize the tools from multiple MCP Servers..
What is Ollama Agent?
Ollama Agent is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to typescript example showcasing the integration of ollama with the model context protocol (mcp) servers. this project provides an interactive command-line interface for an ai agent that can utilize the ...
A TypeScript example showcasing the integration of Ollama with the Model Context Protocol (MCP) servers. This project provides an interactive command-line interface for an AI agent that can utilize the tools from multiple MCP Servers..
This server falls under the Coding Agents category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A TypeScript example showcasing the integration of Ollama wi
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx mcp-ollama-agentConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Ollama Agent
MCP Ollama Agent is a TypeScript reference implementation that demonstrates how to build an interactive command-line AI agent using Ollama as the LLM backend alongside one or more MCP servers for tool access. It reads server configuration from an mcp-config.json file (similar to claude_desktop_config.json), connects to any MCP-compatible servers at startup, and gives the local Ollama model access to all discovered tools — enabling a fully local, private AI agent that can perform filesystem operations, web research, or any other capability exposed by the connected MCP servers.
Prerequisites
- Node.js 18 or higher
- Ollama installed and running locally (https://ollama.com) with a tool-capable model such as qwen2.5 or llama3.1
- At least one MCP server installed (e.g., @modelcontextprotocol/server-filesystem or @mzxrai/mcp-webresearch)
- Git to clone the repository
Clone the repository
Clone the mcp-ollama-agent repository to your local machine.
git clone https://github.com/ausboss/mcp-ollama-agent.git
cd mcp-ollama-agentInstall dependencies
Install the required npm packages.
npm installInstall MCP server packages you want to use
Install the MCP servers your agent will have access to. The example uses filesystem and web research servers.
npm install -g @modelcontextprotocol/server-filesystem
npm install -g @mzxrai/mcp-webresearchConfigure mcp-config.json
Edit mcp-config.json to specify which MCP servers to connect to and which Ollama model to use. The model must support function/tool calling.
Pull the Ollama model
Pull a tool-capable model in Ollama. qwen2.5 is confirmed to work well with MCP tool calls.
ollama pull qwen2.5:latestStart the agent
Run the interactive chat interface. The agent will connect to configured MCP servers and make their tools available to the Ollama model.
npm startOllama Agent Examples
Client configuration
mcp-config.json example configuring two MCP servers (filesystem and web research) and the Ollama model. Place this file in the project root.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["@modelcontextprotocol/server-filesystem", "./"]
},
"webresearch": {
"command": "npx",
"args": ["-y", "@mzxrai/mcp-webresearch"]
}
},
"ollama": {
"host": "http://localhost:11434",
"model": "qwen2.5:latest"
}
}Prompts to try
Example interactive chat prompts for the mcp-ollama-agent once the CLI is running with filesystem and web research MCP servers.
- "Use your list directory tool to see what's in the test-directory folder"
- "Read the file at test-directory/test.txt and tell me what it says"
- "Search the web for the latest release notes for Node.js 22"
- "List all .json files in the current directory"
- "Run the demo mode to test filesystem and web tools without the LLM: npx tsx ./src/demo.ts"Troubleshooting Ollama Agent
The Ollama model does not use tools and just responds conversationally
Only models with native function/tool calling support work correctly. Use qwen2.5:latest or llama3.1 — verify the model supports tools at https://ollama.com/library. You can also customize the system prompt in ChatManager.ts to guide the model to use tools more aggressively.
MCP server fails to connect on startup with ENOENT or command not found
The MCP server commands in mcp-config.json (e.g., npx @modelcontextprotocol/server-filesystem) must be resolvable from the current shell environment. Install the packages globally first (npm install -g ...) or use absolute paths for command entries.
Ollama returns connection refused errors
Ensure Ollama is running before starting the agent: run ollama serve in a separate terminal, or start the Ollama desktop app. Verify the host in mcp-config.json matches where Ollama is listening (default: http://localhost:11434).
Frequently Asked Questions about Ollama Agent
What is Ollama Agent?
Ollama Agent is a Model Context Protocol (MCP) server that typescript example showcasing the integration of ollama with the model context protocol (mcp) servers. this project provides an interactive command-line interface for an ai agent that can utilize the tools from multiple mcp servers.. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Ollama Agent?
Follow the installation instructions on the Ollama Agent GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Ollama Agent?
Ollama Agent works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Ollama Agent free to use?
Yes, Ollama Agent is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Ollama Agent Alternatives — Similar Coding Agents Servers
Looking for alternatives to Ollama Agent? Here are other popular coding agents servers you can use with Claude, Cursor, and VS Code.
Dify
★ 142.2kProduction-ready platform for agentic workflow development.
Ruflo
★ 54.0k🌊 The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade architecture, self-learning swarm intelligence, RAG integrat
Goose
★ 45.7kan open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
Antigravity Awesome Skills
★ 38.3kInstallable GitHub library of 1,400+ agentic skills for Claude Code, Cursor, Codex CLI, Gemini CLI, Antigravity, and more. Includes installer CLI, bundles, workflows, and official/community skill collections.
AgentScope
★ 25.5kBuild and run agents you can see, understand and trust.
Serena
★ 24.5kA coding agent toolkit that provides IDE-like semantic code retrieval and editing tools, enabling LLMs to efficiently navigate and modify codebases using symbol-level operations instead of basic file reading and string replacements.
Browse More Coding Agents MCP Servers
Explore all coding agents servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Ollama Agent in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Ollama Agent?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.