---
title: "How MCP Toolbox turns agent text into ClickHouse vectors"
description: "Google's MCP Toolbox for Databases can declare a Gemini embedding model in YAML and mark tool parameters as `embeddedBy`, so agents send plain text and Toolbox embeds it and binds the vector into ClickHouse SQL for ingestion and cosine-distance search."
url: "https://swe.quest/articles/how-mcp-toolbox-turns-agent-text-into-clickhouse-vectors-fffe93e874cd201d"
canonical: "https://clickhouse.com/blog/mcp-toolbox-clickhouse-vectors"
source: "ClickHouse"
published: "2026-09-07"
difficulty: "medium"
kind: "How-to"
reading_minutes: 22
tags: ["vector-search","ai-agents","analytics","databases"]
---

# How MCP Toolbox turns agent text into ClickHouse vectors

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-09-07, 22 min read, How-to. Original: [https://clickhouse.com/blog/mcp-toolbox-clickhouse-vectors](https://clickhouse.com/blog/mcp-toolbox-clickhouse-vectors)

## Summary

Google's MCP Toolbox for Databases can declare a Gemini embedding model in YAML and mark tool parameters as \`embeddedBy\`, so agents send plain text and Toolbox embeds it and binds the vector into ClickHouse SQL for ingestion and cosine-distance search. Tested against Toolbox 1.9.0 and ClickHouse Cloud 26.4.1, the walkthrough covers installation, prebuilt ClickHouse tools, an HNSW vector\_similarity table, and curated insert/search tools. Several implementation details turned up in testing: vectors are interpolated client-side by clickhouse-go rather than server-side bound, which still escapes injection attempts but bloats query\_log. Gemini embeddings at 768 dimensions are not unit-normalized, so cosine distance should be used consistently. Gemini is the only supported embedding provider, and the \`dimension\` field sets the model's output size, so it must match the index width.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Vector search](https://swe.quest/tags/vector-search.md) (Data & databases)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- Model Context Protocol basics
- vector embeddings ([easy posts on RAG & retrieval](https://swe.quest/tags/rag.md?difficulty=easy))
- ClickHouse SQL ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))

## Keywords

MCP Toolbox for Databases, ClickHouse, Model Context Protocol, Gemini, gemini-embedding-001, HNSW, clickhouse-go, Vertex AI

## Related posts

- [Integrating with ClickHouse MCP](https://swe.quest/articles/integrating-with-clickhouse-mcp-1c5887029a6fb2f3.md): ClickHouse · 2025-06-05 · Medium · 7 min read · AI agents, LLMs, Python, Analytics & OLAP
  The open-source mcp-clickhouse server can be wired into five Python agent frameworks: Agno, DSPy, LangChain, LlamaIndex and PydanticAI.
- [AI Functions in ClickHouse: Upgrade your SQL to the AI age](https://swe.quest/articles/ai-functions-in-clickhouse-upgrade-your-sql-to-the-ai-age-11cec6552950f306.md): ClickHouse · 2026-09-11 · Medium · 12 min read · LLMs, SQL, RAG & retrieval, Analytics & OLAP, Cost optimization
  ClickHouse's beta AI Functions call LLM and embedding providers directly from SQL.
- [Vector Search with ClickHouse - Part 2](https://swe.quest/articles/vector-search-with-clickhouse-part-2-3f7737e1f27114da.md): ClickHouse · 2023-05-31 · Medium · 36 min read · Vector search, Analytics & OLAP, Databases, SQL
  ClickHouse can serve as a vector store by keeping embeddings in Array(Float32) columns and computing distance functions in SQL.
- [Tracing OpenAI agents with ClickStack](https://swe.quest/articles/tracing-openai-agents-with-clickstack-27a1630cee998ca8.md): ClickHouse · 2025-10-27 · Medium · 13 min read · Observability, AI agents, Python, Analytics & OLAP
  OpenAI's agents SDK has built-in tracing that can be redirected from OpenAI's hosted product to a custom TracingExporter.
- [Storing OpenAI embeddings in Postgres with pgvector](https://swe.quest/articles/storing-openai-embeddings-in-postgres-with-pgvector-19a5d03614f86fc6.md): Supabase · 2023-02-06 · Medium · 11 min read · Vector search, PostgreSQL, RAG & retrieval, LLMs
  pgvector adds a vector data type and distance operators (Euclidean \<-\>, negative inner product \<#\>, cosine \<=\>) to Postgres, so OpenAI text-embedding-ada-002 embeddings (1536 dimensions) can be stored and queried for similarity directly in the database.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
