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.

DuckDB - Ollama - Docker - Query Farm

Features

  • 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 community extensions

Installation

Using uv (recommended): uv sync --dev

Or with pip: pip install -e .

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...');

Web Search

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

Shell and Python Execution

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

Web Scraping

SELECT fetch('https://example.com'); SELECT fetch_text('https://example.com'); SELECT fetch_json('https://api.example.com/data');

File and Git Operations

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

RAG and Embeddings

SELECT rag_query('What is the price?', 'Product: Widget, Price: 49.99'); SELECT embed('Hello world'); SELECT semantic_score('query', 'document');

Combined 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');

Docker

docker build -t agent-farm . docker run -it agent-farm

Requirements

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

License

MIT

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.3.tar.gz (8.7 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.3-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for agent_farm-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9ec84106af6c80fd750d3b38e3de8fe1bc60f8cef11d94350242c024da9de04d
MD5 25bc5a137d932aaf30fe7df3a63a7289
BLAKE2b-256 0682116e6610d7138ac5c10493ba466ef0fe983e11858d4cf5a3ef0726e5af79

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for agent_farm-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7af8735e47d8c85e7642ea6b0a1fd3f1690ee5ce5c95df7e58b69a4c5c094fc3
MD5 3dbfd5a7394a8fa78af44e7ccedd718c
BLAKE2b-256 f8db4285e9544af52495716877efbe128e1a41ca3cced5c09fe93b8f47679c6a

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