Skip to content

Commit 1e7a0f9

Browse files
authored
Merge pull request #69 from DHTMLX/add-mcp-server-guide-5173
[add] MCP server guide for DHTMLX Spreadsheet
2 parents 52a125d + ad6c148 commit 1e7a0f9

5 files changed

Lines changed: 263 additions & 1 deletion

File tree

‎docs/guides.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Shows how to load data into Spreadsheet, handle events, and use the main functio
3838
- [Integration with Svelte](svelte_integration.md) - GitHub demo of using Spreadsheet in a Svelte app
3939
- [Integration with Vue.js](vuejs_integration.md) - GitHub demo of using Spreadsheet in a Vue app
4040

41+
### AI-assisted development
42+
43+
- [DHTMLX MCP server](mcp-server.md) - connect AI coding assistants to live Spreadsheet documentation
44+
4145
## User guides
4246

4347
The user guides make working with Spreadsheet easy for your users.

‎docs/how_to_start.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,4 @@ That's all. In four steps you get a handy tool for working with tabular data. No
145145
- [Spreadsheet overview](/)
146146
- [](guides.md)
147147
- [](api/api_overview.md)
148+
- [](mcp-server.md)

‎docs/index.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,4 @@ To learn more about DHTMLX Spreadsheet, see these guides:
6666

6767
- [API overview](api/api_overview.md)
6868
- [Guides](guides.md)
69+
- [MCP server](mcp-server.md) for AI coding assistants

