
Florentine Ai
io.github.florentine-ai由 GitHub 账号 florentine-ai 发布v0.2.1更新于 Oct 24, 2026
MCP server for Florentine.ai - Natural language to MongoDB aggregations
概览
Florentine.ai MCP 服务器,把自然语言问题转换为 MongoDB 或 MySQL 查询,并返回查询语句、原始结果或自然语言答案。
- 可以做什么
- 列出可查询的集合与数据表,包括描述、键和值类型,让助手了解可查询的数据范围。用自然语言提问,按配置返回生成的数据库查询、原始查询结果或自然语言答案。通过必填输入过滤条件,让每个用户只能看到自己有权访问的数据。通过会话 ID 在多次请求间保留服务端聊天上下文。
- 适用场景
- 适合希望用自然语言查询自有 MongoDB 或 MySQL 数据、而不必手写聚合管道或 SQL 的场景,尤其是需要按用户过滤数据的多租户应用。
- 运行要求
- 需要 Node.js 18 或更高版本,通过 npx 本地运行,并指定 static 或 dynamic 模式参数。需要 Florentine.ai 账户,已连接数据库且至少有一个已分析并启用的集合或数据表。需要在 FLORENTINE_TOKEN 中提供 Florentine.ai API 密钥,并提供 LLM 服务商密钥:可保存在账户中,或以 LLM_KEY 配合 LLM_SERVICE 传入。
安装
在 SourceWeft 中
- 打开 控制台中的 Florentine Ai,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
Florentine.ai MCP Server - Talk to your MongoDB & MySQL data
The Florentine.ai Model Context Protocol (MCP) Server lets you integrate natural language querying for your MongoDB & MySQL data directly into your custom AI Agent or AI Desktop App.
Questions are forwarded by the AI Agent to the MCP Server, transformed into database queries and the query results are returned to the agent for further processing.
Also has a couple of extra features under the hood, e.g.:
- Secure data separation for multi-tenant usage
- Automated schema exploration
- Semantic vector search/RAG support with automated embedding creation
- Advanced lookup support
- Exclusion of keys
Note: If you are looking for our API you can find it here.
Contents
- Prerequisites
- Installation
- Available Tools
- Arguments
- Authentication
- Connect your LLM account
- Integration Modes
- Return Types
- Secure Data Separation for multi-tenant usage
- Sessions
- Errors
Prerequisites
- Node.js >= v18.0.0
- A Florentine.ai account (create a free account here)
- A connected database and at least one analyzed and activated collection/table in your Florentine.ai account
- A Florentine.ai API Key (you can find yours on your account dashboard)
Installation
A detailed documentation of the MCP Server can be found here in our docs.
You can easily run the server using npx. See the following example for Claude Desktop (claude_desktop_config.json):
Available Tools
- florentine_list_collections --> Lists all currently active collections/tables that can be queried. That includes descriptions, keys and type of values.
- florentine_ask --> Receives a question and returns a query, query result or answer (depending on the
returnTypessetting).
Arguments
Authentication
The Florentine.ai MCP Server uses an API key to authenticate requests. You can view and manage your API key on your account dashboard. The key must be added as an ENV variable to the configuration setup of the MCP server:
Connect your LLM account
Florentine.ai works as a bring your own key model, so you need to provide your LLM API key (OpenAI, Google, Anthropic, Deepseek) in your MCP requests.
You have two options how you can add your LLM API key:
Option 1: Save your LLM key in your account (recommended)
The easiest way to connect to your LLM provider is to save your LLM API key in your Florentine.ai dashboard.
- Add your API key
- Select your LLM provider (OpenAI, Deepseek, Google or Anthropic)
- Click Save
Option 2: Provide your LLM key inside the MCP server config env variables
If you prefer not to store the key in your Florentine.ai account or want to use multiple LLM keys, you can pass the key inside the MCP server config:
Note: If you provide a
LLM_KEYinside the env variables of the MCP server config, it will override any key stored in your account.
Integration Modes
You will have to set the operating mode in the args array of your MCP Server config to either static or dynamic:
Static Mode
The static mode should be used if you integrate Florentine.ai into an existing external MCP client such as a MCP-ready Desktop App like Claude Desktop or Dive AI.
In static mode you set all parameters (such as Return Types, Required Inputs, etc.) as env variables inside the config json. This means that these parameters will remain static until you change the setup config and will be sent with every request to Florentine.ai. See the following example:
Environment variables
Dynamic Mode
The dynamic mode should be used if you integrate Florentine.ai into your own custom MCP client.
In dynamic mode you can pass all parameters (such as Return Types, Required Inputs, etc.) directly to the florentine_ask tool. This means you can dynamically inject individual parameters to every request forwarded to Florentine.ai (i.e. a user id).
In order to be able to pass in values dynamically you have to overwrite the florentine_ask tool method inside your custom client/agent. Look at the following example using the standard @modelcontextprotocol Typescript SDK:
Example breakdown
Let's see what is happening in the example above in detail.
First of all we create the mcp client and connect it:
Note: You may use
envvariables indynamicmode as well. However if you specify parameters dynamically these will overwrite existingenvvalues for the parameters.
Next, we save the original callTool function to a variable:
Then we create an enhanceAskParameters function that takes a question as input, fetches additional parameters (e.g. returnTypes, requiredInputs etc.) for the user and returns the merged parameters:
Then we overwrite the original callTool function with an implementation that enhances the florentine_ask tool with the parameters coming from enhanceAskParameters and call the original callTool function we save to the variable originalCallTool:
Finally we can call the florentine_ask tool with a question and have the user-specific parameters dynamically injected:
IMPORTANT: Make sure that you never use dynamic mode without overwriting
florentine_askimplementation. If you do not overwrite it your client/agent will directly use the mcp server-side implementation of theflorentine_asktool with all additional parameters. So the client/agent will decide on its own what values to fill in forreturnTypes,requiredInputsetc. That will result in unexpected behavior and lead to errors and wrong results.
florentine_ask Parameters
Return Types
By default, the florentine_ask tool returns the result type configured in your Florentine.ai account (default: result). You can override this per request by specifying a returnTypes array with any combination of the following three steps:
- Query Generation: The question is converted into a database query (MongoDB aggregation pipeline or MySQL query).
- Query Execution: The query runs against the database using the connection string you provided.
- Answer Generation: The structured result is transformed into a natural language answer.
Providing Return Types
You have two options to include a returnTypes array:
- As the
RETURN_TYPESenvvariable in your MCP setup config (possible instaticanddynamicmode) - As the
returnTypesparameter to theflorentine_asktool (possible only indynamicmode)
As an env variable you provide the value as a stringified json array:
As a tool parameter you provide the value as an array:
Return Types Configuration
You can choose which of these steps you want returned by specifying a returnTypes array with any combination of:
Secure Data Separation for multi-tenant usage
You can enable secure data separation by ensuring queries filter data based on provided values which we call Required Inputs.
These values are added to the query by the Florentine.ai transformation layer after the query generation by the LLM. Thus Florentine.ai can assure each user only retrieves the data he is eligible to.
Keys are defined as Required Input in your account, please refer to the section in our official docs on how to do that.
Providing Required Inputs
You have two options to include a requiredInputs array:
- As the
REQUIRED_INPUTSenvvariable in your MCP setup config (possible instaticanddynamicmode) - As the
requiredInputsparameter to theflorentine_asktool (possible only indynamicmode)
As an env variable you provide the value as a stringified json array:
As a tool parameter you provide the value as an array:
You may also provide a database and a collections array in case you have Required Inputs with the same keyPath in multiple collections/tables but different value for the collections/tables:
Required Inputs Configuration
Supported Value Types
Based on the type of the values for the key you have different options on what you can provide as a Required Input value:
Usage Examples
Note: We will only provide examples as tool parameter input. For
envimplementation you just change the key name toREQUIRED_INPUTSand stringify the json.
Example type: String
Usecase: A user should only be able to see statistics of the players he frequently plays with.
Solution: Restricting access by player name to a group of 4 players.
Example type: ObjectId
Usecase: A user should only be able to see the revenue of his own products.
Solution: Restricting the access by the accountId to one specific account.
Example type: Boolean
Usecase: Every analysis of customers should only be performed on paying customers.
Solution: Restricting the access by isPaidAccount to paying customers only.
Example type: Number
Usecase: An employee should only be allowed to see payment information for payments below a certain amount.
Solution: Restricting the access by amount to payments below 10.000.
Example type: Date
Usecase: The analysis of financial data should only include one specific year.
Solution: Restricting the access by transactionDate to all transactions in 2024.
Sessions
Sessions allow Florentine.ai to enable a server-side chat history.
Since the client/agent including the MCP server usually keeps track of the chat history itself it is not absolutely essential to add a session.
However it might still help Florentine.ai to get a better understanding of the context and might increase result quality.
Providing a session
You have two options to include a sessionId:
- As the
SESSION_IDenvvariable in your MCP setup config (possible instaticanddynamicmode) - As the
sessionIdparameter to theflorentine_asktool (possible only indynamicmode)
As an env variable:
As a tool parameter:
Errors
All errors from the MCP Server tool calls follow this consistent JSON structure:
Custom client error handling
The error object is returned as a stringified json in the content array:
You may parse the JSON in text and handle the different errors inside your custom client/agent.
Common Errors
来源:README.md,提交 1008deb
工具
0版本历史
1- v0.2.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分