Ollama Sandbox
БесплатноНе проверенLocal MCP sandbox combining Docker, Postgres, and Ollama for testing SQL and OS automation tools with a local LLM.
Описание
Local MCP sandbox combining Docker, Postgres, and Ollama for testing SQL and OS automation tools with a local LLM.
README
This project is a local MCP playground with three moving parts:
- a Dockerized Postgres demo database
- a small Node MCP server plus CLI bridge
- a Python agent that uses Ollama over HTTP instead of loading Hugging Face models directly
The old in-process Hugging Face model flow has been replaced. The local agent now talks to an Ollama container, and Ollama is responsible for serving the Qwen model.
Architecture
docker composestarts Postgres, Adminer, and Ollamasrc/server.jsexposes MCP tools over stdiosrc/mcp-client-cli.jslets the Python agent call those toolsagent/local_qwen_agent.pysends chat requests to Ollama- the agent decides when to call MCP tools and uses their results to finish the task
That keeps model serving separate from the Python agent process and removes the old transformers + local model download path.
What is in this repo
docker-compose.yml: starts Postgres, Adminer, and Ollamasql/init.sql: creates demo tables and seed datasrc/server.js: starts the MCP serversrc/sql-tools.js: SQL-related MCP toolssrc/os-tools.js: OS-related MCP toolssrc/mcp-client-cli.js: small CLI bridge that lets the Python agent call MCP toolsagent/local_qwen_agent.py: Ollama-backed local agent runneragent/prepare_ollama_model.py: pulls the base Ollama model and creates the project model aliasprompts/agent-prompt.md: prompt for database analysisprompts/start_steam.md: prompt for opening Steammcp-config.example.json: example MCP host config
MCP tools in this project
SQL tools
list_tablesdescribe_tablesample_rowsrun_readonly_queryinsert_row
OS tools
open_steamopen_steam_game
Recommended setup order
1. Install Node dependencies
If PowerShell blocks npm, use the Windows shim:
cmd /c npm install
2. Start the containers
docker compose up -d
This starts:
- Postgres on
localhost:5432 - Adminer on
http://localhost:8080 - Ollama on
http://localhost:11434
3. Create a Python virtual environment
python -m venv .venv
.venv\Scripts\Activate.ps1
4. Install Python requirements
The Ollama-backed agent uses only the Python standard library, so this is mostly a no-op but keeps the setup flow consistent:
python -m pip install -r requirements-agent.txt
5. Prepare the Ollama model
python agent/prepare_ollama_model.py
By default this does two things:
- pulls Ollama's
qwen3:4b - creates the project alias
qwen/qwen3-4b-instruct-2507
The agent uses that alias by default so the project still targets the requested Qwen 4B setup while staying inside Ollama's model-serving workflow.
If you want to recreate the alias:
python agent/prepare_ollama_model.py --recreate
If your Ollama server is not on the default host:
python agent/prepare_ollama_model.py --ollama-url http://localhost:11434
Start the MCP server
cmd /c npm run start
Run the local Qwen agent
For the database prompt:
python agent/local_qwen_agent.py --prompt-file prompts/agent-prompt.md --max-steps 16
For the Steam prompt:
python agent/local_qwen_agent.py --prompt-file prompts/start_steam.md --max-steps 8
If you want to point the agent at a different Ollama endpoint or model:
python agent/local_qwen_agent.py --ollama-url http://localhost:11434 --model qwen/qwen3-4b-instruct-2507
Direct MCP bridge commands
List available tools:
node src/mcp-client-cli.js tools
Call a SQL tool directly:
node src/mcp-client-cli.js call list_tables "{}"
Run a read-only SQL query:
node src/mcp-client-cli.js call run_readonly_query "{\"sql\":\"select * from customers limit 3\"}"
Insert a customer:
node src/mcp-client-cli.js call insert_row "{\"table_name\":\"customers\",\"values\":{\"full_name\":\"John Cena\",\"city\":\"West Newbury\",\"country\":\"United States\",\"segment\":\"Enterprise\"}}"
Open Steam:
node src/mcp-client-cli.js call open_steam "{}"
Prompts
Database prompt
prompts/agent-prompt.md tells the agent to:
- inspect available tables
- inspect relevant schemas
- query the database
- answer the business questions from query results
Steam prompt
prompts/start_steam.md tells the agent to:
- inspect available tools
- call
open_steamif available - return a short final confirmation
Using it with another MCP host
If you want to use the server in another MCP-compatible host, use mcp-config.example.json as your starting point.
Typical flow:
- register the server
- reload the host
- paste one of the prompt files
- watch the host call the tools
Notes
insert_rowwrites real rows into the demo databaseopen_steamis Windows-onlyopen_steam_gameexpects a Steam app id- the Ollama model alias is created locally and stored in the Ollama volume
References
- Ollama Docker image: https://hub.docker.com/r/ollama/ollama
- Ollama API docs: https://docs.ollama.com/api
Установка Ollama Sandbox
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/bristolero/ollama-mcp-sandboxFAQ
Ollama Sandbox MCP бесплатный?
Да, Ollama Sandbox MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Ollama Sandbox?
Нет, Ollama Sandbox работает без API-ключей и переменных окружения.
Ollama Sandbox — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Ollama Sandbox в Claude Desktop, Claude Code или Cursor?
Открой Ollama Sandbox на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
wenb1n-dev/SmartDB_MCP
A universal database MCP server supporting simultaneous connections to multiple databases. It provides tools for database operations, health analysis, SQL optim
автор: wenb1n-devPostgres Server
This server enables interaction with PostgreSQL databases through the Model Context Protocol, optimized for the AWS Bedrock AgentCore Runtime. It provides tools
автор: madhurprashPostgres
Query your database in natural language
автор: AnthropicPostgreSQL
Read-only database access with schema inspection.
автор: modelcontextprotocolCompare Ollama Sandbox with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data
