Four small scripts showing two ways to talk to the duckdb-geo MCP server:
| File | What it does |
|---|---|
| query.py | Direct MCP query tool call from Python (no LLM) |
| query.R | Direct MCP query tool call from R via JSON-RPC over HTTP |
| agent_langchain.py | LangGraph ReAct agent that calls MCP tools via tool use |
| agent_ellmer.R | ellmer chat that calls MCP tools via tool use |
All scripts target the public endpoint https://duckdb-mcp.nrp-nautilus.io/mcp.
The agent examples use langchain-openai / ellmer::chat_openai() so they work with any OpenAI-compatible endpoint — set OPENAI_API_KEY (and optionally OPENAI_BASE_URL and MODEL) in your environment. The R agent example also requires Node.js (for npx mcp-remote).