MCP Server with Ollama Integration
About
An MCP server that integrates with Ollama to provide tools for file operations, calculations, and text processing. Requires a running Ollama instance.
Details
- Author
- mudit7715
- Categories
- Developer Tools, AI, File Management
Jump to
Step 2 Install Ollama And Required Libraries
# Install required packages pip install fastmcp pip install langchain-mcp-adapters langgraph langchain-ollama langchain # Check if Ollama is running curl http://localhost:11434/api/tags # If not installed, visit: https://ollama.com/library # Pull a model (if you don't have one) ollama pull llama3.1
mcp-ollama-server/ ├── server.py # MCP server with all tools ├── client.py # Client that connects server to Ollama ├── config.json # Server configuration └── README.md # This file
source mcp_env/bin/activate python server.py # Open another terminal and the run: python client.py
Enter your question: Calculate 50 3 + 10 Answer: I will calculate that for you. 50 3 + 10 = 160 Enter your question: Check if file 'test.txt' exists in current directory Answer: The file 'test.txt' was not found in the current directory. Enter your question: Generate a secure password Answer: Here is a generated 12-character password: K9#mX2$vB8pQ
@mcp.tool() def your_new_tool(parameter: str) -> str: """Description of what your tool does.""" # Your tool logic here return f"Result: {parameter}"
agent = create_react_agent("ollama:llama3.2", tools) # Change model here
Edit config.json to change server parameters:
{ "mcpServers": { "my-simple-assistant": { "command": "python", "args": ["/full/path/to/your/server.py"], "cwd": "/full/path/to/your/project" } } }
Want to add more tools? Here's how:
@mcp.tool() def my_awesome_tool(input_param: str) -> str: """What this tool does.""" # Your logic here return f"Result: {input_param}"
Test it by asking the AI to use your tool
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Integrates with the unofficial Google Gemini CLI, allowing file access within configured directories.
next-devtools-mcp is a MCP server that provides Next.js development tools and utilities for AI coding assistants like Claude and Cursor.
Word search, crossword, and sudoku generator MCP server with printable PDF worksheets, themed word banks, and verifiable LLM evals. Local-first, from the makers of puzzletide.com.
A demonstration server for ActionKit, providing access to Slack actions via Claude Desktop.
MCP server that lets Claude Code agents delegate tasks to agents in other project directories, with parallel dispatch, sessions, and async jobs.
Statistical regression testing for LLM agents: p-value, effect size, and CI on behavior change.
A Python MCP package that gives your LLM agents complete file system and shell capabilities — production-ready, sandboxed, and wired to any LLM in minutes.
AI-powered code quality analysis to detect best practice violations, security issues, and architectural problems in real-time.
An MCP server that integrates with Ollama to provide tools for file operations, calculations, and text processing. Requires a running Ollama instance.
A simpleModel Context Protocol (MCP)server that extends AI capabilities with useful tools for file operations, calculations, text processing, and more. This project demonstrates how to create custom tools that AI models can use through Ollama.
This is a tutorial which creates abridgebetween AI models (like those running in Ollama) and your computer's functionality using Model Context Protocol, Langchain and Ollama. Think of it as giving the AI hands to do any task which ealier seem to impossible by AI.
This is a very basic implementation on top of which we can build more.(No external APIs connected yet)
- Python 3.10 or higher
- Ollama installed and running
- Basic familiarity with terminal/command line
- Langchain models
- API basics
# Download files wget https://github.com/Mudit7715/MCP.git cd MCP # Create virtual environment python -m venv mcp_env # Activate it source mcp_env/bin/activate # Linux/Mac # OR mcp_env\Scripts\activate # Windows
Step 2: Install ollama and required libraries.
# Install required packages pip install fastmcp pip install langchain-mcp-adapters langgraph langchain-ollama langchain # Check if Ollama is running curl http://localhost:11434/api/tags # If not installed, visit: https://ollama.com/library # Pull a model (if you don't have one) ollama pull llama3.1
mcp-ollama-server/ ├── server.py # MCP server with all tools ├── client.py # Client that connects server to Ollama ├── config.json # Server configuration └── README.md # This file
source mcp_env/bin/activate python server.py # Open another terminal and the run: python client.py
Enter your question: Calculate 50 3 + 10 Answer: I will calculate that for you. 50 3 + 10 = 160 Enter your question: Check if file 'test.txt' exists in current directory Answer: The file 'test.txt' was not found in the current directory. Enter your question: Generate a secure password Answer: Here is a generated 12-character password: K9#mX2$vB8pQ
@mcp.tool() def your_new_tool(parameter: str) -> str: """Description of what your tool does.""" # Your tool logic here return f"Result: {parameter}"
agent = create_react_agent("ollama:llama3.2", tools) # Change model here
Edit config.json to change server parameters:
{ "mcpServers": { "my-simple-assistant": { "command": "python", "args": ["/full/path/to/your/server.py"], "cwd": "/full/path/to/your/project" } } }
Want to add more tools? Here's how:
@mcp.tool() def my_awesome_tool(input_param: str) -> str: """What this tool does.""" # Your logic here return f"Result: {input_param}"
Test it by asking the AI to use your tool
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
Integrates with the unofficial Google Gemini CLI, allowing file access within configured directories.
next-devtools-mcp is a MCP server that provides Next.js development tools and utilities for AI coding assistants like Claude and Cursor.
Word search, crossword, and sudoku generator MCP server with printable PDF worksheets, themed word banks, and verifiable LLM evals. Local-first, from the makers of puzzletide.com.
A demonstration server for ActionKit, providing access to Slack actions via Claude Desktop.
MCP server that lets Claude Code agents delegate tasks to agents in other project directories, with parallel dispatch, sessions, and async jobs.
Statistical regression testing for LLM agents: p-value, effect size, and CI on behavior change.
A Python MCP package that gives your LLM agents complete file system and shell capabilities — production-ready, sandboxed, and wired to any LLM in minutes.
AI-powered code quality analysis to detect best practice violations, security issues, and architectural problems in real-time.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.




