Skip to main content

DuckDB-powered MCP Server with SQL macros for LLM agents

Project description

Agent Farm

🚜 Agent Farm 🦆

Python DuckDB Ollama Docker MCP Query Farm License: MIT

🌾 DuckDB-powered MCP Server with SQL macros for LLM agents - Web Search, Python execution, RAG, and more.

DuckDBOllamaDockerQuery Farm


✨ Features

Feature Description
🦆 MCP Server Exposes DuckDB as an MCP server for Claude and other LLM clients
🔍 Auto-Discovery Automatically discovers MCP configurations from standard locations
🤖 LLM Integration SQL macros for calling Ollama models (local and cloud)
🛠️ Tool Calling Full function calling support for agentic workflows
🌐 Web Search DuckDuckGo and Brave Search integration
💻 Shell Execution Run shell commands and Python code via UV
📄 Web Scraping Fetch and extract text from web pages
🧠 RAG Support Embeddings and vector similarity search
📦 Rich Extensions Pre-configured with useful DuckDB extensions

📦 DuckDB Extensions

Extension Type Description
httpfs Core HTTP/S3 filesystem access
json Core JSON parsing and extraction
icu Core International unicode support
vss Core Vector similarity search
ducklake Core Delta Lake / Iceberg support
lindel Core Linear algebra operations
http_client Community HTTP GET/POST requests
duckdb_mcp Community MCP protocol support
jsonata Community JSONata query language
shellfs Community Shell command execution
zipfs Community ZIP file access

🚀 Installation

Using pip:

pip install agent-farm

Using uv (recommended):

uv add agent-farm

From source:

git clone https://github.com/bjoernbethge/agent-farm.git
cd agent-farm
uv sync --dev

🎯 Quick Start

Run the MCP server:

agent-farm

Or as a module:

python -m agent_farm

🌾 SQL Macros

🤖 Cloud LLM Models (via Ollama)

SELECT deepseek('Explain quantum computing');
SELECT kimi_think('Solve this step by step: ...');
SELECT qwen3_coder('Write a Python function for...');
SELECT gemini('Summarize this text...');

🔍 Web Search

SELECT ddg_instant('Python programming');
SELECT ddg_abstract('machine learning');
SELECT brave_search('DuckDB tutorial');

💻 Shell & Python Execution

SELECT shell('ls -la');
SELECT py('print(2+2)');
SELECT py_with('requests', 'import requests; print(requests.__version__)');
SELECT py_script('script.py');

🌐 Web Scraping

SELECT fetch('https://example.com');
SELECT fetch_text('https://example.com');
SELECT fetch_json('https://api.example.com/data');
SELECT fetch_ua('https://example.com');  -- with User-Agent

📁 File & Git Operations

SELECT read_file('path/to/file.txt');
SELECT git_status();
SELECT git_log(10);
SELECT git_diff();

🧠 RAG & Embeddings

SELECT embed('Hello world');
SELECT semantic_score('query', 'document');
SELECT rag_query('What is the price?', 'Product: Widget, Price: 49.99');
SELECT rag_think('Complex question', 'Long context...');

⚡ Power Macros

SELECT search_and_summarize('What is DuckDB?');
SELECT analyze_page('https://example.com', 'What is this page about?');
SELECT review_code('src/main.py');
SELECT explain_code('src/main.py');
SELECT generate_py('fibonacci function');

🐳 Docker

docker build -t agent-farm .
docker run -v /data:/data -p 8080:8080 agent-farm

📋 Requirements

  • 🐍 Python >= 3.11
  • 🦆 DuckDB >= 1.1.0
  • 🦙 Ollama (for LLM features)

📄 License

MIT License - see LICENSE for details.


🚜 Happy Farming! 🦆

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agent_farm-0.1.4.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

agent_farm-0.1.4-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file agent_farm-0.1.4.tar.gz.

File metadata

  • Download URL: agent_farm-0.1.4.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for agent_farm-0.1.4.tar.gz
Algorithm Hash digest
SHA256 866a5aafd2e994397b101ebe39d5dd7e14db34cbdaa045030c52b312eb8c6b4a
MD5 d54d44de1520b02800c919ec1d12c08a
BLAKE2b-256 e5654d5f138dbe226acb2b11f92dd55f1b2fadca752b1e18f7d0639dcb8238eb

See more details on using hashes here.

File details

Details for the file agent_farm-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: agent_farm-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.22

File hashes

Hashes for agent_farm-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 deeb33bfab000d2ace9d8a2895211f7871b2b09a576e9341bf767184f53c6016
MD5 ecf000b1e571e41fd28d53e210321606
BLAKE2b-256 34bf5dd732884c7c1e10524cfe798791c843421498e86999dcc156594c359e3c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page