Skip to main content
Glama

Local MCP Server with Ollama

A local Python project that connects an Ollama language model to an MCP server. The model can discover the server's tools, decide when to call one, receive the result, and produce a concise final response.

flowchart TD
    U["User question"] --> C["Python MCP client"]
    C --> O["Ollama llama3.2:3b"]
    O --> C
    C --> S["Local MCP server"]
    S --> D["Student JSON data"]

Available tools

Tool

Purpose

add_numbers

Adds two explicitly supplied numbers

get_student_info

Returns the built-in demonstration student profile

search_students

Searches files/students.json by name and requested field

Related MCP server: custom-mcp-server

Requirements

  • Python 3.11+

  • Ollama installed and running

  • Ollama model llama3.2:3b

Windows setup

python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
ollama pull llama3.2:3b
python client.py

The client launches server.py automatically through the active Python interpreter. You do not need to start the server in a separate terminal.

Example questions

  • What is 10 + 20?

  • Tell me about Pranay.

  • Where is Ananya studying?

  • What is Saranya studying?

Project structure

mcp-server/
├── client.py
├── server.py
├── files/
│   └── students.json
├── tests/
│   └── test_server.py
└── requirements.txt

Tool-result fix

Ollama expects a tool-result message to include the executed tool_name. The client includes this field and passes the available tool definitions into the follow-up call, allowing the model to produce the final response after an MCP tool runs.

Data note

files/students.json is demonstration data. Replace it with fictional or consented data before using this project publicly or in production.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Gateway between LLM agents and world data through eight tools and a bundled endpoint catalog.

  • 500+ deterministic tools for AI agents: math, conversion, validation, hashing, encoding, date/time.

  • AI-callable calculators and engineering models with real formulas. No hallucinated math.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Pranay-6669/mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server