‎docs/mcp-server.md‎

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
1+
---
2+
sidebar_label: DHTMLX MCP server
3+
title: DHTMLX Spreadsheet MCP server for formulas and formatting
4+
description: Live DHTMLX Spreadsheet documentation reaches AI assistants through the MCP server, spanning formulas, cell formatting, data loading, and sheet management.
5+
---
6+
7+
# DHTMLX Spreadsheet MCP server: formulas, formatting, and sheet APIs
8+
9+
[DHTMLX Spreadsheet](/) applications depend on getting [formulas](/functions/), [cell formatting](/data_formatting/), [data loading](/loading_data/), and [sheet management](/working_with_sheets/) exactly right. None of that comes from memorized training data: it takes current formula syntax, the API methods Spreadsheet ships today, and configuration options that haven't changed since.
10+
11+
The DHTMLX MCP server addresses this by giving the assistant direct access to the live Spreadsheet reference wherever it's working. Point it at [number formats](/number_formatting/), the [Sheet Manager API](/api/overview/sheetmanager_overview/), or [data loading](/loading_data/), and it checks the current documentation before generating a single line of code.
12+
13+
### MCP endpoint
14+
15+
~~~jsx
16+
https://docs.dhtmlx.com/mcp
17+
~~~
18+
19+
:::note
20+
The DHTMLX MCP server covers all major DHTMLX products, not only DHTMLX Spreadsheet. The same endpoint and configuration instructions work regardless of which DHTMLX component you are building with.
21+
:::
22+
23+
## MCP server coverage for Spreadsheet
24+
25+
Every page of the DHTMLX Spreadsheet documentation is searchable through the MCP server. Typical use cases:
26+
27+
- Looking up the current API for spreadsheet [methods](/api/overview/methods_overview/), [events](/api/overview/events_overview/), and [properties](/api/overview/properties_overview/), including signatures and return types.
28+
- Generating ready-to-run Spreadsheet [initialization](/initialization/) and [configuration](/configuration/) code based on a description of what you need.
29+
- Exploring [number formats](/number_formatting/) (common, number, percent, currency, date, time, and others) and understanding how to define custom format masks.
30+
- Working with [formulas and functions](/functions/): finding supported functions, understanding formula syntax, and using the calculation API.
31+
- Configuring [columns and rows](/work_with_rows_cols/), including setting widths, hiding, and freezing.
32+
- Applying cell and range [formatting](/data_formatting/) and styles, including text color, alignment, borders, and background colors.
33+
- Handling [Spreadsheet events](/handling_events/) to respond to value changes, cell selection, editor actions, and sheet-level interactions.
34+
- Exploring [multi-sheet support](/working_with_sheets/), [data loading and export](/loading_data/) (JSON and Excel), and integration with frameworks such as [React](/react/), [Vue](/vuejs_integration/), [Angular](/angular_integration/), and [Svelte](/svelte_integration/).
35+
36+
## How the assistant queries the MCP server
37+
38+
Every query to the DHTMLX MCP server passes through a Retrieval-Augmented Generation (RAG) pipeline built on the Model Context Protocol (MCP). Depending on what's being asked, the server hands it to one of two workflows: *Search*, which surfaces matching reference pages for the assistant to build from, or *Inference*, which reads those pages and answers on its own. Ahead of that, the assistant sorts out which piece of the request needs a documentation lookup and covers the rest on its own.
39+
40+
Take the prompt *"How do I set up DHTMLX Spreadsheet so it pulls live stock prices from my company's market data feed and formats them as currency?"* as an example:
41+
42+
1. The part that needs documentation: how to apply a currency number format mask to a range of cells.
43+
2. The server locates the number formatting documentation that matches it.
44+
3. Since the request calls for generated code, *Search* handles it (a narrower factual question would go to *Inference* instead).
45+
4. *Search* retrieves the matching pages from a vector index of the current Spreadsheet documentation.
46+
5. Those pages come back to the assistant as context.
47+
6. The assistant applies the format mask using that context, then writes the market-data fetch logic from its own knowledge instead of guessing at the Spreadsheet API.
48+
49+
The result: Spreadsheet code generation stays anchored to today's formula and formatting API.
50+
51+
## Wiring the MCP server into your AI tool
52+
53+
Registering the MCP server is a one-time step per tool, using either a CLI command or a JSON configuration snippet depending on the tool. Either way, point your tool at this URL:
54+
55+
~~~jsx
56+
https://docs.dhtmlx.com/mcp
57+
~~~
58+
59+
After that, every Spreadsheet project opened in that tool can reach the live documentation.
60+
61+
Popular tools each get their own setup steps below.
62+
63+
### Claude Code
64+
65+
:::info
66+
Claude Code documents every MCP connection option in its [official documentation](https://code.claude.com/docs/en/mcp).
67+
:::
68+
69+
To register the server from the command line, run:
70+
71+
~~~jsx
72+
claude mcp add --transport http dhtmlx-mcp https://docs.dhtmlx.com/mcp
73+
~~~
74+
75+
For manual setup, add the following configuration to your `.mcp.json`:
76+
77+
~~~jsx
78+
{
79+
"mcpServers": {
80+
"dhtmlx-mcp": {
81+
"type": "http",
82+
"url": "https://docs.dhtmlx.com/mcp"
83+
}
84+
}
85+
}
86+
~~~
87+
88+
### Cursor
89+
90+
:::info
91+
Cursor documents its MCP setup in full in the [official documentation](https://cursor.com/en-US/docs/mcp).
92+
:::
93+
94+
To add the server:
95+
96+
1. Open Settings (`Cmd+Shift+J` on Mac, `Ctrl+Shift+J` on Windows/Linux)
97+
2. Go to **Tools & MCP**
98+
3. Click **Add Custom MCP**
99+
4. Paste the following config:
100+
101+
~~~jsx
102+
{
103+
"mcpServers": {
104+
"dhtmlx-mcp": {
105+
"url": "https://docs.dhtmlx.com/mcp"
106+
}
107+
}
108+
}
109+
~~~
110+
111+
### Google Antigravity
112+
113+
#### Antigravity 2.0
114+
115+
:::info
116+
See the [official documentation](https://antigravity.google/docs/mcp) for everything on MCP server integration in Antigravity.
117+
:::
118+
119+
These are the steps to complete for connecting DHTMLX MCP server with Google Antigravity:
120+
121+
1. Open the command palette
122+
2. Type "mcp add"
123+
3. Select "HTTP"
124+
4. Provide the following values:
125+
- Name:
126+
~~~jsx
127+
dhtmlx-mcp
128+
~~~
129+
- URL:
130+
~~~jsx
131+
https://docs.dhtmlx.com/mcp
132+
~~~
133+
134+
#### Antigravity CLI
135+
136+
:::info
137+
See the [related guide](https://antigravity.google/docs/gcli-migration#mcp-config-formatting-changes) if you're migrating from Gemini CLI to Antigravity CLI.
138+
:::
139+
140+
To connect the DHTMLX MCP server to Antigravity CLI, create `mcp_config.json` in one of these locations:
141+
142+
- Global: `~/.gemini/config/mcp_config.json`
143+
- Workspace: `.agents/mcp_config.json`
144+
145+
Add the following configuration:
146+
147+
~~~jsx
148+
{
149+
"mcpServers": {
150+
"dhtmlx-mcp": {
151+
"serverUrl": "https://docs.dhtmlx.com/mcp"
152+
}
153+
}
154+
}
155+
~~~
156+
157+
Then run `agy` in the terminal.
158+
159+
### ChatGPT
160+
161+
:::info
162+
For the complete MCP connector setup in ChatGPT, see the [official documentation](https://help.openai.com/en/articles/12584461-developer-mode-and-mcp-apps-in-chatgpt).
163+
:::
164+
165+
Steps to configure the connector:
166+
167+
1. Go to **Settings** → **Apps & Connectors**
168+
2. Click **Advanced settings**
169+
3. Enable **Developer mode**
170+
4. Return to **Apps & Connectors** and click "Create"
171+
5. Fill in the connector details:
172+
- Name:
173+
~~~jsx
174+
dhtmlx-mcp
175+
~~~
176+
- URL:
177+
~~~jsx
178+
https://docs.dhtmlx.com/mcp
179+
~~~
180+
- Authentication: `No authentication`
181+
6. Click **Create**
182+
183+
After you create the connector, ChatGPT pulls documentation from the MCP server during conversations.
184+
185+
:::info
186+
For intensive coding workflows, other MCP-aware tools may be a better fit.
187+
:::
188+
189+
### Other tools
190+
191+
Look for "Model Context Protocol" or "Context Sources" in the settings of any other AI coding tool, and add `https://docs.dhtmlx.com/mcp` there as a custom source.
192+
193+
## Data privacy notes
194+
195+
The MCP server runs as a hosted service. It does not run locally, does not read files from your environment, and does not store personal user information.
196+
197+
Queries may be logged for debugging and service improvement purposes.
198+
199+
Organizations that require stricter privacy controls can request a commercial deployment option with query logging disabled. For inquiries, contact `info@dhtmlx.com`.
200+
201+
## Sample prompts for building spreadsheets
202+
203+
The more specific the goal in your prompt, the more precisely the assistant can target the right part of the Spreadsheet API. Prompts below are grouped by task category, ready to copy and adjust to your data.
204+
205+
**Loading and exporting data**
206+
207+
~~~
208+
I want to load data into DHTMLX Spreadsheet from a JSON file. How do I do that?
209+
~~~
210+
~~~
211+
How do I export a DHTMLX Spreadsheet to an Excel file? What method should I call?
212+
~~~
213+
~~~
214+
What's the difference between DHTMLX Spreadsheet's load() and parse() methods for JSON data?
215+
~~~
216+
217+
**Working with cells and ranges**
218+
219+
~~~
220+
How do I add data validation with a drop-down list to cells in DHTMLX Spreadsheet? Use the docs.
221+
~~~
222+
~~~
223+
How do I use setStyle() to apply background color and text formatting to a range of cells in DHTMLX Spreadsheet?
224+
~~~
225+
~~~
226+
How do I merge cells and set alignment in a specific range in DHTMLX Spreadsheet?
227+
~~~
228+
229+
**Formulas and data validation**
230+
231+
~~~
232+
What formula functions are available in DHTMLX Spreadsheet, and how do I use custom formulas?
233+
~~~
234+
~~~
235+
How do I set a dropdown list cell type for a column in DHTMLX Spreadsheet?
236+
~~~
237+
238+
**Columns, rows, and sheets**
239+
240+
~~~
241+
How do I freeze specific rows and columns in DHTMLX Spreadsheet?
242+
~~~
243+
~~~
244+
How do I add and switch between sheets in DHTMLX Spreadsheet programmatically?
245+
~~~
246+
~~~
247+
How do I handle the afterEditEnd event and get the updated cell value?
248+
~~~
249+
250+
## Prompting tips for Spreadsheet work
251+
252+
- **Name the target object.** Distinguish between the spreadsheet instance, a specific sheet, a cell, and a range. For example: "on the spreadsheet instance" vs. "for a specific cell range" vs. "on sheet 2". A narrower target helps the server retrieve the right reference pages.
253+
- **Include the cell type or data format.** Prompts like "a date number format" or "a number format with two decimal places" retrieve more precise documentation than a generic "a cell". Mention the type whenever you configure columns or apply formats.
254+
- **Add "Use the docs"** to your prompt. This phrase signals to the assistant that it should trigger an MCP lookup instead of answering from training data alone. It is especially useful when working with formulas or validation, where training data is most likely to be stale.
255+
- **Be specific about the scope of the operation.** Spreadsheet operations can target a single cell, a range, a full column or row, or an entire sheet. State the scope explicitly (for example, "for the entire column B" or "across all sheets") so the assistant selects the correct method overload or API path.

‎sidebars.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ module.exports = {
276276
]
277277
},
278278
"using_typescript",
279-
"awaitredraw"
279+
"awaitredraw",
280+
"mcp-server"
280281
]
281282
},
282283
{

0 commit comments

Comments
 (0)