@mini_7/material-react-table-mcp 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -0
- package/data/MIGRATION.md +136 -0
- package/data/api.json +5379 -0
- package/data/examples/advanced.tsx +309 -0
- package/data/examples/aggregation-and-grouping.tsx +153 -0
- package/data/examples/aggregation-multi.tsx +105 -0
- package/data/examples/alternate-column-filtering.tsx +49 -0
- package/data/examples/alternate-detail-panel.tsx +81 -0
- package/data/examples/alternate-pagination.tsx +23 -0
- package/data/examples/basic.tsx +109 -0
- package/data/examples/chart-detail-panel.tsx +89 -0
- package/data/examples/column-actions-space.tsx +44 -0
- package/data/examples/column-alignment.tsx +70 -0
- package/data/examples/custom-column-actions.tsx +109 -0
- package/data/examples/custom-column-filtering-ui.tsx +89 -0
- package/data/examples/custom-headless.tsx +125 -0
- package/data/examples/custom-top-toolbar.tsx +88 -0
- package/data/examples/customize-display-columns.tsx +85 -0
- package/data/examples/customize-filter-components.tsx +101 -0
- package/data/examples/customize-filter-modes.tsx +73 -0
- package/data/examples/customize-filter-variants.tsx +116 -0
- package/data/examples/customize-global-filter-component.tsx +52 -0
- package/data/examples/customize-remove-column-grouping.tsx +94 -0
- package/data/examples/customize-row-selection.tsx +54 -0
- package/data/examples/customize-table-styles.tsx +100 -0
- package/data/examples/disable-column-actions.tsx +37 -0
- package/data/examples/disable-column-hiding.tsx +90 -0
- package/data/examples/disable-density-toggle.tsx +49 -0
- package/data/examples/dynamic-columns.tsx +189 -0
- package/data/examples/editing-crud-cell.tsx +377 -0
- package/data/examples/editing-crud-modal.tsx +370 -0
- package/data/examples/editing-crud-row.tsx +333 -0
- package/data/examples/editing-crud-table.tsx +369 -0
- package/data/examples/editing-crud-tree.tsx +416 -0
- package/data/examples/enable-cell-actions.tsx +76 -0
- package/data/examples/enable-click-to-copy.tsx +39 -0
- package/data/examples/enable-column-grouping.tsx +120 -0
- package/data/examples/enable-column-ordering.tsx +48 -0
- package/data/examples/enable-column-pinning.tsx +69 -0
- package/data/examples/enable-column-resizing.tsx +56 -0
- package/data/examples/enable-column-virtualization.tsx +27 -0
- package/data/examples/enable-detail-panel-conditionally.tsx +78 -0
- package/data/examples/enable-detail-panel-virtualized.tsx +80 -0
- package/data/examples/enable-expanding-tree.tsx +110 -0
- package/data/examples/enable-filter-facet-values.tsx +65 -0
- package/data/examples/enable-row-dragging.tsx +137 -0
- package/data/examples/enable-row-numbers-original.tsx +48 -0
- package/data/examples/enable-row-numbers-static.tsx +48 -0
- package/data/examples/enable-row-ordering.tsx +57 -0
- package/data/examples/enable-row-pinning-select.tsx +76 -0
- package/data/examples/enable-row-pinning-static.tsx +50 -0
- package/data/examples/enable-row-pinning-sticky.tsx +69 -0
- package/data/examples/enable-row-selection.tsx +96 -0
- package/data/examples/enable-row-virtualization.tsx +101 -0
- package/data/examples/enable-sticky-header.tsx +59 -0
- package/data/examples/expanding-tree-expanded.tsx +121 -0
- package/data/examples/expanding-tree-flat-parse.tsx +125 -0
- package/data/examples/expanding-tree-root-expanded.tsx +151 -0
- package/data/examples/export-to-csv.tsx +114 -0
- package/data/examples/export-to-pdf.tsx +104 -0
- package/data/examples/external-toolbar.tsx +108 -0
- package/data/examples/font-awesome-icons.tsx +106 -0
- package/data/examples/infinite-scrolling.tsx +208 -0
- package/data/examples/lazy-detail-panel.tsx +262 -0
- package/data/examples/lazy-sub-rows.tsx +190 -0
- package/data/examples/linear-progress.tsx +66 -0
- package/data/examples/loading.tsx +50 -0
- package/data/examples/localization-i18n-ar.tsx +65 -0
- package/data/examples/localization-i18n-az.tsx +60 -0
- package/data/examples/localization-i18n-bg.tsx +60 -0
- package/data/examples/localization-i18n-cs.tsx +60 -0
- package/data/examples/localization-i18n-da.tsx +60 -0
- package/data/examples/localization-i18n-de.tsx +60 -0
- package/data/examples/localization-i18n-el.tsx +60 -0
- package/data/examples/localization-i18n-en.tsx +60 -0
- package/data/examples/localization-i18n-es.tsx +60 -0
- package/data/examples/localization-i18n-et.tsx +60 -0
- package/data/examples/localization-i18n-fa.tsx +66 -0
- package/data/examples/localization-i18n-fi.tsx +60 -0
- package/data/examples/localization-i18n-fr.tsx +60 -0
- package/data/examples/localization-i18n-he.tsx +66 -0
- package/data/examples/localization-i18n-hr.tsx +60 -0
- package/data/examples/localization-i18n-hu.tsx +60 -0
- package/data/examples/localization-i18n-hy.tsx +65 -0
- package/data/examples/localization-i18n-id.tsx +60 -0
- package/data/examples/localization-i18n-it.tsx +60 -0
- package/data/examples/localization-i18n-ja.tsx +60 -0
- package/data/examples/localization-i18n-ko.tsx +60 -0
- package/data/examples/localization-i18n-nl.tsx +60 -0
- package/data/examples/localization-i18n-no.tsx +60 -0
- package/data/examples/localization-i18n-np.tsx +60 -0
- package/data/examples/localization-i18n-pl.tsx +60 -0
- package/data/examples/localization-i18n-pt-BR.tsx +60 -0
- package/data/examples/localization-i18n-pt.tsx +60 -0
- package/data/examples/localization-i18n-ro.tsx +60 -0
- package/data/examples/localization-i18n-ru.tsx +60 -0
- package/data/examples/localization-i18n-sk.tsx +60 -0
- package/data/examples/localization-i18n-sr-Cyrl-RS.tsx +60 -0
- package/data/examples/localization-i18n-sr-Latn-RS.tsx +60 -0
- package/data/examples/localization-i18n-sv.tsx +60 -0
- package/data/examples/localization-i18n-tr.tsx +60 -0
- package/data/examples/localization-i18n-uk.tsx +60 -0
- package/data/examples/localization-i18n-vi.tsx +60 -0
- package/data/examples/localization-i18n-zh-hans.tsx +60 -0
- package/data/examples/localization-i18n-zh-hant.tsx +60 -0
- package/data/examples/manual-selection.tsx +105 -0
- package/data/examples/minimal.tsx +78 -0
- package/data/examples/mui-theme.tsx +136 -0
- package/data/examples/multi-sorting.tsx +58 -0
- package/data/examples/persistent-state.tsx +184 -0
- package/data/examples/react-query.tsx +182 -0
- package/data/examples/remote.tsx +150 -0
- package/data/examples/row-actions-buttons.tsx +89 -0
- package/data/examples/row-actions-menu-items.tsx +64 -0
- package/data/examples/single-row-selection.tsx +98 -0
- package/data/examples/virtualized.tsx +138 -0
- package/data/guides/accessibility.md +119 -0
- package/data/guides/aggregation.md +210 -0
- package/data/guides/async-loading.md +132 -0
- package/data/guides/best-practices.md +363 -0
- package/data/guides/cell-actions.md +139 -0
- package/data/guides/click-to-copy.md +67 -0
- package/data/guides/column-actions.md +69 -0
- package/data/guides/column-filtering.md +366 -0
- package/data/guides/column-grouping.md +192 -0
- package/data/guides/column-hiding.md +133 -0
- package/data/guides/column-ordering-dnd.md +99 -0
- package/data/guides/column-pinning.md +72 -0
- package/data/guides/column-resizing.md +157 -0
- package/data/guides/column-size.md +162 -0
- package/data/guides/customize-components.md +395 -0
- package/data/guides/customize-icons.md +35 -0
- package/data/guides/data-columns.md +292 -0
- package/data/guides/density-toggle.md +46 -0
- package/data/guides/detail-panel.md +195 -0
- package/data/guides/display-columns.md +135 -0
- package/data/guides/editing.md +367 -0
- package/data/guides/expanding-sub-rows.md +194 -0
- package/data/guides/full-screen-toggle.md +63 -0
- package/data/guides/global-filtering.md +237 -0
- package/data/guides/localization.md +57 -0
- package/data/guides/memoization.md +157 -0
- package/data/guides/pagination.md +171 -0
- package/data/guides/row-actions.md +116 -0
- package/data/guides/row-numbers.md +24 -0
- package/data/guides/row-ordering-dnd.md +51 -0
- package/data/guides/row-pinning.md +96 -0
- package/data/guides/row-selection.md +237 -0
- package/data/guides/sorting.md +190 -0
- package/data/guides/state-management.md +165 -0
- package/data/guides/sticky-header.md +41 -0
- package/data/guides/table-event-listeners.md +103 -0
- package/data/guides/toolbar-customization.md +251 -0
- package/data/guides/virtualization.md +183 -0
- package/data/index.json +1930 -0
- package/data/reference/mrt-components.md +183 -0
- package/data/reference/mrt-hooks.md +125 -0
- package/data/skills/composable-components/SKILL.md +189 -0
- package/data/skills/customization/SKILL.md +190 -0
- package/data/skills/drag-and-drop-ordering/SKILL.md +227 -0
- package/data/skills/editing/SKILL.md +243 -0
- package/data/skills/filtering/SKILL.md +213 -0
- package/data/skills/getting-started/SKILL.md +213 -0
- package/data/skills/localization/SKILL.md +182 -0
- package/data/skills/migrate-v3-to-v4/SKILL.md +161 -0
- package/data/skills/state-and-server-data/SKILL.md +200 -0
- package/data/skills/virtualization/SKILL.md +203 -0
- package/dist/data.js +137 -0
- package/dist/index.js +232 -0
- package/package.json +50 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { CATEGORIES, listSkills, loadApi, loadDocsIndex, loadExample, loadGuide, loadMigrationGuide, loadReference, loadSkill, searchApi, searchDocs, } from './data.js';
|
|
6
|
+
const api = loadApi();
|
|
7
|
+
const docs = loadDocsIndex();
|
|
8
|
+
const categoryDescriptions = {
|
|
9
|
+
tableOptions: 'options passed to useMaterialReactTable (props of MaterialReactTable)',
|
|
10
|
+
columnOptions: 'options on an MRT_ColumnDef column definition',
|
|
11
|
+
stateOptions: 'slices of MRT_TableState, each with an initialState key, a state key, and an on*Change callback',
|
|
12
|
+
tableInstanceAPIs: 'methods on the MRT_TableInstance returned by useMaterialReactTable',
|
|
13
|
+
columnInstanceAPIs: 'methods on an MRT_Column instance',
|
|
14
|
+
rowInstanceAPIs: 'methods on an MRT_Row instance',
|
|
15
|
+
cellInstanceAPIs: 'methods on an MRT_Cell instance',
|
|
16
|
+
};
|
|
17
|
+
const formatEntry = (entry, category) => {
|
|
18
|
+
const lines = [`### ${entry.name}`, `Category: ${category}`];
|
|
19
|
+
if (entry.type)
|
|
20
|
+
lines.push(`Type: \`${entry.type}\``);
|
|
21
|
+
if (entry.defaultValue)
|
|
22
|
+
lines.push(`Default: \`${entry.defaultValue}\``);
|
|
23
|
+
if (entry.required)
|
|
24
|
+
lines.push('Required: yes');
|
|
25
|
+
if (entry.source)
|
|
26
|
+
lines.push(`Source library: ${entry.source}`);
|
|
27
|
+
if (entry.description)
|
|
28
|
+
lines.push('', entry.description);
|
|
29
|
+
if (entry.link)
|
|
30
|
+
lines.push('', `More: ${entry.linkText || entry.link} <${entry.link}>`);
|
|
31
|
+
return lines.join('\n');
|
|
32
|
+
};
|
|
33
|
+
const text = (value) => ({
|
|
34
|
+
content: [{ type: 'text', text: value }],
|
|
35
|
+
});
|
|
36
|
+
const server = new McpServer({
|
|
37
|
+
name: 'material-react-table',
|
|
38
|
+
version: api.libraryVersion,
|
|
39
|
+
});
|
|
40
|
+
server.registerTool('search_mrt_api', {
|
|
41
|
+
title: 'Search the Material React Table API',
|
|
42
|
+
description: `Search Material React Table V${api.libraryVersion.split('.')[0]} (@mini_7/material-react-table) table options, column options, state slices, and table/column/row/cell instance methods by name or description. Use this first when unsure which option or method exists.`,
|
|
43
|
+
inputSchema: {
|
|
44
|
+
query: z
|
|
45
|
+
.string()
|
|
46
|
+
.min(1)
|
|
47
|
+
.describe('Words to match against option or method names and descriptions, e.g. "pinning", "muiTableBodyRowProps", "manual pagination".'),
|
|
48
|
+
categories: z
|
|
49
|
+
.array(z.enum(CATEGORIES))
|
|
50
|
+
.optional()
|
|
51
|
+
.describe('Restrict the search to these categories. Defaults to all.'),
|
|
52
|
+
limit: z
|
|
53
|
+
.number()
|
|
54
|
+
.int()
|
|
55
|
+
.min(1)
|
|
56
|
+
.max(100)
|
|
57
|
+
.optional()
|
|
58
|
+
.describe('Maximum hits to return. Defaults to 20.'),
|
|
59
|
+
},
|
|
60
|
+
}, async ({ query, categories, limit }) => {
|
|
61
|
+
const hits = searchApi(api, query, categories ?? CATEGORIES, limit ?? 20);
|
|
62
|
+
if (hits.length === 0) {
|
|
63
|
+
return text(`No Material React Table API entries match "${query}". Try a shorter term, or list a category with list_mrt_api.`);
|
|
64
|
+
}
|
|
65
|
+
return text(hits.map((hit) => formatEntry(hit, hit.category)).join('\n\n'));
|
|
66
|
+
});
|
|
67
|
+
server.registerTool('get_mrt_api', {
|
|
68
|
+
title: 'Get one Material React Table API entry',
|
|
69
|
+
description: 'Return the type, default, source library, description, and docs link for one table option, column option, state slice, or instance method by exact name.',
|
|
70
|
+
inputSchema: {
|
|
71
|
+
name: z
|
|
72
|
+
.string()
|
|
73
|
+
.min(1)
|
|
74
|
+
.describe('Exact option, state, or method name, e.g. "enableRowSelection" or "getSelectedRowModel".'),
|
|
75
|
+
category: z
|
|
76
|
+
.enum(CATEGORIES)
|
|
77
|
+
.optional()
|
|
78
|
+
.describe('Category to look in. When omitted, every category is checked and all matches are returned.'),
|
|
79
|
+
},
|
|
80
|
+
}, async ({ name, category }) => {
|
|
81
|
+
const matches = [];
|
|
82
|
+
for (const cat of category ? [category] : CATEGORIES) {
|
|
83
|
+
const entry = api.categories[cat].find((row) => row.name === name);
|
|
84
|
+
if (entry)
|
|
85
|
+
matches.push(formatEntry(entry, cat));
|
|
86
|
+
}
|
|
87
|
+
if (matches.length === 0) {
|
|
88
|
+
const suggestions = searchApi(api, name, category ? [category] : CATEGORIES, 5).map((hit) => `${hit.name} (${hit.category})`);
|
|
89
|
+
return text(`"${name}" is not a Material React Table ${category ?? 'API'} entry.${suggestions.length ? ` Did you mean: ${suggestions.join(', ')}?` : ''}`);
|
|
90
|
+
}
|
|
91
|
+
return text(matches.join('\n\n'));
|
|
92
|
+
});
|
|
93
|
+
server.registerTool('list_mrt_api', {
|
|
94
|
+
title: 'List a Material React Table API category',
|
|
95
|
+
description: `List every entry in one category with a one-line description. Categories: ${CATEGORIES.map((cat) => `${cat} (${categoryDescriptions[cat]})`).join('; ')}.`,
|
|
96
|
+
inputSchema: {
|
|
97
|
+
category: z.enum(CATEGORIES),
|
|
98
|
+
prefix: z
|
|
99
|
+
.string()
|
|
100
|
+
.optional()
|
|
101
|
+
.describe('Only entries whose name starts with this prefix, e.g. "mui", "render", "enable", "on", "get".'),
|
|
102
|
+
},
|
|
103
|
+
}, async ({ category, prefix }) => {
|
|
104
|
+
const rows = api.categories[category].filter((row) => !prefix || row.name.startsWith(prefix));
|
|
105
|
+
if (rows.length === 0)
|
|
106
|
+
return text(`No ${category} entries start with "${prefix}".`);
|
|
107
|
+
const lines = rows.map((row) => {
|
|
108
|
+
const summary = row.description.replace(/\s+/g, ' ').trim();
|
|
109
|
+
const type = row.type ? ` \`${row.type}\`` : '';
|
|
110
|
+
return `- ${row.name}${type}${summary ? ` - ${summary}` : ''}`;
|
|
111
|
+
});
|
|
112
|
+
return text(`${category}: ${categoryDescriptions[category]} (${rows.length} entries)\n\n${lines.join('\n')}`);
|
|
113
|
+
});
|
|
114
|
+
server.registerTool('get_mrt_migration_guide', {
|
|
115
|
+
title: 'Get the Material React Table V3 to V4 migration guide',
|
|
116
|
+
description: 'Return the full migration guide: switching from material-react-table to @mini_7/material-react-table, Material UI V9 changes (slotProps, date pickers), and every TanStack Table V9 rename and behaviour change.',
|
|
117
|
+
inputSchema: {},
|
|
118
|
+
}, async () => text(loadMigrationGuide()));
|
|
119
|
+
server.registerTool('get_mrt_skill', {
|
|
120
|
+
title: 'Get a Material React Table agent skill',
|
|
121
|
+
description: `Return one of the bundled SKILL.md guides for coding agents (${listSkills().join(', ')}). Call without a name to list them with their descriptions.`,
|
|
122
|
+
inputSchema: {
|
|
123
|
+
name: z
|
|
124
|
+
.string()
|
|
125
|
+
.optional()
|
|
126
|
+
.describe('Skill name. Omit to list available skills.'),
|
|
127
|
+
},
|
|
128
|
+
}, async ({ name }) => {
|
|
129
|
+
if (!name) {
|
|
130
|
+
const summaries = listSkills().map((skill) => {
|
|
131
|
+
const body = loadSkill(skill) ?? '';
|
|
132
|
+
const match = body.match(/description:\s*>?\s*\n?([\s\S]*?)\nmetadata:/);
|
|
133
|
+
const description = match ? match[1].replace(/\s+/g, ' ').trim() : '';
|
|
134
|
+
return `- ${skill}: ${description}`;
|
|
135
|
+
});
|
|
136
|
+
return text(`Available skills:\n${summaries.join('\n')}`);
|
|
137
|
+
}
|
|
138
|
+
const skill = loadSkill(name);
|
|
139
|
+
if (!skill)
|
|
140
|
+
return text(`Unknown skill "${name}". Available: ${listSkills().join(', ')}.`);
|
|
141
|
+
return text(skill);
|
|
142
|
+
});
|
|
143
|
+
const REFERENCE_PAGES = docs.reference.map((page) => page.name);
|
|
144
|
+
const toolFor = {
|
|
145
|
+
guide: 'get_mrt_guide',
|
|
146
|
+
reference: 'get_mrt_reference',
|
|
147
|
+
skill: 'get_mrt_skill',
|
|
148
|
+
example: 'get_mrt_example',
|
|
149
|
+
};
|
|
150
|
+
server.registerTool('search_mrt_docs', {
|
|
151
|
+
title: 'Search the Material React Table guides, examples, and skills',
|
|
152
|
+
description: 'Find which guide, reference page, skill, or example covers a topic. Matches names, titles, headings, and descriptions, and tells you which tool to call next. Use search_mrt_api instead for a specific option or method name.',
|
|
153
|
+
inputSchema: {
|
|
154
|
+
query: z
|
|
155
|
+
.string()
|
|
156
|
+
.min(1)
|
|
157
|
+
.describe('Words to match, e.g. "row selection", "virtualization", "detail panel", "export csv".'),
|
|
158
|
+
limit: z
|
|
159
|
+
.number()
|
|
160
|
+
.int()
|
|
161
|
+
.min(1)
|
|
162
|
+
.max(100)
|
|
163
|
+
.optional()
|
|
164
|
+
.describe('Maximum hits to return. Defaults to 20.'),
|
|
165
|
+
},
|
|
166
|
+
}, async ({ query, limit }) => {
|
|
167
|
+
const hits = searchDocs(docs, query, limit ?? 20);
|
|
168
|
+
if (hits.length === 0) {
|
|
169
|
+
return text(`Nothing in the Material React Table docs matches "${query}". Try a shorter term, or list everything with get_mrt_guide or get_mrt_example.`);
|
|
170
|
+
}
|
|
171
|
+
return text(hits
|
|
172
|
+
.map((hit) => `- ${hit.kind} \`${hit.name}\` (${toolFor[hit.kind]}): ${hit.summary}`)
|
|
173
|
+
.join('\n'));
|
|
174
|
+
});
|
|
175
|
+
server.registerTool('get_mrt_guide', {
|
|
176
|
+
title: 'Get a Material React Table feature guide',
|
|
177
|
+
description: `Return one of the ${docs.guides.length} docs guides as Markdown, with its relevant options expanded and its live examples named (fetch those with get_mrt_example). Call without a name to list the guides.`,
|
|
178
|
+
inputSchema: {
|
|
179
|
+
name: z
|
|
180
|
+
.string()
|
|
181
|
+
.optional()
|
|
182
|
+
.describe('Guide name, e.g. "editing", "column-filtering", "virtualization". Omit to list all guides.'),
|
|
183
|
+
},
|
|
184
|
+
}, async ({ name }) => {
|
|
185
|
+
if (!name) {
|
|
186
|
+
return text(`Guides:\n${docs.guides.map((guide) => `- ${guide.name}: ${guide.description || guide.title}`).join('\n')}`);
|
|
187
|
+
}
|
|
188
|
+
const guide = loadGuide(name);
|
|
189
|
+
if (!guide) {
|
|
190
|
+
const suggestions = searchDocs(docs, name, 5, ['guide']).map((hit) => hit.name);
|
|
191
|
+
return text(`Unknown guide "${name}".${suggestions.length ? ` Did you mean: ${suggestions.join(', ')}?` : ''} Call get_mrt_guide without a name to list them.`);
|
|
192
|
+
}
|
|
193
|
+
return text(guide);
|
|
194
|
+
});
|
|
195
|
+
server.registerTool('get_mrt_reference', {
|
|
196
|
+
title: 'Get the Material React Table components or hooks reference',
|
|
197
|
+
description: `Return a reference page as Markdown: ${docs.reference.map((page) => `"${page.name}" (${page.description})`).join(', ')}.`,
|
|
198
|
+
inputSchema: {
|
|
199
|
+
page: z.enum(REFERENCE_PAGES),
|
|
200
|
+
},
|
|
201
|
+
}, async ({ page }) => text(loadReference(page) ?? `Unknown page "${page}".`));
|
|
202
|
+
server.registerTool('get_mrt_example', {
|
|
203
|
+
title: 'Get a Material React Table example',
|
|
204
|
+
description: `Return the full TypeScript source of one of the ${docs.examples.length} runnable docs examples. Call without an id to list every example with the guides that embed it.`,
|
|
205
|
+
inputSchema: {
|
|
206
|
+
id: z
|
|
207
|
+
.string()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe('Example id, e.g. "basic", "editing-crud-modal", "virtualized", "remote". Omit to list all examples.'),
|
|
210
|
+
},
|
|
211
|
+
}, async ({ id }) => {
|
|
212
|
+
if (!id) {
|
|
213
|
+
const lines = docs.examples.map((example) => {
|
|
214
|
+
const where = [
|
|
215
|
+
example.guides.length ? `guides: ${example.guides.join(', ')}` : '',
|
|
216
|
+
example.pages.length ? `pages: ${example.pages.join(', ')}` : '',
|
|
217
|
+
]
|
|
218
|
+
.filter(Boolean)
|
|
219
|
+
.join('; ');
|
|
220
|
+
return `- ${example.id}${where ? ` (${where})` : ''}`;
|
|
221
|
+
});
|
|
222
|
+
return text(`Examples:\n${lines.join('\n')}`);
|
|
223
|
+
}
|
|
224
|
+
const source = loadExample(id);
|
|
225
|
+
if (!source) {
|
|
226
|
+
const suggestions = searchDocs(docs, id, 5, ['example']).map((hit) => hit.name);
|
|
227
|
+
return text(`Unknown example "${id}".${suggestions.length ? ` Did you mean: ${suggestions.join(', ')}?` : ''} Call get_mrt_example without an id to list them.`);
|
|
228
|
+
}
|
|
229
|
+
return text(`// examples/${id}/sandbox/src/TS.tsx\n${source}`);
|
|
230
|
+
});
|
|
231
|
+
const transport = new StdioServerTransport();
|
|
232
|
+
await server.connect(transport);
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mini_7/material-react-table-mcp",
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "MCP server that lets AI coding agents look up Material React Table V4 table options, column options, state, instance APIs, the V3 to V4 migration guide, and the bundled agent skills.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Tyler Lee",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"material-react-table-mcp": "dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"data"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"model-context-protocol",
|
|
18
|
+
"material-react-table",
|
|
19
|
+
"tanstack table",
|
|
20
|
+
"material-ui"
|
|
21
|
+
],
|
|
22
|
+
"repository": {
|
|
23
|
+
"type": "git",
|
|
24
|
+
"url": "git+https://github.com/gyminii/material-react-table.git",
|
|
25
|
+
"directory": "packages/material-react-table-mcp"
|
|
26
|
+
},
|
|
27
|
+
"homepage": "https://github.com/gyminii/material-react-table/tree/v4/packages/material-react-table-mcp",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/gyminii/material-react-table/issues"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=22.12"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"build": "pnpm generate-data && tsc -p tsconfig.json",
|
|
36
|
+
"generate-data": "tsx scripts/generate-data.ts",
|
|
37
|
+
"lint": "tsc --noEmit -p tsconfig.json",
|
|
38
|
+
"start": "node dist/index.js",
|
|
39
|
+
"test": "tsx scripts/smoke-test.ts"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
43
|
+
"zod": "^4.5.4"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.10.2",
|
|
47
|
+
"tsx": "^4.23.13",
|
|
48
|
+
"typescript": "5.7.2"
|
|
49
|
+
}
|
|
50
|
+
}
|