Skip to main content
Glama

MCP Ollama

Arquitetura

Usuário
  ↓
Interface web
  ↓
Backend agente
  ↓
Ollama
  ↓
Cliente MCP
  ↓
Servidor MCP
  ↓
PostgreSQL
  1. O usuário envia uma pergunta pela interface.

  2. O backend valida a pergunta.

  3. O Ollama escolhe uma tool.

  4. O cliente MCP chama o servidor MCP.

  5. O servidor consulta o PostgreSQL.

  6. O backend formata o resultado.

  7. A interface apresenta a resposta.

Related MCP server: mcp-db-server

Como executar

Requisitos:

  • Node.js 20 ou superior;

  • npm;

  • Docker e Docker Compose;

  • Ollama;

  • modelo qwen2.5:3b no Ollama.

Na raiz do projeto, crie e configure o arquivo de ambiente:

cp .env.example .env
nano .env

Instale as dependências:

npm install

Inicie o PostgreSQL:

docker compose up -d

Inicie o Ollama e baixe o modelo, caso ainda não esteja instalado localmente:

sudo systemctl start ollama
ollama pull qwen2.5:3b

Inicie o backend agente:

npm run start:agent

O backend inicia o MCP Server automaticamente por STDIO e também disponibiliza a interface web. Acesse:

http://127.0.0.1:3100

Como encerrar

No terminal do backend, pressione:

Ctrl+C

Isso também encerra o MCP Server iniciado pelo backend.

Pare o Ollama:

sudo systemctl stop ollama

Pare o PostgreSQL sem excluir dados ou volumes:

docker compose stop

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An interactive chat interface that combines Ollama's LLM capabilities with PostgreSQL database access through the Model Context Protocol (MCP). Ask questions about your data in natural language and get AI-powered responses backed by real SQL queries.
      62
      MIT
    • F
      license
      Not graded
      quality
      B
      maintenance
      An MCP server that exposes relational databases (PostgreSQL/MySQL) to AI agents with natural language to SQL query support.
      19
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables SQL queries against PostgreSQL databases through MCP-compatible clients and includes a natural language agent for forming SQL queries from natural language.
      247
      PostgreSQL